Bug 1323308 - Add include paths for vscode. r?gps draft
authorRalph Giles <giles@mozilla.com>
Tue, 13 Dec 2016 13:48:11 -0800
changeset 449669 524d28b2319cb96f6f7ef48141a86a4532dbe68a
parent 449668 d1d790d6e0f83957741588fa8ee8e2601c9ae2e0
child 539535 325639abd27d3572b3feba292896c78fdb5aa0fa
push id38617
push userbmo:giles@thaumas.net
push dateWed, 14 Dec 2016 18:01:07 +0000
reviewersgps
bugs1323308
milestone53.0a1
Bug 1323308 - Add include paths for vscode. r?gps Add a C/C++ properties config file for Microsoft Visual Studio Code. This adds a clang-format config and some common include paths so symbol lookup works a little bit. For generated headers, it gives the default object directory paths, but this will likely be incorrect for many people. Especially as vscode is messy about in-tree generated code already, so an external object directory is a common config. Unfortunately without some way to set this programmatically like we do with .ycm_extra_conf.py or generating this at build time, I don't see a way to make this work in general without local modifications. Nevertheless I think it's worth experiementing with an initial static config to get some feedback. Based on a file by Dan Glastonbury. MozReview-Commit-ID: IO8hVZDofkL
.vscode/c_cpp_properties.json
new file mode 100644
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,50 @@
+{
+    "configurations": [
+        {
+            "name": "Mac",
+            "includePath": [
+                "/usr/include",
+                "${workspaceRoot}/config",
+                "${workspaceRoot}/ipc/glue",
+                "${workspaceRoot}/ipc/chromium/src",
+                "${workspaceRoot}/obj-x86_64-apple-darwin/dist/include"
+            ],
+            "browse" : {
+                "limitSymbolsToIncludedHeaders" : true,
+                "databaseFilename" : ""
+            }
+        },
+        {
+            "name": "Linux",
+            "includePath": [
+                "/usr/include",
+                "${workspaceRoot}/config",
+                "${workspaceRoot}/ipc/glue",
+                "${workspaceRoot}/ipc/chromium/src",
+                "${workspaceRoot}/obj-x86_64-pc-linux-gnu/dist/include"
+            ],
+            "browse" : {
+                "limitSymbolsToIncludedHeaders" : true,
+                "databaseFilename" : ""
+            }
+        },
+        {
+            "name": "Win32",
+            "includePath": ["c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
+                "${workspaceRoot}/config",
+                "${workspaceRoot}/ipc/glue",
+                "${workspaceRoot}/ipc/chromium/src",
+                "${workspaceRoot}/obj-x86_64-pc-windows-msvc/dist/include"
+            ],
+            "browse" : {
+                "limitSymbolsToIncludedHeaders" : true,
+                "databaseFilename" : ""
+            }
+        }
+    ],
+    "clang_format" : {
+        "style" : "file",
+        "fallback-style" : "Mozilla",
+        "sort-includes" : true
+    }
+}