File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/SourceKit/CodeComplete Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -7383,7 +7383,8 @@ Parser::parseAbstractFunctionBodyImpl(AbstractFunctionDecl *AFD) {
7383
7383
// In implicit getter, if a CC token is the first token after '{', it might
7384
7384
// be a start of an accessor block. Perform special completion for that.
7385
7385
if (auto accessor = dyn_cast<AccessorDecl>(AFD)) {
7386
- if (peekToken ().is (tok::code_complete) && accessor->isImplicitGetter ()) {
7386
+ if (CodeCompletion && peekToken ().is (tok::code_complete) &&
7387
+ accessor->isImplicitGetter ()) {
7387
7388
SourceLoc LBraceLoc, RBraceLoc;
7388
7389
LBraceLoc = consumeToken (tok::l_brace);
7389
7390
auto *CCE = new (Context) CodeCompletionExpr (Tok.getLoc ());
Original file line number Diff line number Diff line change
1
+
2
+ var foo : Double { 1 / 2 }
3
+ var bar : Regex < Substring > { /x/ }
4
+ var baz : Regex < Substring > { / x/ }
5
+ var qux : Regex < Substring > { / x}/ }
6
+
7
+ // Check that we are not crashing
8
+ // RUN: %sourcekitd-test \
9
+ // RUN: -req=complete -pos=2:18 %s -- -enable-bare-slash-regex %s == \
10
+ // RUN: -req=complete -pos=3:28 %s -- -enable-bare-slash-regex %s == \
11
+ // RUN: -req=complete -pos=4:28 %s -- -enable-bare-slash-regex %s == \
12
+ // RUN: -req=complete -pos=5:28 %s -- -enable-bare-slash-regex %s
13
+
14
+ // REQUIRES: swift_in_compiler
You can’t perform that action at this time.
0 commit comments