You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When triggering completion just after the ` character of a polymorphic variant's name, the LSP returns completion items where the start and end positions are identical and equal to the position after the `. This causes the client to interpret the completion item as simply inserting text instead of also replacing the already typed ` character upon resolving the completion.
Example
Consider the following code:
typet = [ `T1 | `T2 ]
letx : t = `
Triggering autocomplete after the backtick character (at character 13) results in the wrong behaviour with the LSP returning completion items with ranges where start = end = 13. I would expect the returned items to have a start = 12 and end = 13 so that the completion client can correctly replace the ` character when resolving the completion edit.
If taking the same code, but triggering completion after having typed another character it works correctly.
typet = [ `T1 | `T2 ]
letx : t =`T
In this case triggering completion after the T character (character 14) the LSP returns completion items with ranges where start = 12 and end = 14 which leads to the client being able to correctly interpret the text edit required for resolving the autocomplete.
Ocaml-lsp version:
1.20.1
Logs:
LSP logs from my neovim for the incorrect example
It also returns a lot of irrelevant completion items (which makes the textdocument/completion response too long for github so I'll attach it in a file). However, all the returned completion items share the same incorrect range.
When triggering completion just after the ` character of a polymorphic variant's name, the LSP returns completion items where the start and end positions are identical and equal to the position after the `. This causes the client to interpret the completion item as simply inserting text instead of also replacing the already typed ` character upon resolving the completion.
Example
Consider the following code:
Triggering autocomplete after the backtick character (at character 13) results in the wrong behaviour with the LSP returning completion items with ranges where start = end = 13. I would expect the returned items to have a start = 12 and end = 13 so that the completion client can correctly replace the ` character when resolving the completion edit.
If taking the same code, but triggering completion after having typed another character it works correctly.
In this case triggering completion after the T character (character 14) the LSP returns completion items with ranges where start = 12 and end = 14 which leads to the client being able to correctly interpret the text edit required for resolving the autocomplete.
Ocaml-lsp version:
1.20.1
Logs:
LSP logs from my neovim for the incorrect example
It also returns a lot of irrelevant completion items (which makes the
textdocument/completion
response too long for github so I'll attach it in a file). However, all the returned completion items share the same incorrect range.log_wrong.txt
LSP logs for the correct (second) example:
The text was updated successfully, but these errors were encountered: