[clang-tools-extra] [clangd] Add languages as server capabilities (PR #75633)
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 15 23:07:18 PDT 2025
HighCommander4 wrote:
> IIUC, we're trying to figure out if clangd should be used for documents for language `X`. We need to figure this out **before** clangd's proper initialization, so that we can decide which `documentSelector`s to provide.
Thanks, that's a good point that I overlooked!
(I think for some reason I imagined the document selector would be a function called at the time a file is opened, such that we can feed information from the actual clangd instance's server capabilities into it, and use that information for any file except the first one that triggered clangd's launch. But I see that it's actually just a declarative list of filters that needs to be provided up front.)
So, @llvm-beanz, I think we may need to abandon this idea, and go back to the drawing board on https://github.com/clangd/vscode-clangd/pull/392. We can start with enabling HLSL support based just on the presence of the client-side config option. Then once we're looking to make it the default, we could look at parsing the output of `clangd --version` as Kadir suggested and gate it on that.
https://github.com/llvm/llvm-project/pull/75633
More information about the cfe-commits
mailing list