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

Resolve userHome variable in c_cpp_properties.json #12071

Merged
merged 9 commits into from
Mar 7, 2024

Conversation

browntarik
Copy link
Contributor

@browntarik browntarik commented Mar 6, 2024

Addresses: #11756

@Colengms
Copy link
Collaborator

Colengms commented Mar 6, 2024

Are there other variables we should add support for while we're in there? Of the ones on https://code.visualstudio.com/docs/editor/variables-reference, the following also seem supportable in this context:

${workspaceFolderBasename} - the name of the folder opened in VS Code without any slashes (/)
${execPath} - the path to the running VS Code executable
${pathSeparator} - the character used by the operating system to separate components in file paths
${/} - shorthand for ${pathSeparator}

@bobbrow
Copy link
Member

bobbrow commented Mar 6, 2024

Are there other variables we should add support for while we're in there? Of the ones on https://code.visualstudio.com/docs/editor/variables-reference, the following also seem supportable in this context:

${workspaceFolderBasename} - the name of the folder opened in VS Code without any slashes (/) ${execPath} - the path to the running VS Code executable ${pathSeparator} - the character used by the operating system to separate components in file paths ${/} - shorthand for ${pathSeparator}

We actually have support for the few of these already. I don't think the proposed change is the "best" approach. Please see:

private get ExtendedEnvironment()

in configurations.ts (around line 421). This is where we dealt with vs code's variables (except for workspaceFolder which is special).

@sean-mcmanus
Copy link
Collaborator

Are there other variables we should add support for while we're in there? Of the ones on https://code.visualstudio.com/docs/editor/variables-reference, the following also seem supportable in this context:

${workspaceFolderBasename} - the name of the folder opened in VS Code without any slashes (/) ${execPath} - the path to the running VS Code executable ${pathSeparator} - the character used by the operating system to separate components in file paths ${/} - shorthand for ${pathSeparator}

I think that's beyond the scope of this particular change? i.e. I would think those could/should be fixed separately unless it's trivial?

@bobbrow
Copy link
Member

bobbrow commented Mar 6, 2024

Are there other variables we should add support for while we're in there? Of the ones on https://code.visualstudio.com/docs/editor/variables-reference, the following also seem supportable in this context:
${workspaceFolderBasename} - the name of the folder opened in VS Code without any slashes (/) ${execPath} - the path to the running VS Code executable ${pathSeparator} - the character used by the operating system to separate components in file paths ${/} - shorthand for ${pathSeparator}

I think that's beyond the scope of this particular change? i.e. I would think those could/should be fixed separately unless it's trivial?

They are all implemented already with the exception of ${/}. It's trivial to add support for variables, so it can be done now if we want.

Extension/src/common.ts Outdated Show resolved Hide resolved
@browntarik browntarik merged commit 699b3d5 into main Mar 7, 2024
4 checks passed
@browntarik browntarik deleted the browntarik/addUserHome branch March 7, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants