Skip to content

Commit 9e16906

Browse files
committed
[test] Add test case for raw identifier semantic tokens
rdar://152273926
1 parent e34eb33 commit 9e16906

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
3+
// RUN: %sourcekitd-test -req=semantic-tokens %t/main.swift -- %t/main.swift > %t/result.json
4+
// RUN: diff -u %t/tokens.json %t/result.json
5+
6+
//--- main.swift
7+
func `foo`(x: Int) {}
8+
`foo`(x: 0)
9+
10+
func `foo bar baz`() {}
11+
`foo bar baz`()
12+
13+
//--- tokens.json
14+
{
15+
key.semantic_tokens: [
16+
{
17+
key.kind: source.lang.swift.ref.struct,
18+
key.offset: 14,
19+
key.length: 3,
20+
key.is_system: 1
21+
},
22+
{
23+
key.kind: source.lang.swift.ref.function.free,
24+
key.offset: 22,
25+
key.length: 5
26+
},
27+
{
28+
key.kind: source.lang.swift.ref.function.free,
29+
key.offset: 59,
30+
key.length: 13
31+
}
32+
]
33+
}

0 commit comments

Comments
 (0)