VHDL-LS / rust_hdl

Other
337 stars 65 forks source link

[BUG] File paths with $ are incorrectly being interpreted as environment variables #278

Closed Matt-D-Smith closed 6 months ago

Matt-D-Smith commented 7 months ago

If a file path has a '$' character in it, the parser for vhdl_ls.toml interprets it as an environment variable when it should not. $ characters are valid in windows file path names, and used in network/shared file paths to indicate hidden folders.

Example entry in vhdl_ls.toml

unisim.files = [ 
   '\\networklocation\cad$\apps\xilinx_vitis\Vivado_2020.2\Vivado\2020.2\data\vhdl\src\unisims\unisim_VCOMP.vhd',
]

Resulting error in VHDL LS output:

Error loading vhdl_ls.toml: environment variable '' is not defined
Schottkyc137 commented 6 months ago

This is fixed with the latest commit by disabling the substitution feature for windows machines. However the current solution is unsatisfactory as windows users would likely also want to have this feature, probably using the %VAR_NAME% syntax instead of the $VAR_NAME syntax. I have opened an issue on the subst package addressing this.

Xcodo commented 6 months ago

Yes I'm quite disappointed by that change - the variable substitution feature was fantastic for us and we're on Windows.

Perhaps an alternative would be to have a setting to enable or disable the substitution?