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

Integrate idea plugin #21

Closed
barsan-md opened this issue Apr 23, 2018 · 9 comments
Closed

Integrate idea plugin #21

barsan-md opened this issue Apr 23, 2018 · 9 comments

Comments

@barsan-md
Copy link

barsan-md commented Apr 23, 2018

I'm wondering how much work would require to integrate the plugin used by intellij idea community edition. It has a lot of features including static analysis, formatter, goto declaration, refactor and similar stuff. What do you think, is it doable?

@nishtahir
Copy link
Collaborator

I've been looking into this. Specifically, what it would take to port some of the work that's been done on the various platform plugins. Unfortunately most of the APIs there are heavily undocumented and tightly coupled to the IntelliJ platform as expected.

Simply put, it's non-trivial.

Right now I think the most reasonable way to go with the lowest level of effort is actually to port over work done from the Eclipse plugin. However, unfortunately, this is also mostly undocumented using what seem to be poritons of the idea plugin repackaged.

@barsan-md
Copy link
Author

barsan-md commented Apr 24, 2018

You are right about the Eclipse plugin, yet I've looked a little in the files and I could not understand the architecture (without knowledge about the plugin system of Eclipse or Idea). Even tough there is a modest attempt to document the code, the information is far from enough. Also I suspect that creating a CLI wrapper around the stuff delivered with kotlin is much harder than what this plugin does, after all java can use kotlin directly.

In my opinion the most immediate chance to add features to this plugin with the minimum amount of work is using klint and possibly (?) detekt

This was referenced Apr 27, 2018
@nishtahir
Copy link
Collaborator

I think pulling in ktlint is interesting. I'll have to look into it a bit further.

For some of the other capabilities, I recently discovered this project which implements the language server protocol for Kotlin. It's using a lot of the same techniques that the eclipse plugin uses for features like autocomplete and jump-to-definition. I think it would be best to contribute features such as the code formatter changes to that project. 🤔

@fwcd
Copy link

fwcd commented May 27, 2018

The owner of kotlin-language-server has apparently removed the extension from the marketplace thus making this the only Kotlin extension left.

Integrating a language server would definitely improve the experience immensely and make it viable alternative to IDEA.

@fwcd
Copy link

fwcd commented May 30, 2018

If anyone is interested, I have forked kotlin-language-server and done quite some work on supporting both Gradle and Maven projects. I would definitely appreciate any help to eliminate the last bugs.

@nishtahir
Copy link
Collaborator

@fwcd Thanks for doing this. It was on my todo to spend some time looking at the project. I would like to integrate it into this project if possible

@fwcd
Copy link

fwcd commented May 31, 2018

@nishtahir Sure, that would definitely be possible. You could add my kotlin-language-server fork as a Git submodule, ignore the VSCode extension code in the language server repo (might want to add that to your .vscodeignore?) and call the appropriate start scripts from your extension.

Note that you would have to do a Gradle build yourself every time you pull an updated version of the language server.

@fwcd
Copy link

fwcd commented Oct 26, 2018

@nishtahir Some time has passed and the language server extension (together with the debug extension) has more or less evolved to a fully functional solution for Kotlin development.

What do you think about treating either this repo or language-kotlin as an upstream repository where all Grammar development is done and do all language smartness downstream?

@nishtahir
Copy link
Collaborator

nishtahir commented Oct 26, 2018

Yeah, that's a good idea. I would like this repository to continue to remain a simple lightweight syntax highlighting plugin and allow fwcd/KotlinLanguageServer to be the fully featured solution. nishtahir/language-kotlin should be the upstream grammar for syntax highlighting as it's being used on GitHub as well.

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