-
Notifications
You must be signed in to change notification settings - Fork 89
Invalid position in Completions #257
Comments
This is fixed in #83 with commit 8b3e27e#diff-78179d406a671306d86895d9604fca17 |
I'm seeing this in both vscode and atom in very different environments. (Home Ubuntu Desktop atom, Work OSX vscode). Tested on commit e526744 (Tue May 29 2018). Here is a characteristic error message, which I've seen in both the vscode console and in atom, if I try to use something like go to def:
And here's another one, an error message like this is emitted for every keypress:
I have verified that the offset is valid in the text editor. Could it be that go-langserver somehow is not using the content as it appears in the editor? Saving the file does not seem to help, but closing the file and reopening it appears to help at least sometimes. I don't rely on the code formatter to format my code, so usually saving doesn't result in the file changing. It's not easy to reproduce. It just starts happening at some point, and manifests as completion ceasing and go-to-def not working. If I exit and go back into the editor, it works for a little while. I can't point to a public repository where this manifests, I've only noticed it on two completely different companies' fairly large closed source projects. I don't hit it fast enough editing code separately from these repos to be able to give an independent reproducer. /xref microsoft/vscode-go#1628 where there are other vscode users reporting this issue recently. |
i'm looking forward to address this problem also. thank you! |
this issue still exists on neovim with plugin ncm2 and LanguageClient-neovim |
I had the exact same problem if I start go-langserver -gocodecompletion -freeosmemory=false |
I get this problem too using Emacs 27-trunk + eglot. To fix it, I delete eglot and jsonrpc from emacs using |
I'm working on a custom client with this language server.
When I requests for a completion with the files contents as:
im
and line as 0 and character as 2, I geterror: go completion error: Error: invalid position: (character 2 is beyond first line boundary)
But when I make a request with a blank line or space appended as:
im\n
orim
and the same line, character values of 0,2 I receive accurate completions.Is this a known issue or expected behaviour? Else, what am I doing wrong here?
The text was updated successfully, but these errors were encountered: