-
Notifications
You must be signed in to change notification settings - Fork 659
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
Feature request: autocomplete for import #257
Comments
Valid request, but since I'm in maintenance-only, I won't do it in near future. Maybe someone else will. |
ah this is LiteIDE, I will submit the feature request to LiteIDE. |
I'm gonna take a stab at implementing this. |
Good luck, I would start from here: https://github.com/nsf/gocode/blob/master/cursorcontext.go#L272 You need to figure out somehow that the cursor is on the import clause. Maybe do some sort of reverse parsing. This function above actually does tokenize code, but you should take care about a common case when string literal isn't valid, e.g.: package main
import (
"io/
) In this case tokenizer may actually fail. But there are hacks to avoid that, you can try detecting if amount of quotes before the cursor is odd (be careful about possible quotes in comments) and insert a quote after the cursor. All sorts of hacks may work. It's definitely possible to do a solid context detection here, but may take some time. |
@nsf thanks. |
When typing inside import, there should be autocomplete containing all libraries that have been installed.
The text was updated successfully, but these errors were encountered: