[clang-tools-extra] r363662 - [clangd] Detect C++ language based on well-known file path in vscode extension

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 04:53:14 PDT 2019


Author: hokein
Date: Tue Jun 18 04:53:14 2019
New Revision: 363662

URL: http://llvm.org/viewvc/llvm-project?rev=363662&view=rev
Log:
[clangd] Detect C++ language based on well-known file path in vscode 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

Modified:
    clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json

Modified: clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json?rev=363662&r1=363661&r2=363662&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json (original)
+++ clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json Tue Jun 18 04:53:14 2019
@@ -52,6 +52,10 @@
     "contributes": {
         "languages": [{
             "id": "cpp",
+            "filenamePatterns": [
+                "**/include/c++/**",
+                "**/MSVC/*/include/**"
+            ],
             "firstLine": "^\/[/*].*-\\*-\\s*C\\+\\+\\s*-\\*-.*"
         }],
         "configuration": {




More information about the cfe-commits mailing list