@@ -881,6 +881,38 @@ final class SemanticTokensTests: XCTestCase {
881
881
)
882
882
}
883
883
884
+ func testRawIdentifier( ) async throws {
885
+ try await assertSemanticTokens (
886
+ markedContents: """
887
+ 1️⃣func 2️⃣`square returns x * x`() {}
888
+ 3️⃣`square returns x * x`()
889
+ """ ,
890
+ expected: [
891
+ TokenSpec ( marker: " 1️⃣ " , length: 4 , kind: . keyword) ,
892
+ TokenSpec ( marker: " 2️⃣ " , length: 22 , kind: . identifier) ,
893
+ TokenSpec ( marker: " 3️⃣ " , length: 22 , kind: . function) ,
894
+ ]
895
+ )
896
+ try await assertSemanticTokens (
897
+ markedContents: """
898
+ 1️⃣struct 2️⃣S {
899
+ 3️⃣static 4️⃣var 5️⃣`foo bar` = 6️⃣0
900
+ }
901
+ 7️⃣S.8️⃣`foo bar`
902
+ """ ,
903
+ expected: [
904
+ TokenSpec ( marker: " 1️⃣ " , length: 6 , kind: . keyword) ,
905
+ TokenSpec ( marker: " 2️⃣ " , length: 1 , kind: . identifier) ,
906
+ TokenSpec ( marker: " 3️⃣ " , length: 6 , kind: . keyword) ,
907
+ TokenSpec ( marker: " 4️⃣ " , length: 3 , kind: . keyword) ,
908
+ TokenSpec ( marker: " 5️⃣ " , length: 9 , kind: . identifier) ,
909
+ TokenSpec ( marker: " 6️⃣ " , length: 1 , kind: . number) ,
910
+ TokenSpec ( marker: " 7️⃣ " , length: 1 , kind: . struct) ,
911
+ TokenSpec ( marker: " 8️⃣ " , length: 9 , kind: . property) ,
912
+ ]
913
+ )
914
+ }
915
+
884
916
func testClang( ) async throws {
885
917
try await assertSemanticTokens (
886
918
markedContents: """
0 commit comments