tooltitude / support

Tooltitude Support
https://www.tooltitude.com
Other
21 stars 0 forks source link

Tooltitude generates invalid code when discarding an error #28

Closed bmarinov closed 9 months ago

bmarinov commented 9 months ago

When tooltitude rewrites a line in order to ignore an unhandled error, this results in invalid code being generated. The blank identifier cannot be declared, and the short var declaration operator := should not be used.

Tooltitude Version: v0.44.0

OS Version: MacOS 13.6.1

VS Code Version: v1.84.2

Go Version: 1.21.4

What did you try to do? Quick Fix => Ignore unhandled error in a test.

Is there anything interesting in the tooltitude output channel? (should be open if you are reporting error from within VS Code) None that I could find, only generic INFO messages.

Steps to reproduce

// example code:
os.Setenv("FOO_BAR_ENV", "seven")

// applying the fix results in this invalid snippet:
_ := Setenv("FOO_BAR_ENV", "seven")
// ^ no new variables on left side of :=

Expected:

_ = Setenv("FOO_BAR_ENV", "seven")
tooltitude-support commented 9 months ago

@bmarinov Thank you for your feedback. It's pretty easy to fix. We plan to fix it in 0.45.0 which will be out this Friday. Will keep this issue updated about our progress.

tooltitude-support commented 9 months ago

@bmarinov It's fixed now. Will keep this issue opened until 0.45.0 release is out.

tooltitude-support commented 9 months ago

v0.45.0 is out. Closing this issue.

⭐ Your Opinion Matters to Us! Leave us a review. ⭐