genesis-code icon indicating copy to clipboard operation
genesis-code copied to clipboard

Environment variables not expanded on Linux settings.json

Open ProtossGP32 opened this issue 2 years ago • 2 comments

VSCODE version: 1.79.2 ISSUE: When creating a project from zero, Genesis code configures the settings.json like this:

{ 
    "C_Cpp.default.includePath": ["${env:GENDEV}/sgdk/inc",
    "${env:GENDEV}/sgdk/res",
    "res",
    "inc"
]
}

But the ${env:GENDEV} is empty, even though I've exported it in my .bashrc file. This prevents to include the SGDK resources paths: image

I've also tried to overwrite the variables in the Genesis Code settings but the results are the same. The current workaround is to replace the ${env:GENDEV} variable in the settings.json with the current SGDK path (variable ${env:HOME} is expanded correctly, for example).

ProtossGP32 avatar Jul 09 '23 09:07 ProtossGP32

Hi Marc:

It seems there are some problem using GENDEV en variable. Are you using Gendev project? or are you using a docker image?

The env variable GENDEV need to be configured on your bash as a enviroment variable to use it to configure include paths.

The GENDEV configuration variable is only used for compilation pruposes, Try to put your absolute path on the settings.json file.

Remember: if you are using marsdev change the toolchain type configuration selector.

zerasul avatar Jul 09 '23 09:07 zerasul

Hi zerasul: I'm using the Doragasu image to compile the project, but I understand that the resolution of the paths simply relies on the C__Cpp.default.includePath array defined in the settings.json.

As I said in the first message, It's Genesis Code who configures these paths by using the ${env:GENDEV} variable, and the issue of not finding the SGDK resources is resolved when replacing it with either the absolute path or using other environment variables provided by VSCODE, but none of the ones defined in the Genesis Code Settings.

So the thing is, if ${env:GENDEV} can't be used in settings.json, why does a Genesis Code: create project command use it to compose the includePath paths of the SGDK? Shouldn't it be replaced with something else?

ProtossGP32 avatar Jul 09 '23 09:07 ProtossGP32