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
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
+ }
+}