-
Notifications
You must be signed in to change notification settings - Fork 51
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
Code completion #6
Comments
Oh, just noticed you're on the JB team and probably already know everything involved with creating a completions plugin. 😆 Thoughts on the amount of work this might take given the existing tools in https://github.com/JetBrains/kotlin? |
Hi, thanks for the feature request. I'm afraid implementing code completion via looking up symbols by kotlin-compiler-embeddable would be too slow for any real world scenario. I think the only way this could be useful is if it's fast enough, and I just don't see any way to make it fast at this point. Maybe some other, mostly heuristic, approach should be taken. |
It appears that most of the heavy lifting in javacomplete2 is done with another jar running as a daemon. I could be wrong, but it doesn't look like the parser is used for much. https://github.com/artur-shaik/vim-javacomplete2/tree/master/libs/javavi/src/main/java/kg/ash/javavi |
If that is indeed the case, I suppose you could try and see how fast this would actually be. I think a working prototype wouldn't take much time, however you may need to create a custom build of kotlin-compiler-embeddable if you discover that there's no API to do something, and that would require getting familiar with the Kotlin project itself and how it's built. |
@udalov Is this something you do want to see implemented in this project? Considering that KotlinLanguageServer exists, it may not be worth the work (having used said LSP a little bit, it seems to work fine and as intended, although YMMV). May be wrong though, since some people don’t want to deal with installing and setting up an LSP; having things all in one place can be nice. |
Let's have Kotlin completions!!! 😄
I've forked this repo to start working on completions, but it would be nice to collaborate on a feature branch here. I've never written a Vim plugin, so I'm using this as a guide: https://github.com/artur-shaik/vim-javacomplete2
They're using an AST parser, which Kotlin provides as an embeddable dependency (I've used it here: https://github.com/notion/kotlin-format). If this doesn't fit into the scope of this repo, I can close this issue and start a new project.
The text was updated successfully, but these errors were encountered: