poc for gopls support
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.
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
- Added inline annotation from compilation issues and staticcheck information (with options to disable the printing)
- Added options to select which kind of categories you want to disply from staticcheck
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 :).
how did this PR end up? Are there plans to add support for gopls?
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.