Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
BUG.mp4
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:
FIX.mp4
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