Closed florianb closed 1 year ago
That's most likely race conditions between publishing diagnostics and source file changes. This line assumes the source file has the line with error https://github.com/elixir-lsp/elixir-ls/blob/42f16b83708bd2068f8c54b3631b53edc99d7525/apps/language_server/lib/language_server/diagnostics.ex#L322
Shouldn't the file already being read at this point, how can this differ?
Async parsing and async text document synchronisation. When the diagnostic is being published the line is not there anymore and we need the line to convert UTF8 code points to UTF16. I know what needs fixing here :)
Thank you very much for your work! 🙏
Environment
Current behavior
The LS seems to crash when adding/removing the last
end
in this module:Change
to
It might be, that the appearance/disappearance of the last line/last "newline" plays a role here. I noticed my Editor currently seems to strip the last line and this happens a lot when quickly edditing in the last section of the file.
Log