Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 41258 Build 41450: arc lint + arc unit
Event Timeline
A similar PR has been submitted to the vscode-cpptools repo to enable debugging CUDA files via cuda-gdb with the official Microsoft VSCode C++ plugin: https://github.com/microsoft/vscode-cpptools/pull/4585
Thanks for the patch.
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
86 | I think we could simplify the code, we could move this part to the package.json under the contributes umbrella, something like "contributes": { "languages": [ { "id": "cuda", "filenamePatterns": [ "**/*.{cu}", "**/*.{cuh}", ], } ] then in the extension.ts, we only need an entry { scheme: 'file', language: 'cuda' } when initailizing the clientOptions. |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
86 | Yes that's an option. I chose this approach to stay consistent with the current behavior, because vscode-clangd can do CUDA intellisense and refactoring, it doesn't contribute the CUDA grammar definitions for syntax highlighting. The VSCode docs aren't clear on whether multiple extensions can contribute separate features for the same language, or what happens when two plugins both contribute languages with the same languageId. |
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
86 |
Yes, I was not ware of this approach before.
The vscode doc says ontributes.languages can enrich the knowledge about vscode, but doesn't mention about what if there are multiple extensions contribute for the same language, but from our experience (clangd extension also contributes to cpp language for taking some file patterns into account), it seems no problem so far. Anyway, I'm also fine with the current approach. | |
93 | I'd drop A working ...., I don't know much about vscode-cudacpp. But in theory, clangd extension will work with any extension which provides the cuda language definition. |
- add package.json entry to contribute cuda language id
- remove extra cuda file patterns, update comments
sorry for the delay, looks good, one more nit.
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts | ||
---|---|---|
91 | This comment seems not correct anymore, I'd just drop it, or rephrase like VSCode does not have CUDA as a supported language yet, but our extension does. |
I think we could simplify the code, we could move this part to the package.json under the contributes umbrella, something like
then in the extension.ts, we only need an entry { scheme: 'file', language: 'cuda' } when initailizing the clientOptions.