Skip to content

Commit 9ee8cd2

Browse files
authored
Merge pull request #33645 from rintaro/ide-completion-rdar67773257
[CodeCompletion] Don't update VFS content hash map after each completion
2 parents 0ade99f + bf5fb4d commit 9ee8cd2

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

lib/IDE/CompletionInstance.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,6 @@ bool CompletionInstance::performCachedOperationIfPossible(
485485
}
486486

487487
CachedReuseCount += 1;
488-
cacheDependencyHashIfNeeded(CI, SM.getCodeCompletionBufferID(),
489-
InMemoryDependencyHash);
490488

491489
return true;
492490
}

test/SourceKit/CodeComplete/complete_checkdeps_vfs.swift

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ func foo(value: MyStruct) {
44

55
// REQUIRES: shell
66

7-
// RUN: DEPCHECK_INTERVAL=1
8-
// RUN: SLEEP_TIME=2
7+
// RUN: DEPCHECK_INTERVAL=2
8+
// RUN: SLEEP_TIME=3
99

1010
// RUN: %empty-directory(%t)
1111
// RUN: %empty-directory(%t/VFS)
@@ -23,7 +23,14 @@ func foo(value: MyStruct) {
2323

2424
// RUN: -shell -- echo "### Keep" == \
2525
// RUN: -shell -- sleep ${SLEEP_TIME} == \
26-
// RUN: -req=complete -pos=2:9 -pass-as-sourcetext -vfs-files=%t/VFS/Main.swift=@%s,%t/VFS/Library.swift=@%S/Inputs/checkdeps/MyProject_mod/Library.swift %t/VFS/Main.swift -- -target %target-triple %t/VFS/Main.swift %t/VFS/LibraryExt.swift %t/VFS/Library.swift \
26+
// RUN: -req=complete -pos=2:9 -pass-as-sourcetext -vfs-files=%t/VFS/Main.swift=@%s,%t/VFS/Library.swift=@%S/Inputs/checkdeps/MyProject_mod/Library.swift %t/VFS/Main.swift -- -target %target-triple %t/VFS/Main.swift %t/VFS/LibraryExt.swift %t/VFS/Library.swift == \
27+
28+
// RUN: -shell -- echo "### Rollback without sleep" == \
29+
// RUN: -req=complete -pos=2:9 -pass-as-sourcetext -vfs-files=%t/VFS/Main.swift=@%s,%t/VFS/Library.swift=@%S/Inputs/checkdeps/MyProject/Library.swift %t/VFS/Main.swift -- -target %target-triple %t/VFS/Main.swift %t/VFS/LibraryExt.swift %t/VFS/Library.swift == \
30+
31+
// RUN: -shell -- echo "### After sleep" == \
32+
// RUN: -shell -- sleep ${SLEEP_TIME} == \
33+
// RUN: -req=complete -pos=2:9 -pass-as-sourcetext -vfs-files=%t/VFS/Main.swift=@%s,%t/VFS/Library.swift=@%S/Inputs/checkdeps/MyProject/Library.swift %t/VFS/Main.swift -- -target %target-triple %t/VFS/Main.swift %t/VFS/LibraryExt.swift %t/VFS/Library.swift \
2734

2835
// RUN: | %FileCheck %s
2936

@@ -50,3 +57,19 @@ func foo(value: MyStruct) {
5057
// CHECK-DAG: key.description: "self"
5158
// CHECK: ]
5259
// CHECK: key.reusingastcontext: 1
60+
61+
// CHECK-LABEL: ### Rollback without sleep
62+
// CHECK: key.results: [
63+
// CHECK-DAG: key.description: "myStructMethod_mod()"
64+
// CHECK-DAG: key.description: "extensionMethod()"
65+
// CHECK-DAG: key.description: "self"
66+
// CHECK: ]
67+
// CHECK: key.reusingastcontext: 1
68+
69+
// CHECK-LABEL: ### After sleep
70+
// CHECK: key.results: [
71+
// CHECK-DAG: key.description: "myStructMethod()"
72+
// CHECK-DAG: key.description: "extensionMethod()"
73+
// CHECK-DAG: key.description: "self"
74+
// CHECK: ]
75+
// CHECK-NOT: key.reusingastcontext: 1

0 commit comments

Comments
 (0)