Closed d4ncer closed 5 years ago
It seems like the flow language server send the character offset 1 based instead of 0 based.
Here it is the completion of "" in both jdtls and flow.
>>> jdtls
"textEdit": {
"range": {
"start": {
"line": 13,
"character": 3
},
"end": {
"line": 13,
"character": 5
}
},
"newText": "charAt(${1:index})"
}
>> flow
"textEdit": {
"range": {
"start": {
"line": 1,
"character": 2
},
"end": {
"line": 1,
"character": 4
}
},
"newText": "charAt(${1:pos})"
}
So I assume it is either flow ls bug or there is some setting that should be passed to the server to make it work properly.
Thanks for doing the heavy lifting @yyoncho! I'll open an issue with Flow and see what the best course of action is. Will close this out.
I upgraded to Flow 0.97.0, which contains support for snippets in completion in their LSP (see this PR) and have run into some weird issues where triggering the completion is deleting a single required char.
You can see it in action in the example below, one case where I run the completion directly after typing in
.
, and the other after narrowing it down a bit. In the first case, it deletes the.
before adding in the completion, and in the second case, deletes theh
and keeps the initialc
instead of replacing all of it.If this isn't the right place to handle this issue, let me know if I should post this issue somewhere else.
Thank you!