diff --git a/package.json b/package.json index 5ce9058..7cb3b5c 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "onLanguage:glsl", "onLanguage:hlsl", "onLanguage:cuda", - "onLanguage:cuda-cpp" + "onLanguage:cuda-cpp", + "onLanguage:tablegen" ], "contributes": { "configuration": { @@ -305,6 +306,21 @@ "default": "", "description": "clang-format fallback style for CUDA, left empty to use clang-format.fallbackStyle" }, + "clang-format.language.tablegen.enable": { + "type": "boolean", + "default": true, + "description": "enable formatting for TableGen (requires reloading Visual Studio Code)" + }, + "clang-format.language.teblegen.style": { + "type": "string", + "default": "", + "description": "clang-format fallback style for TableGen, left empty to use clang-format.style" + }, + "clang-format.language.teblegen.fallbackStyle": { + "type": "string", + "default": "", + "description": "clang-format fallback style for TableGen, left empty to use clang-format.fallbackStyle" + }, "clang-format.assumeFilename": { "type": "string", "default": "", diff --git a/src/clangMode.ts b/src/clangMode.ts index 5c16021..f01f699 100644 --- a/src/clangMode.ts +++ b/src/clangMode.ts @@ -7,7 +7,7 @@ export const ALIAS = { }; let languages: string[] = []; -for (let l of ['cpp', 'c', 'csharp', 'objective-c', 'objective-cpp', 'java', 'javascript', 'json', 'typescript', 'proto', 'proto3', 'textproto', 'apex', 'glsl', 'hlsl', 'cuda', 'cuda-cpp']) { +for (let l of ['cpp', 'c', 'csharp', 'objective-c', 'objective-cpp', 'java', 'javascript', 'json', 'typescript', 'proto', 'proto3', 'textproto', 'apex', 'glsl', 'hlsl', 'cuda', 'cuda-cpp','tablegen']) { let confKey = `language.${ALIAS[l] || l}.enable`; if (vscode.workspace.getConfiguration('clang-format').get(confKey)) { languages.push(l);