Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"default": []
},
"semantic_tokens": {
"description": "Set level of semantic tokens. `partial` only includes information that requires semantic analysis.",
"description": "Deprecated. The client should set the 'augmentsSyntaxTokens' capability.\n\nSet level of semantic tokens. `partial` only includes information that requires semantic analysis.",
"type": "string",
"enum": [
"none",
Expand Down
2 changes: 2 additions & 0 deletions src/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ enable_build_on_save: ?bool = null,
/// If the `build.zig` has declared a 'check' step, it will be preferred over the default 'install' step.
build_on_save_args: []const []const u8 = &.{},

/// Deprecated. The client should set the 'augmentsSyntaxTokens' capability.
///
/// Set level of semantic tokens. `partial` only includes information that requires semantic analysis.
semantic_tokens: enum {
none,
Expand Down
6 changes: 4 additions & 2 deletions src/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const ClientCapabilities = struct {
supports_publish_diagnostics: bool = false,
supports_code_action_fixall: bool = false,
supports_semantic_tokens_overlapping: bool = false,
semantic_tokens_augment_syntax_tokens: bool = false,
hover_supports_md: bool = false,
signature_help_supports_md: bool = false,
completion_doc_supports_md: bool = false,
Expand Down Expand Up @@ -458,6 +459,7 @@ fn initializeHandler(server: *Server, arena: std.mem.Allocator, request: types.I
}
if (textDocument.semanticTokens) |semanticTokens| {
server.client_capabilities.supports_semantic_tokens_overlapping = semanticTokens.overlappingTokenSupport orelse false;
server.client_capabilities.semantic_tokens_augment_syntax_tokens = semanticTokens.augmentsSyntaxTokens orelse false;
}
}

Expand Down Expand Up @@ -1254,7 +1256,7 @@ fn semanticTokensFullHandler(server: *Server, arena: std.mem.Allocator, request:
handle,
null,
server.offset_encoding,
server.config_manager.config.semantic_tokens == .partial,
server.client_capabilities.semantic_tokens_augment_syntax_tokens or server.config_manager.config.semantic_tokens == .partial,
server.client_capabilities.supports_semantic_tokens_overlapping,
);
}
Expand All @@ -1281,7 +1283,7 @@ fn semanticTokensRangeHandler(server: *Server, arena: std.mem.Allocator, request
handle,
loc,
server.offset_encoding,
server.config_manager.config.semantic_tokens == .partial,
server.client_capabilities.semantic_tokens_augment_syntax_tokens or server.config_manager.config.semantic_tokens == .partial,
server.client_capabilities.supports_semantic_tokens_overlapping,
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
{
"name": "semantic_tokens",
"description": "Set level of semantic tokens. `partial` only includes information that requires semantic analysis.",
"description": "Deprecated. The client should set the 'augmentsSyntaxTokens' capability.\n\nSet level of semantic tokens. `partial` only includes information that requires semantic analysis.",
"type": "enum",
"enum": [
"none",
Expand Down
Loading