-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto complete package imports #6
Comments
This sounds like it could be an issue in the Atom language client library. The imports are added via the additional text edits field of a completion item: https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#textDocument_completion. |
I'm 99% sure this is an issue with ide-gopls. I had to add special code when I did this the first time around to apply the additional edits see https://github.com/MordFustang21/ide-gopls/blob/master/lib/main.js#L68 |
Issue MordFustang21#6. The issue is that gopls sends back the coordinates for the text in the actual buffer and does not consider the changes made along the replaces. So, as soon as the first replace in the text happens all other coordinates are automatically wrong. Replaced text suggestions from bottom to top (reverse for-each), so it will prevent text to be moved from it's original place.
fixed on PR #16 |
Issue #6. The issue is that gopls sends back the coordinates for the text in the actual buffer and does not consider the changes made along the replaces. So, as soon as the first replace in the text happens all other coordinates are automatically wrong. Replaced text suggestions from bottom to top (reverse for-each), so it will prevent text to be moved from it's original place.
When the editor adds the missing import it injects the completion selection incorrectly. Ex.
becomes
The text was updated successfully, but these errors were encountered: