[PATCH] D63397: [clangd] Detect C++ for extension-less source files in vscode extension

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 17 00:58:22 PDT 2019


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

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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63397

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
@@ -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",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63397.204997.patch
Type: text/x-patch
Size: 644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190617/f07339d8/attachment.bin>


More information about the cfe-commits mailing list