elixir-ls icon indicating copy to clipboard operation
elixir-ls copied to clipboard

LSP range start and end always point to same character

Open Ansraer opened this issue 6 months ago • 2 comments

Hey there!

I am posting here after digging into a problem with the elixir extension for the zed editor:

Image

As you can see above, the editor only underlines the first character of any error/warning.

Using the LSP logs panel I finally discovered that the problem appears to be in the lsp. All the rpc messages always have identical start and ends, which means that the editor only ever highlights the first character:

"range":{"end":{"character":8,"line":104},"start":{"character":8,"line":104}},
"relatedInformation":[],
"severity":2,
"source":"ElixirLS Dialyzer"

I am wondering, is this intended behavior? I have never really dug into the intricacies of how LSPs work, but this feels wrong. Should this be intended behavior, could someone please explain to me why (I am curious) and how editor extensions are supposed to work around this limitation to still highlight things properly?

Ansraer avatar Oct 13 '25 23:10 Ansraer

Dialyzer is not emitting ranges but simple lines or lines and columns. In some cases ElixirLS is able to match a symbol or a line but evidently it is not working in this case. Can you share a sample repo that reproduces this problem?

lukaszsamson avatar Oct 23 '25 20:10 lukaszsamson

Not really, sorry. This is in a proprietary codebase.

It does however happen for every file of that particular codebase across all our dev amchines (running linux/macos)

Ansraer avatar Nov 29 '25 17:11 Ansraer