next-ls
next-ls copied to clipboard
Cleanup same file occurrences when inserting a symbol
This pull request ensures that when inserting a symbol we clean up the existing symbols for the same file.
Previously we were just removing the existing symbols for the same module, which worked if we update a module or rename its file. This left one corner case uncovered: renaming the module while keeping the filename.
This pull request fixes this and should fix #305. To test this you can perform the steps that I wrote in there and confirm that after renaming the module, the old module information is not present anymore in the symbols
table.
Marking as a draft as the tests are failing and I won't have time to fix it today.
I am completely lost regarding the tests. I've cleaned everything and switched to main
and they still fail on my machine. Not sure what I did 🙈
@crbelaus i'll take a look tonight, no worries! Thanks for the hard work 💪