[clang-tools-extra] r363372 - [clangd] Don't maintain a list of c-family extensions in vscode extension.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 14 04:56:13 PDT 2019
Author: hokein
Date: Fri Jun 14 04:56:13 2019
New Revision: 363372
URL: http://llvm.org/viewvc/llvm-project?rev=363372&view=rev
Log:
[clangd] Don't maintain a list of c-family extensions in vscode extension.
Summary:
There is no need to maintain this list by ourself, vscode already
provides this feature.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63323
Modified:
clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts
Modified: clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts?rev=363372&r1=363371&r2=363372&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts (original)
+++ clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts Fri Jun 14 04:56:13 2019
@@ -72,18 +72,19 @@ export function activate(context: vscode
// having a corresponding 'onLanguage:...' activation event in package.json.
// However, VSCode does not have CUDA as a supported language yet, so we
// cannot add a corresponding activationEvent for CUDA files and clangd will
- // *not* load itself automatically on '.cu' files. When any of the files
- // with other extensions are open, clangd will load itself and will also
- // work on '.cu' files.
- const filePattern: string = '**/*.{' +
- ['cpp', 'c', 'cc', 'cu', 'cxx', 'c++', 'm', 'mm',
- 'h', 'hh', 'hpp', 'hxx', 'inc'].join()
- + '}';
+ // *not* load itself automatically on '.cu' files.
+ const cudaFilePattern: string = '**/*.{' +['cu'].join()+ '}';
const clientOptions: vscodelc.LanguageClientOptions = {
- // Register the server for C/C++ files
- documentSelector: [{ scheme: 'file', pattern: filePattern }],
+ // Register the server for c-family and cuda files.
+ documentSelector: [
+ { scheme: 'file', language: 'c' },
+ { scheme: 'file', language: 'cpp' },
+ { scheme: 'file', language: 'objective-c'},
+ { scheme: 'file', language: 'objective-cpp'},
+ { scheme: 'file', pattern: cudaFilePattern },
+ ],
synchronize: !syncFileEvents ? undefined : {
- fileEvents: vscode.workspace.createFileSystemWatcher(filePattern)
+ // FIXME: send sync file events when clangd provides implemenatations.
},
initializationOptions: { clangdFileStatus: true },
// Do not switch to output window when clangd returns output
More information about the cfe-commits
mailing list