File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,22 @@ final class SemanticTokensTests: XCTestCase {
71
71
72
72
let registerCapabilityExpectation = expectation ( description: " \( #function) - register semantic tokens capability " )
73
73
testClient. handleNextRequest { ( req: RegisterCapabilityRequest ) -> VoidResponse in
74
- XCTAssert (
75
- req. registrations. contains { reg in
76
- reg. method == SemanticTokensRegistrationOptions . method
77
- }
74
+ let capabilityRegistration = req. registrations. first { reg in
75
+ reg. method == SemanticTokensRegistrationOptions . method
76
+ }
77
+
78
+ guard case . dictionary( let registerOptionsDict) = capabilityRegistration? . registerOptions,
79
+ let registerOptions = SemanticTokensRegistrationOptions ( fromLSPDictionary: registerOptionsDict)
80
+ else {
81
+ XCTFail ( " Expected semantic tokens registration options dictionary " )
82
+ return VoidResponse ( )
83
+ }
84
+
85
+ XCTAssertFalse (
86
+ registerOptions. semanticTokenOptions. legend. tokenTypes. isEmpty,
87
+ " Expected semantic tokens legend "
78
88
)
89
+
79
90
registerCapabilityExpectation. fulfill ( )
80
91
return VoidResponse ( )
81
92
}
You can’t perform that action at this time.
0 commit comments