-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
When using lsp-biome alongside ts-ls while editing a js file the lsp-format-buffer
applies the same changes twice which in some cases does unexpected things.
When executing either of the servers on their own everything works ok.
Steps to reproduce
- Create a js file with the following content (there are two spaces between const and one):
const··one·=·1;
- Make sure both servers are started: ts-ls and biome
- Execute
lsp-format-buffer
- The buffer will be formatted like this:
const·ne·=·1
Expected behavior
The buffer should have been formatted removing only one of the 2 spaces:
const·one·=·1
What seems to be happening is that the change that would fix the issue is getting executed twice. In the above example we have one extra space that would be fixed by removing one character but two get removed
- So in this case (1 extra space):
const··one·=·1
- 2 characters (in brackets) get deleted:
const·[·o]ne·=·1
- 2 characters (in brackets) get deleted:
- With 2 extra spaces:
const···one·=·1
- 4 characters (in brackets) get deleted:
const·[··on]e·=·1
- 4 characters (in brackets) get deleted:
Possible root of the problem
It seems that the biome client is registered with the property :add-on t
. I tried changing this value to nil and it fixed my problem.
Metadata
Metadata
Assignees
Labels
No labels