question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support variables when resolving values in settings

See original GitHub issue

Hi,

I was just reading the latest updates and it says one can install typescript@next globally and then set typescript.tsdk so VS Code can use the appropriate version/installation. In a team environment, I’d like to put that setting in our project, something like:

.vscode/settings.json:

{
    "typescript.tsdk": "%APPDATA%/npm/node_modules/typescript/lib"
}

The problem is restarting VS Code results in an error:

The path c:\Projects\Derp\%APPDATA%\npm\node_modules\typescript\lib doesn't point to a valid tsserver install. TypeScript language features will be disabled.

Now the setting needs to be per-person because I highly doubt my teammates have tsc installed in C:\Users\Olson\AppData\Roaming\npm\node_modules\typescript\lib 😉

Could we get environment variables evaluated on that and all other settings that involve paths?

I haven’t tested other paths, but I see these in the Default Settings:

  • git.path
  • markdown.styles
  • json.schemas
  • typescript.tsdk
  • php.validate.executablePath

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:626
  • Comments:164 (52 by maintainers)

github_iconTop GitHub Comments

66reactions
MiloDCcommented, Feb 7, 2022

Am I to understand that this issue has been open for six years, now? Still no way to use environment variables in settings.json?

48reactions
chaylinscommented, Dec 21, 2017

I’d like to +1 this issue as well. We pull our code base into different drive locations (R:, F:, C:\ etc) and so being able to use a variable such as ${folderPath} in our settings.json would be an immense help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variables reference - Visual Studio Code
Variables Reference. Visual Studio Code supports variable substitution in Debugging and Task configuration files as well as some select settings.
Read more >
Resolution of Variables - Ivanti
Variables are generally resolved when executing eScripts or, for example, during an internal program flow. The following rules apply: Every variable between ...
Read more >
User variables are not resolved correctly in Windows
Fixes an issue in which user variables are not resolved correctly in Windows 8.1, Windows Server 2012 R2, Windows 7 SP1, or Windows...
Read more >
User Variables and Environments
To use the value of a variable, configure a setting using a variable name instead of a data value. In the GSE, a...
Read more >
Using variables | Postman Learning Center
The same principle applies to any part of your request where data is repeated. Whatever value is stored in the variable will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found