@@ -80,6 +80,23 @@ public struct WorkspaceClientCapabilities: Hashable, Codable {
80
80
}
81
81
}
82
82
83
+ /// Capabilities specific to the `workspace/semanticTokens/refresh` request.
84
+ public struct SemanticTokensWorkspace : Hashable , Codable {
85
+
86
+ /// Whether the client implementation supports a refresh request sent from
87
+ /// the server to the client.
88
+ ///
89
+ /// Note that this event is global and will force the client to refresh all
90
+ /// semantic tokens currently shown. It should be used with absolute care
91
+ /// and is useful for situation where a server, for example, detects a project
92
+ /// wide change that requires such a calculation.
93
+ public var refreshSupport : Bool ?
94
+
95
+ public init ( refreshSupport: Bool ? = nil ) {
96
+ self . refreshSupport = refreshSupport
97
+ }
98
+ }
99
+
83
100
// MARK: Properties
84
101
85
102
/// Whether the client can apply text edits via the `workspace/applyEdit` request.
@@ -103,7 +120,19 @@ public struct WorkspaceClientCapabilities: Hashable, Codable {
103
120
/// Whether the client supports the `workspace/configuration` request.
104
121
public var configuration : Bool ? = nil
105
122
106
- public init ( applyEdit: Bool ? = nil , workspaceEdit: WorkspaceEdit ? = nil , didChangeConfiguration: DynamicRegistrationCapability ? = nil , didChangeWatchedFiles: DynamicRegistrationCapability ? = nil , symbol: Symbol ? = nil , executeCommand: DynamicRegistrationCapability ? = nil , workspaceFolders: Bool ? = nil , configuration: Bool ? = nil ) {
123
+ public var semanticTokens : SemanticTokensWorkspace ? = nil
124
+
125
+ public init (
126
+ applyEdit: Bool ? = nil ,
127
+ workspaceEdit: WorkspaceEdit ? = nil ,
128
+ didChangeConfiguration: DynamicRegistrationCapability ? = nil ,
129
+ didChangeWatchedFiles: DynamicRegistrationCapability ? = nil ,
130
+ symbol: Symbol ? = nil ,
131
+ executeCommand: DynamicRegistrationCapability ? = nil ,
132
+ workspaceFolders: Bool ? = nil ,
133
+ configuration: Bool ? = nil ,
134
+ semanticTokens: SemanticTokensWorkspace ? = nil
135
+ ) {
107
136
self . applyEdit = applyEdit
108
137
self . workspaceEdit = workspaceEdit
109
138
self . didChangeConfiguration = didChangeConfiguration
@@ -112,6 +141,7 @@ public struct WorkspaceClientCapabilities: Hashable, Codable {
112
141
self . executeCommand = executeCommand
113
142
self . workspaceFolders = workspaceFolders
114
143
self . configuration = configuration
144
+ self . semanticTokens = semanticTokens
115
145
}
116
146
}
117
147
@@ -394,6 +424,81 @@ public struct TextDocumentClientCapabilities: Hashable, Codable {
394
424
}
395
425
}
396
426
427
+ public struct SemanticTokensRangeClientCapabilities : Equatable , Hashable , Codable {
428
+ // Empty in the LSP 3.16 spec.
429
+ public init ( ) { }
430
+ }
431
+
432
+ public struct SemanticTokensFullClientCapabilities : Equatable , Hashable , Codable {
433
+ /// The client will also send the `textDocument/semanticTokens/full/delta`
434
+ /// request if the server provides a corresponding handler.
435
+ public var delta : Bool ?
436
+
437
+ public init ( delta: Bool ? = nil ) {
438
+ self . delta = delta
439
+ }
440
+ }
441
+
442
+ public struct SemanticTokensRequestsClientCapabilities : Equatable , Hashable , Codable {
443
+ /// The client will send the `textDocument/semanticTokens/range` request
444
+ /// if the server provides a corresponding handler.
445
+ public var range : ValueOrBool < SemanticTokensRangeClientCapabilities > ?
446
+
447
+ /// The client will send the `textDocument/semanticTokens/full` request
448
+ /// if the server provides a corresponding handler.
449
+ public var full : ValueOrBool < SemanticTokensFullClientCapabilities > ?
450
+
451
+ public init (
452
+ range: ValueOrBool < SemanticTokensRangeClientCapabilities > ? ,
453
+ full: ValueOrBool < SemanticTokensFullClientCapabilities > ?
454
+ ) {
455
+ self . range = range
456
+ self . full = full
457
+ }
458
+ }
459
+
460
+ /// Capabilities specific to `textDocument/semanticTokens`.
461
+ public struct SemanticTokens : Equatable , Hashable , Codable {
462
+
463
+ /// Whether the client supports dynamic registration of this request.
464
+ public var dynamicRegistration : Bool ? = nil
465
+
466
+ public var requests : SemanticTokensRequestsClientCapabilities
467
+
468
+ /// The token types that the client supports.
469
+ public var tokenTypes : [ String ]
470
+
471
+ /// The token modifiers that the client supports.
472
+ public var tokenModifiers : [ String ]
473
+
474
+ /// The formats the clients supports.
475
+ public var formats : [ TokenFormat ]
476
+
477
+ /// Whether the client supports tokens that can overlap each other.
478
+ public var overlappingTokenSupport : Bool ? = nil
479
+
480
+ /// Whether the client supports tokens that can span multiple lines.
481
+ public var multilineTokenSupport : Bool ? = nil
482
+
483
+ public init (
484
+ dynamicRegistration: Bool ? = nil ,
485
+ requests: SemanticTokensRequestsClientCapabilities ,
486
+ tokenTypes: [ String ] ,
487
+ tokenModifiers: [ String ] ,
488
+ formats: [ TokenFormat ] ,
489
+ overlappingTokenSupport: Bool ? = nil ,
490
+ multilineTokenSupport: Bool ? = nil
491
+ ) {
492
+ self . dynamicRegistration = dynamicRegistration
493
+ self . requests = requests
494
+ self . tokenTypes = tokenTypes
495
+ self . tokenModifiers = tokenModifiers
496
+ self . formats = formats
497
+ self . overlappingTokenSupport = overlappingTokenSupport
498
+ self . multilineTokenSupport = multilineTokenSupport
499
+ }
500
+ }
501
+
397
502
// MARK: Properties
398
503
399
504
public var synchronization : Synchronization ? = nil
@@ -440,6 +545,8 @@ public struct TextDocumentClientCapabilities: Hashable, Codable {
440
545
441
546
public var callHierarchy : DynamicRegistrationCapability ? = nil
442
547
548
+ public var semanticTokens : SemanticTokens ? = nil
549
+
443
550
public init ( synchronization: Synchronization ? = nil ,
444
551
completion: Completion ? = nil ,
445
552
hover: Hover ? = nil ,
@@ -461,7 +568,8 @@ public struct TextDocumentClientCapabilities: Hashable, Codable {
461
568
rename: DynamicRegistrationCapability ? = nil ,
462
569
publishDiagnostics: PublishDiagnostics ? = nil ,
463
570
foldingRange: FoldingRange ? = nil ,
464
- callHierarchy: DynamicRegistrationCapability ? = nil ) {
571
+ callHierarchy: DynamicRegistrationCapability ? = nil ,
572
+ semanticTokens: SemanticTokens ? = nil ) {
465
573
self . synchronization = synchronization
466
574
self . completion = completion
467
575
self . hover = hover
@@ -484,5 +592,6 @@ public struct TextDocumentClientCapabilities: Hashable, Codable {
484
592
self . publishDiagnostics = publishDiagnostics
485
593
self . foldingRange = foldingRange
486
594
self . callHierarchy = callHierarchy
595
+ self . semanticTokens = semanticTokens
487
596
}
488
597
}
0 commit comments