Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ${workspaceFolder} variable #1392

Closed
azydevelopment opened this issue Dec 31, 2017 · 8 comments
Closed

Add support for ${workspaceFolder} variable #1392

azydevelopment opened this issue Dec 31, 2017 · 8 comments
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@azydevelopment
Copy link

  • VSCode Version: Code 1.19.1 (0759f77bb8d86658bc935a10a64f6182c5a1eeba, 2017-12-19T09:46:23.884Z)
  • OS Version: Windows_NT x64 10.0.16299
  • Extensions:
Extension Author (truncated) Version
githistory don 0.2.3
cpptools ms- 0.14.5
csharp ms- 1.13.1
PowerShell ms- 1.5.1

Repro project: test.zip

Steps to Reproduce:

  1. Unzip attached repro test project zip
  2. Open test\0 folder with VSCode
  3. Try to ctrl+click the #include <1.h> file
  4. Notice that it doesn't despite in the cpp properties json file there exists "${workspaceFolder}/../1" in the include path. Since test/0 and test/1 folders are peers, I'd imagine if I go up a directory then down into the test/1 directory, the 1.h file should be resolved.

Reproduces without extensions: Yes/No

@sean-mcmanus
Copy link
Contributor

We don't support the variable ${workspaceFolder} only ${workspaceRoot}, but we should probably add that so users don't get confused. Does it work after changing that? I'm pretty sure the ".." should work, but I can double check.

@sean-mcmanus sean-mcmanus added Language Service more info needed The issue report is not actionable in its current state labels Jan 2, 2018
@azydevelopment
Copy link
Author

Trying right now. One minute.

@azydevelopment
Copy link
Author

azydevelopment commented Jan 2, 2018

Okay yes it does (but you might want to make sure I'm not doing something dumb still that makes it seem like it's working but isn't really :P). Thanks. It'll be nice if it matches the new recommendations from the multi-root feature additions.

Secondarily, regarding the multi-root feature additions; it would be nice to have an environment variable that refers to the multi-root workspace root. Meaning, I can add two folders from anywhere into my workspace but the environment variable can be used to make those folders look like they're peers removing the need for messy absolute or relative paths.

PS. I'll leave this open if you want to use this item to track the addition of the workspaceFolder variable and/or the above feature request.

@sean-mcmanus sean-mcmanus added Feature Request and removed more info needed The issue report is not actionable in its current state labels Jan 2, 2018
@sean-mcmanus
Copy link
Contributor

Okay, I think I understand what you're describing, something like "${realWorkspaceRoot}/folder1", "${realWorkspaceRoot}/folder2". I wonder if VS Code itself plans to add that variable for tasks.json.

@azydevelopment
Copy link
Author

I certainly hope so :). I'd use it for include paths most of all.

@bobbrow bobbrow added this to the February 2018 milestone Jan 2, 2018
@bobbrow bobbrow removed this from the March 2018 milestone Feb 27, 2018
@bobbrow bobbrow added this to the March 2018 milestone Mar 1, 2018
@bobbrow bobbrow changed the title Include path with double dot relative path to ${workspaceFolder} not resolving Add support for ${workspaceFolder} variable Mar 1, 2018
@bobbrow bobbrow added the fixed Check the Milestone for the release in which the fix is or will be available. label Mar 7, 2018
@Zooce
Copy link

Zooce commented Mar 13, 2018

Quick question on this one, do I need to replace ${workspaceRoot} with ${workspaceFolder} now, or are both supported?

@sean-mcmanus
Copy link
Contributor

@Zooce Both are supported and should behave identically.

@sean-mcmanus
Copy link
Contributor

${workspaceFolder} was added with 0.16.1, but we're still tracking ${workspaceFolder:folderName} with #1774 .

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

4 participants