From ec7ed30e6572fac8e556db0f00f850504c171ec2 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 29 Mar 2021 19:04:55 -0500 Subject: [PATCH] Add check for semantic tokens client capability --- src/main.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index c0e8df0..ef38310 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1375,7 +1375,7 @@ fn closeDocumentHandler(arena: *std.heap.ArenaAllocator, id: types.RequestId, re } fn semanticTokensFullHandler(arena: *std.heap.ArenaAllocator, id: types.RequestId, req: requests.SemanticTokensFull, config: Config) (error{OutOfMemory} || std.fs.File.WriteError)!void { - if (config.enable_semantic_tokens) { + if (config.enable_semantic_tokens and client_capabilities.supports_semantic_tokens) { const handle = document_store.getHandle(req.params.textDocument.uri) orelse { logger.warn("Trying to get semantic tokens of non existent document {s}", .{req.params.textDocument.uri}); return try respondGeneric(id, no_semantic_tokens_response);