Skip to content

Commit

Permalink
[clangd] Detect C++ language based on well-known file path in vscode …
Browse files Browse the repository at this point in the history
…extension

Summary:
Matching the "C++" pattern on the first line of the file doesn't cover
all cases, MSVC C++ headers doesn't have such pattern. This patch
introduce a new heuristic to detect language based on the file path.

MSVC C++ standard headers are in the directory like
"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include"

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63483

llvm-svn: 363662
  • Loading branch information
hokein committed Jun 18, 2019
1 parent 7e854e1 commit 40fdd7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clang-tools-extra/clangd/clients/clangd-vscode/package.json
Expand Up @@ -52,6 +52,10 @@
"contributes": {
"languages": [{
"id": "cpp",
"filenamePatterns": [
"**/include/c++/**",
"**/MSVC/*/include/**"
],
"firstLine": "^\/[/*].*-\\*-\\s*C\\+\\+\\s*-\\*-.*"
}],
"configuration": {
Expand Down

0 comments on commit 40fdd7a

Please sign in to comment.