Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does vscode use workspaceRoot or workspaceFolder?

I have been recently trying to use the MinGW gcc compiler with Code, and am getting some issues with Intellisense(not breaking, but I find it annoying).

I followed the documentation to edit the path for the c_cpp_properties.json file, but the error continues to pop up and I think I have also found contradictory information.

   {
        "name": "Win32",
        "includePath": [
            "${workspaceRoot}"
        ],
        "defines": [
            "_DEBUG",
            "UNICODE"
        ],
        "intelliSenseMode": "msvc-x64",
        "browse": {
            "path": [
                "${workspaceRoot}",
                "C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include\\c++"
            ],
            "limitSymbolsToIncludedHeaders": true,
            "databaseFilename": ""
        }
    }
],
"version": 3

I looked on the github repo for the documentation and found someone had committed a change where ${workspaceRoot} was changed to workspaceFolder in the documentation. However, root seems to be the default for VS code, and I only updated to the new orange logo version this morning.

https://github.com/Microsoft/vscode-docs/commit/fa613d436a53bd9c5a21065cf5fa0f1b350d9bc6

So which is the correct way to get Intellisense working, Folder or Root?

like image 720
accessibilitylearner Avatar asked Oct 17 '17 18:10

accessibilitylearner


People also ask

What debugger does VS Code use?

Node.js - Describes the Node.js debugger, which is included in VS Code. TypeScript - The Node.js debugger also supports TypeScript debugging.

What port does VS Code use?

Installation of VS Code Server requires that your local machine have outbound HTTPS (port 443) connectivity to: update.code.visualstudio.com.

What code does VS Code use?

Using Electron, VS Code combines web technologies such as JavaScript and Node. js with the speed and flexibility of native apps. VS Code uses a newer, faster version of the same industrial-strength HTML-based editor that has powered the "Monaco" cloud editor, Internet Explorer's F12 Tools, and other projects.


1 Answers

Turning @Marks comment into an answer: ${workspaceRoot} is deprecated, ${workspaceFolder} should be used instead: https://code.visualstudio.com/docs/editor/multi-root-workspaces

See also this description of variables: https://code.visualstudio.com/docs/editor/variables-reference

${workspaceFolder} - the path of the folder opened in VS Code

like image 69
Flamefire Avatar answered Oct 09 '22 02:10

Flamefire