You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
semanticTokensProvider is returned as Null when semantic tokens are unavailable #6
The value comes from LSPServer/Kernel/LSPServer.wl in lines 1090-1108:
If[$SemanticTokens,
If[KeyExistsQ[textDocument, "semanticTokens"],
semanticTokensProviderValue=<|
"legend"-><|
"tokenTypes"->Keys[$SemanticTokenTypes],
"tokenModifiers"->Keys[$SemanticTokenModifiers]
|>,
"range"->False,
"full"-><| "delta"->False |>
|>
,
(* if client does not advertise semantic token support, then do not respond with any support *)semanticTokensProviderValue=Null
];
,
semanticTokensProviderValue=Null
];
The LSP specification indicates that a missing property should be interpreted as an absence of the capability. The comment in the source also seems to suggest that the intent was not to advertise semantic token support when the client does not request it:
(*if client does not advertise semantic token support, then do not respond with any support*)
Effect in Neovim
With Neovim 0.12.3, the language server attaches successfully, but repeated errors are produced from vim.lsp.semantic_tokens:
vim.schedule callback:
/usr/share/nvim/runtime/lua/vim/lsp/semantic_tokens.lua:437:
/usr/share/nvim/runtime/lua/vim/lsp/semantic_tokens.lua:85:
attempt to index field 'semanticTokensProvider' (a userdata value)
I had a different workaround, which is to enable semanticTokens in the init options. See the PR (linked above this comment) I just summit to nvim-lspconfig with the name wolfram_lsp. Also you can test whether that works or not :)
Activity
xlucn commentedon Jul 11, 2026
I had a different workaround, which is to enable
semanticTokensin the init options. See the PR (linked above this comment) I just summit to nvim-lspconfig with the namewolfram_lsp. Also you can test whether that works or not :)