diff options
author | Haojian Wu <hokein@google.com> | 2019-06-17 12:59:14 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2019-06-17 12:59:14 +0000 |
commit | d53027697ca246d882eae228b554fbdb209cf7ff (patch) | |
tree | 1803056a8e316c10208a93992a38cb16c279fb5f | |
parent | e40f879eb2cbe0571e0ddaaf17c30792326f9f68 (diff) | |
download | bcm5719-llvm-d53027697ca246d882eae228b554fbdb209cf7ff.tar.gz bcm5719-llvm-d53027697ca246d882eae228b554fbdb209cf7ff.zip |
[clangd] Detect C++ for extension-less source files in vscode extension
Summary:
Extend our extension to support detecting these files as C++ files based on the first
line (`-*- C++ -*-`), it will make clangd work on C++ standard headers
(e.g. iostream).
We use the contributes.languages[1] to enrich the builtin VScode C++
support.
[1]: https://code.visualstudio.com/api/references/contribution-points#contributes.languages
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63397
llvm-svn: 363554
-rw-r--r-- | clang-tools-extra/clangd/clients/clangd-vscode/package.json | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/clients/clangd-vscode/package.json b/clang-tools-extra/clangd/clients/clangd-vscode/package.json index 072bfa79ffe..9d9699db013 100644 --- a/clang-tools-extra/clangd/clients/clangd-vscode/package.json +++ b/clang-tools-extra/clangd/clients/clangd-vscode/package.json @@ -50,6 +50,10 @@ "url": "http://llvm.org/svn/llvm-project/clang-tools-extra/trunk/clangd/clients/clangd-vscode/" }, "contributes": { + "languages": [{ + "id": "cpp", + "firstLine": "^\/[/*].*-\\*-\\s*C\\+\\+\\s*-\\*-.*" + }], "configuration": { "type": "object", "title": "clangd configuration", |