Closed brennanjl closed 1 year ago
Ok. Thanks fro the report. Will take a look as soon as I have time.
Overall, it looks like we don't handle *_test packages correctly. It looks like we are considering them as a part of the larger package.
Yeah. Ran into essentially case 2 again, but this time when using it in another package:
@brennanjl I fixed it. The fix will be available the next Friday. It's a more risky kind of change, so we want to test it well before releasing to users.
Closing it, since it's fixed.
Tooltitude Version:
OS Version: v0.24.5
VS Code Version: 1.79.2
Go Version: 1.19
Code Repository (if open source): closed source
What did you try to do?: Tooltitude does not detect variable names in testdata properly. In a testdata folders, I have a basic set of functions that loads some data into global structs from a JSON file in an init function. I have noted it doing two things improperly:
In a package testdata_test, it falsely flags variables of shadowing declarations of other variables from the base package:
It does not recognize any fields from the value being imported from the tesdata to the testdata_test package. Shown is an example. In this example, I changed the variable name to not trigger the bug from case 1 (it does happen then as well):
It's worth noting that the code compiles and runs fine, it purely seems to be an issue with tooltitude. However, this is also quite an uncommon case, as testdata packages usually do not have / need tests written.
Is there anything interesting in the tooltitude output channel? (should be open if you are reporting error from within VS Code): no
Steps to reproduce
Case 1:
Case 2: