Closed JAPNITSINGH closed 4 months ago
Thanks @JAPNITSINGH for raising this. @owenrumney I'm assigning this to you as you are the person who most recently worked on the windows specifics for the extension.
Thanks for this @JAPNITSINGH - I've run it on Windows/Linux and MacOS and it's all good. 👍
This is a minor fix, could be critical in certain scenarios.
BUG: I had created a project in D drvie of my PC with just one file (main.tf) with a minimalistic code as shown below. When I launch VS code for the first time, I see the correct costs being displayed. However when I make changes to main.tf and save the file, I do not see the changes in the cost.
STEPS TO REPRODUCE:
D:\Github_Projs\Dummy\01-hello-world-Terraform
)main.tf
and modify theinstance_type
( change it to t2.micro for example)VIDEO OF THE BUG:
https://github.com/user-attachments/assets/6e12134e-02ec-4c55-a758-05de153a025d
DEBUG LOGS: debug_logs.txt
CAUSE OF THE PROBLEM: The cause of the problem seems to be in
workspace.ts
in the methodasync fileChange()
when comparingprojectDir
anddir
(look at the valies on the left hand side)This is happening because the
cleanFilename()
method inutils.ts
isn't cleaning the path with all the drives( just the C drive)In short, if I have a terraform project placed in any drive apart from the C drive, the extension might not work as expectd. (Possible work-around would be to make changes to the file and re-open VS code)
FIX: I have fixed this issue in this PR, ensuring that all windows drive paths are replaced correctly by modifying the
cleanFilename()
VIDEO OF THE FIX:
https://github.com/user-attachments/assets/b50a7623-1026-41cd-bd04-f5741d92693d
Here is a ZIP file of the dummy project that I am using in case this is needed for reproducing the issue: 01-hello-world-Terraform.zip