Skip to content

Commit 36358c2

Browse files
authored
Merge pull request #78 from xandox/add_cuda_language
add CUDA language
2 parents db44c33 + 21270e8 commit 36358c2

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

package.json

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"Objective-C",
2424
"Clang",
2525
"LLVM",
26-
"Protobuf"
26+
"Protobuf",
27+
"CUDA"
2728
],
2829
"main": "./out/src/extension",
2930
"activationEvents": [
@@ -37,7 +38,8 @@
3738
"onLanguage:proto",
3839
"onLanguage:proto3",
3940
"onLanguage:apex",
40-
"onLanguage:glsl"
41+
"onLanguage:glsl",
42+
"onLanguage:cuda"
4143
],
4244
"contributes": {
4345
"configuration": {
@@ -209,6 +211,21 @@
209211
"default": "",
210212
"description": "clang-format fallback style for GLSL, left empty to use clang-format.fallbackStyle"
211213
},
214+
"clang-format.language.cuda.enable": {
215+
"type": "boolean",
216+
"default": true,
217+
"description": "enable formatting for CUDA (requires reloading Visual Studio Code)"
218+
},
219+
"clang-format.language.cuda.style": {
220+
"type": "string",
221+
"default": "",
222+
"description": "clang-format fallback style for CUDA, left empty to use clang-format.style"
223+
},
224+
"clang-format.language.cuda.fallbackStyle": {
225+
"type": "string",
226+
"default": "",
227+
"description": "clang-format fallback style for CUDA, left empty to use clang-format.fallbackStyle"
228+
},
212229
"clang-format.assumeFilename": {
213230
"type": "string",
214231
"default": "",
@@ -234,4 +251,4 @@
234251
"url": "https://github.com/xaverh/vscode-clang-format-provider"
235252
},
236253
"license": "MIT"
237-
}
254+
}

src/clangMode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const ALIAS = {
77
};
88

99
let languages: string[] = [];
10-
for (let l of ['cpp', 'c', 'objective-c', 'objective-cpp', 'java', 'javascript', 'typescript', 'proto', 'proto3', 'apex', 'glsl']) {
10+
for (let l of ['cpp', 'c', 'objective-c', 'objective-cpp', 'java', 'javascript', 'typescript', 'proto', 'proto3', 'apex', 'glsl', 'cuda']) {
1111
let confKey = `language.${ALIAS[l] || l}.enable`;
1212
if (vscode.workspace.getConfiguration('clang-format').get(confKey)) {
1313
languages.push(l);

0 commit comments

Comments
 (0)