Use biome_line_index to avoid biome_lsp_converters#354
Merged
DavisVaughan merged 1 commit intomainfrom Jun 10, 2025
Merged
Conversation
DavisVaughan
commented
Jun 4, 2025
Collaborator
Author
There was a problem hiding this comment.
Ignore, this is Biome code
Collaborator
Author
There was a problem hiding this comment.
Ignore, this is Biome code
Avoiding the tower-lsp dependency entirely in favor of "just" the `LineIndex`. We handle our own converter utilities, which are very easy to write on top of the LSP agnostic `LineIndex`.
c5649b3 to
1ec29b9
Compare
Collaborator
Author
|
I'm hopeful this one is not worrisome in any way (since we agreed it's a good idea in general) so I'm going to merge so I can do some additional follow up / refactoring |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #353 in favor of this simpler approach (though there are a few things from that PR ill add in later on in another PR)
This is a minimal PR that gets rid of our dependency on
biome_lsp_convertersin favor of the lighter weightbiome_line_index. We usebiome_lsp_convertersfor two things:LineIndextype, which is extremely useful for conversion between byte offset and line/column positionfrom_proto::offset()from_proto::text_range()to_proto::position()to_proto::range()The painful thing about
biome_lsp_convertersis that it locks us in totower_lsp, therefore also locking us totokio, due to the fact that their LSP specific conversion utilities usetower_lsp::lsp_types::*.I'm planning on sending a PR to biome (biomejs/biome#6222) to request that they split out the LSP agnostic
LineIndextype into abiome_line_indexcrate which I've gone ahead and copy/pasted in here. That allows us to use their fantasticLineIndeximplementation, but critically we now don't rely on tower-lsp through them in any way. I'm hopeful they accept that PR, at which point we can drop our shim in favor of their real thing (we will also need to sync with biomemainto do that though, which may be painful)This will allow us to switch over to lsp-server without any issues. Previously, we were blocked from doing this due to our deep reliance on tower-lsp through biome-lsp-converters.