zerasul / genesis-code

Visual Studio Code Genesis Development Extension
https://marketplace.visualstudio.com/items?itemName=zerasul.genesis-code
MIT License
42 stars 9 forks source link

Environment variables not expanded on Linux settings.json #913

Open ProtossGP32 opened 1 year ago

ProtossGP32 commented 1 year ago

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).

zerasul commented 1 year ago

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.

ProtossGP32 commented 1 year ago

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?