@@ -46,8 +46,8 @@ func foo() {}
46
46
// SEMA_3: 1 {{.*}} source.statistic.num-ast-builds
47
47
// SEMA_3: 1 {{.*}} source.statistic.num-asts-in-memory
48
48
// SEMA_3: 1 {{.*}} source.statistic.max-asts-in-memory
49
- // SEMA_3: 0 {{.*}} source.statistic.num-ast-cache-hits
50
- // SEMA_3: 1 {{.*}} source.statistic.num-ast-snaphost-uses
49
+ // SEMA_3: 1 {{.*}} source.statistic.num-ast-cache-hits
50
+ // SEMA_3: 0 {{.*}} source.statistic.num-ast-snaphost-uses
51
51
52
52
// RUN: %sourcekitd-test -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=related-idents -pos=1:6 %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=stats | %FileCheck %s -check-prefix=SEMA_4
53
53
@@ -58,3 +58,14 @@ func foo() {}
58
58
// SEMA_4: 1 {{.*}} source.statistic.max-asts-in-memory
59
59
// SEMA_4: 1 {{.*}} source.statistic.num-ast-cache-hits
60
60
// SEMA_4: 0 {{.*}} source.statistic.num-ast-snaphost-uses
61
+
62
+ // Test that we can have two files open and don't need to rebuild an AST when doing the cursor info request on '%s' after opening '10bytes.swift'
63
+ // RUN: %sourcekitd-test \
64
+ // RUN: -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == \
65
+ // RUN: -req=sema %S/Inputs/10bytes.swift -- -Xfrontend -disable-implicit-concurrency-module-import %S/Inputs/10bytes.swift == \
66
+ // RUN: -req=cursor -pos=1:6 %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == \
67
+ // RUN: -req=stats | %FileCheck %s -check-prefix=OPEN_TWO_FILES
68
+
69
+ // OPEN_TWO_FILES: 2 {{.*}} source.statistic.num-ast-builds
70
+ // OPEN_TWO_FILES: 2 {{.*}} source.statistic.num-asts-in-memory
71
+ // OPEN_TWO_FILES: 2 {{.*}} source.statistic.max-asts-in-memory
0 commit comments