TerosTechnology / vscode-terosHDL

VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
https://terostechnology.github.io/terosHDLdoc/
524 stars 42 forks source link

Project file fix when running on windows caused by double back slash.… #594

Closed gmartina closed 3 months ago

gmartina commented 3 months ago

… When double back slash is saved into a file the first one is working as a scape char resulting in one back slash in the relative path unabling to load the project again. This is solved by replacing double back slash with forward slash. Example of yaml project file saved in Windows: Before:

files: 
  - name: "src\example1.vhd"

After:

files: 
  - name: "src/example1.vhd"
qarlosalberto commented 3 months ago

thanks for that!

grunora commented 1 month ago

Using the 6.0.1 build as of May 28th still saves single backward slahes in project files. Either the fix is not active in this build or it is not sufficient to replace double backslashes with a forward slash?!

Is there anything I can do to support solving this issue?

qarlosalberto commented 1 month ago

@gmartina should we use new_files[i].name = new_files[i].name.replace(/\\/g, '/'); instead of new_files[i].name = new_files[i].name.replace("\\", '/'); ?

@grunora can you put your project example that it's failing?

grunora commented 1 month ago

I have attached four project files:

  1. Project_backslash.yml: file saved with v6.0.1 -> doesn't work
  2. Project_file_fowardslash.yml: manually replaced backward slashes by forward slashes just for the project file -> doesn't work
  3. Project_all_forwardslash.yml: manually replaced all backward slashes with forward slashes -> works
  4. Project_saved_6_0_1.yml: Successfully loaded project Project_all_forwardslash.yml just saved again with v6.0.1 -> doesn't work Projectfiles.zip
gmartina commented 1 month ago

@gmartina should we use new_files[i].name = new_files[i].name.replace(/\\/g, '/'); instead of new_files[i].name = new_files[i].name.replace("\\", '/'); ?

@grunora can you put your project example that it's failing?

Yes, thanks. I already did a new PR and tested it with the files @grunora provided.