hokein created this revision.
hokein added a reviewer: sammccall.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

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"


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63483

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


Index: clang-tools-extra/clangd/clients/clangd-vscode/package.json
===================================================================
--- clang-tools-extra/clangd/clients/clangd-vscode/package.json
+++ clang-tools-extra/clangd/clients/clangd-vscode/package.json
@@ -52,6 +52,10 @@
     "contributes": {
         "languages": [{
             "id": "cpp",
+            "filenamePatterns": [
+                "**/include/c++/**",
+                "**/MSVC/*/include/**"
+            ],
             "firstLine": "^\/[/*].*-\\*-\\s*C\\+\\+\\s*-\\*-.*"
         }],
         "configuration": {


Index: clang-tools-extra/clangd/clients/clangd-vscode/package.json
===================================================================
--- clang-tools-extra/clangd/clients/clangd-vscode/package.json
+++ clang-tools-extra/clangd/clients/clangd-vscode/package.json
@@ -52,6 +52,10 @@
     "contributes": {
         "languages": [{
             "id": "cpp",
+            "filenamePatterns": [
+                "**/include/c++/**",
+                "**/MSVC/*/include/**"
+            ],
             "firstLine": "^\/[/*].*-\\*-\\s*C\\+\\+\\s*-\\*-.*"
         }],
         "configuration": {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D63483: [clangd] Detect... Haojian Wu via Phabricator via cfe-commits

Reply via email to