Describe the bug
I ran into an issue where if I run LSP: Rename once on a property it detects 10 occurrences across 8 files. I then run LSP: Rename again on the same (just renamed) property and it only detects 2 occurrences across 2 files.
I'm in a monorepo project structured like so:
// rootFolder is set up as sublime project root
rootFolder/package1/src // source files
rootFolder/package1/dist // locally compiled package
rootFolder/package2/src // depends on package1
rootFolder/package2/dist
rootFolder/package3/src // depends on package1 and 2
rootFolder/package3/dist
// etc
The second run of LSP: Rename seems to only find occurrences within the package path that the property to be renamed originates from, e.g. package1.
I understand that the monorepo structure with adjacent packages consuming the locally built /dist folders requires restarts of the LSP server after re-building the project. WebStorm handles this without issues when performing refactor/renaming, but I'm trying to migrate to Sublime.
For a couple of rounds it consistently worked, by making sure that I:
- do LSP: Rename (detect 10 occurrences across 8 files)
- rebuild project to make new type definitions available to adjacent packages
- restart LSP TypeScript server to pick up file changes
- do LSP: Rename again to "revert" the changes (detect 10/8)
- rebuild project
- restart LSP TypeScript server
- ...
After a couple of runs it starts detecting only 2 occurrences, and I can't get it to detect all 10/8 by rebuilding project, restarting LSP server, or restarting Sublime.
If I open a project file that references the property I'm trying to edit, then go back to edit the type definition via LSP: Rename, it will now detect 3 occurrences across 3 files. If I keep opening the files I know reference the property LSP: Rename will eventually detect all of them again. If I trigger LSP: Rename in a different file referencing the same property, it will sometimes go back to detecting all occurrences, and sometimes detect its own subset of occurrences within its package.
To Reproduce
Steps to reproduce the behaviour:
- Open a TypeScript monorepo as a project in Sublime
- Build and install dependencies
- Perform a LSP: Rename on a property that is used across multiple package folders
- See it correctly find all references
- Save All
- Re-build the project
- Restart LSP-Typescript server
- Perform a LSP: Rename on the same property (that now has a new name)
- ... repeat steps 3 through 9 some number of times
- See LSP: Rename fail to correctly find all references
Expected behavior
LSP: Rename should find all references to a property every time it is run.
Screenshots
n/a
Environment (please complete the following information):
- OS: Arch Linux
- Sublime Text version: 4143
- LSP version: 1.21.0
- Language servers used: LSP-Typescript, LSP-Eslint
Additional context
n/a
Describe the bug
I ran into an issue where if I run
LSP: Renameonce on a property it detects 10 occurrences across 8 files. I then runLSP: Renameagain on the same (just renamed) property and it only detects 2 occurrences across 2 files.I'm in a monorepo project structured like so:
The second run of
LSP: Renameseems to only find occurrences within the package path that the property to be renamed originates from, e.g. package1.I understand that the monorepo structure with adjacent packages consuming the locally built
/distfolders requires restarts of the LSP server after re-building the project. WebStorm handles this without issues when performing refactor/renaming, but I'm trying to migrate to Sublime.For a couple of rounds it consistently worked, by making sure that I:
After a couple of runs it starts detecting only 2 occurrences, and I can't get it to detect all 10/8 by rebuilding project, restarting LSP server, or restarting Sublime.
If I open a project file that references the property I'm trying to edit, then go back to edit the type definition via LSP: Rename, it will now detect 3 occurrences across 3 files. If I keep opening the files I know reference the property LSP: Rename will eventually detect all of them again. If I trigger LSP: Rename in a different file referencing the same property, it will sometimes go back to detecting all occurrences, and sometimes detect its own subset of occurrences within its package.
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
LSP: Rename should find all references to a property every time it is run.
Screenshots
n/a
Environment (please complete the following information):
Additional context
n/a