Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/IDE/CompletionInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,6 @@ bool CompletionInstance::performCachedOperationIfPossible(
}

CachedReuseCount += 1;
cacheDependencyHashIfNeeded(CI, CurrentModule, SM.getCodeCompletionBufferID(),
InMemoryDependencyHash);

return true;
}
Expand Down
29 changes: 26 additions & 3 deletions test/SourceKit/CodeComplete/complete_checkdeps_vfs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ func foo(value: MyStruct) {

// REQUIRES: shell

// RUN: DEPCHECK_INTERVAL=1
// RUN: SLEEP_TIME=2
// RUN: DEPCHECK_INTERVAL=2
// RUN: SLEEP_TIME=3

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

// RUN: -shell -- echo "### Keep" == \
// RUN: -shell -- sleep ${SLEEP_TIME} == \
// 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 \
// 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 == \

// RUN: -shell -- echo "### Rollback without sleep" == \
// 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 == \

// RUN: -shell -- echo "### After sleep" == \
// RUN: -shell -- sleep ${SLEEP_TIME} == \
// 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 \

// RUN: | %FileCheck %s

Expand All @@ -50,3 +57,19 @@ func foo(value: MyStruct) {
// CHECK-DAG: key.description: "self"
// CHECK: ]
// CHECK: key.reusingastcontext: 1

// CHECK-LABEL: ### Rollback without sleep
// CHECK: key.results: [
// CHECK-DAG: key.description: "myStructMethod_mod()"
// CHECK-DAG: key.description: "extensionMethod()"
// CHECK-DAG: key.description: "self"
// CHECK: ]
// CHECK: key.reusingastcontext: 1

// CHECK-LABEL: ### After sleep
// CHECK: key.results: [
// CHECK-DAG: key.description: "myStructMethod()"
// CHECK-DAG: key.description: "extensionMethod()"
// CHECK-DAG: key.description: "self"
// CHECK: ]
// CHECK-NOT: key.reusingastcontext: 1