BlueGlassBlock / better-json5

JSON5 support for Visual Studio Code, done right
https://marketplace.visualstudio.com/items?itemName=BlueGlassBlock.better-json5
Other
4 stars 1 forks source link

Feature request: support env vars in schema uri #4

Open giacomorebonato opened 5 days ago

giacomorebonato commented 5 days ago

Is there any way to support env vars in the URL? Given that it has to be an absolute path, that would give more flexibility.

  "json5.schemas": [
    {
      "fileMatch": [
        "test.json5"
      ],
      "url": "${env:HOME}/my-schema.json"
    },
 ]
giacomorebonato commented 5 days ago

It would be nice to leverage the same syntax mentioned in this StackOverflow comment

{
    "java.home": "${env:HOME}/.sdkman/candidates/java/8.0.222.hs-adpt/"
}

or

{
    "url": "${workspaceFolder}/schema.json"
}
giacomorebonato commented 5 days ago

POC: https://github.com/BlueGlassBlock/better-json5/pull/5

BlueGlassBlock commented 1 day ago

Thanks for addressing this!

However, I might not accept #5 as-is since I think it's better to fully implement the sensible syntaxes in VSCode Variable Reference and do proper browser support for vscode.dev before rolling this out, but I'll definitely look into this.

giacomorebonato commented 17 hours ago

Fair point. Thanks!