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

Code completion #6

Open
pardom-zz opened this issue Jun 23, 2017 · 5 comments
Open

Code completion #6

pardom-zz opened this issue Jun 23, 2017 · 5 comments

Comments

@pardom-zz
Copy link

pardom-zz commented Jun 23, 2017

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.

@pardom-zz
Copy link
Author

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?

@udalov
Copy link
Owner

udalov commented Jun 23, 2017

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.

@udalov udalov changed the title Completions Code completion Jun 23, 2017
@pardom-zz
Copy link
Author

pardom-zz commented Jun 23, 2017

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

@udalov
Copy link
Owner

udalov commented Jun 23, 2017

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.

@smolck
Copy link

smolck commented Jul 8, 2019

@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.

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

No branches or pull requests

3 participants