Skip to content
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

poc for gopls support #1211

Closed
wants to merge 24 commits into from
Closed

poc for gopls support #1211

wants to merge 24 commits into from

Conversation

JLugagne
Copy link

I'm using liteide for my daily gocode, but I encounter a few issues with gocode and gotools from time to time. So as suggested in some opened isues, I looked at gopls and started to write a plugin for its support. So far, I have managed to get a few things working like: autocomplete, go to declaration, hover (with link and documentation), formatting and imports' update on save.
There is a lot to do to get a working and usable plugin, but I though it could be a good start to it. It's a bit hacky as I just mimic a few existing plugins (gofmt, gocode, ...) and things could be simplified/fixed.

The way i did it is:

  • The main plugin's class is: GolangPls to interact with editor
  • The class to interact with gopls command: GoPlsServer
    All the types/payloads are defined in generated.h, this file is generated from the gopls source code, I think there is a better way to go, but it works pretty so far and can but easily updated.

I'm open to discuss about it and how to improve it and also open to pull request to improve the plugin itself as there is a lot to do.

@JLugagne JLugagne changed the title prototype for go pls support poc for gopls support Dec 24, 2021
@JLugagne
Copy link
Author

JLugagne commented Dec 29, 2021

I have pushed a new version of the plugin with some added features to the liteeditor plugin, here is a list of what I've done so far, and what need to be fixed:

  • Added a combobox to access symbols in a file like in QtCreator, which is synchronised with the cursor position
    image
    image
  • Added inline annotation from compilation issues and staticcheck information (with options to disable the printing)
    image
    image
  • Added options to select which kind of categories you want to disply from staticcheck
    image

Known issues:

  • The annotation has a little drift, not always 100% aligned with the text line.
  • Tool tip with detailed information on annotation isn't displayed at the right place, it's a bit off.

Features I still want to add:

  • Rename symboles

@visualfc, let me know if you find those features useful or if it's not needed. For the code review, it's still a be to early but we can discuss about features first and then let's discuss about code :).

@kor44
Copy link

kor44 commented Oct 17, 2023

how did this PR end up? Are there plans to add support for gopls?

@JLugagne
Copy link
Author

I had a lot of performance issues with go-pls (most probably due to miss-configurations) and I had a lot less time to work on it so I wasn't able to fix those and make a proper PR.
I think I have to close it except is someone want to continue working on it.

@JLugagne JLugagne closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants