microsoft / microsoft/vscode-cpptools

includepath with network folders

Open
#3,402 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service network drive
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

I have a C++ workspace with following folder hierarchy

myWorkspace/
myWorkspace/component1/ImportedInterfaces/*.h --> need to exclude this folder
myWorkspace/component1/publicinterfaces/*.h
myWorkspace/component1/module1/localinterfaces/*.h
myWorkspace/component1/module1/src/*.cpp
myWorkspace/component2/ImportedInterfaces/*.h --> need to exclude this folder
myWorkspace/component2/publicinterfaces/*.h
myWorkspace/component2/module1/localinterfaces/*.h
myWorkspace/component2/module1/src/*.cpp

myWorkspace also depends on two other workspace folders on the network with similar hierarchy:

\\machine1\home\users\myDependentWorkspace1
\\machine2\home\users\myDependentWorkspace2

below is my c_cpp_properties.json file:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "//machine1//home/users/myDependentWorkspace1/**",
                "//machine2//home/users/myDependentWorkspace1/**",
                ],
            "windowsSdkVersion": "10.0.14393.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "intelliSenseMode": "msvc-x64",
            "browse": {
                "path": [
                    "${workspaceFolder}/**",
                "//machine1//home/users/myDependentWorkspace1/**",
                "//machine2//home/users/myDependentWorkspace1/**",
                ],
            }
        }
    ],
    "version": 4
}

=============================
for folder exclusion i have the following in my settings.json file:

"C_Cpp.intelliSenseEngineFallback": "Enabled",
    "C_Cpp.loggingLevel": "Debug",
    "C_Cpp.exclusionPolicy": "checkFolders",
    "files.exclude": {
       "**/ImportedInterfaces": true
    }

========================================
I see the following message in Log(Extension Host):

[2019-04-03 16:05:17.018] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2019-04-03 16:05:17.018] [exthost] [error] Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:111:329
	at new d (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:111:464)
	at new f (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:112:671)
	at Function.parse (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:112:11)
	at nullConverter (C:\Users\rip\.vscode\extensions\ms-vscode.cpptools-0.22.1\node_modules\vscode-languageclient\lib\protocolConverter.js:22:47)
	at asLocation (C:\Users\rip\.vscode\extensions\ms-vscode.cpptools-0.22.1\node_modules\vscode-languageclient\lib\protocolConverter.js:300:34)
	at item.map (C:\Users\rip\.vscode\extensions\ms-vscode.cpptools-0.22.1\node_modules\vscode-languageclient\lib\protocolConverter.js:290:43)
	at Array.map (<anonymous>)
	at asDefinitionResult (C:\Users\rip\.vscode\extensions\ms-vscode.cpptools-0.22.1\node_modules\vscode-languageclient\lib\protocolConverter.js:290:25)

Workaround is to copy all these folders to a local folder(e:\folder or d:\folder). Include paths to local drive folders work fine. Is network drive folders supported in VSCode. If so, how do we point to it via includepath ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the includePath and browse entries in c_cpp_properties.json and the exclusion settings in settings.json, then reproduce the Extension Host URI error using the network-folder paths shown. Check whether supported UNC paths can be resolved without the reported error; done means network includes work without the provider failure and the requested folder exclusion remains effective.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.