carymrobbins / intellij-haskforce

Haskell plugin for IntelliJ IDEA
http://carymrobbins.github.io/intellij-haskforce/
Apache License 2.0
486 stars 41 forks source link

Consider integrating haskell-ide-engine #223

Open alanz opened 8 years ago

alanz commented 8 years ago

https://github.com/haskell/haskell-ide-engine is a project hoping to simplify integration of haskell tools into IDEs. It does this by separating out the process of integrating a tool into hie from integrating hie into an IDE. The intention is that each of these need only happen once.

azdanov commented 5 years ago

Is there any way to use hie with haskforce?

I'm currently using hie with Visual Studio Code, but miss the features of Intellij.

carymrobbins commented 5 years ago

@azdanov It's certainly possible, we'd just need to write the integration into HaskForce. If you or someone else is interested in contributing, I could outline the steps needed to make this happen.

azdanov commented 5 years ago

@carymrobbins Nice to know! I'd be glad to contribute, or at least try. Don't know how difficult this feature is for a newbie.

carymrobbins commented 5 years ago

@azdanov Do you know which features of HIE you'd like to see integrated?

I'm thinking that using HIE's JSON HTTP transport would be ideal (contrasted with just using stdio), so to get started we'd want to have some code that can send requests, interpret responses, and maybe even spin up/down the HIE server. To test it, we could add integration tests to the test suite.

If you have trouble knowing how to start, let me know, either here or on the HaskForce Gitter channel.

alanz commented 5 years ago

At the moment hie is basically a language-server-protocol server, that would be the best way to integrate it.

Which could also leverage any LSP support for other languages in it.

azdanov commented 5 years ago

@carymrobbins The plugin I'm using in VSCode has these feature: https://github.com/alanz/vscode-hie-server#features. Basic linting and formatting would be a nice first milestone.

Ideally, full support with HIE is the goal.

I'll look around the codebase for a day or two, see what's up.

@alanz How much would need to be rewritten to use LSP with haskforce?

alanz commented 5 years ago

The better question is what LSP support exists already in intelliJ.

e.g. https://github.com/gtache/intellij-lsp

alanz commented 5 years ago

And if you went that route, you could devote your energies to hie, with all the fancy features you already have, and it would be shared across all IDEs that support HIE.

azdanov commented 5 years ago

@alanz I agree, LSP and HIE are the future. IntelliJ doesn't have native support for LSP yet though.

carymrobbins commented 5 years ago

@alanz There is indeed IntelliJ-LSP, but I'm not sure that it will cover things like syntax highlighting, linting, type info, etc. There are plenty of custom endpoints we'd want to leverage from HIE, so being restricted to the current state of LSP probably isn't good enough for what @azdanov wants.

alanz commented 5 years ago

Ok. As I said, the main focus for hie is LSP, we do still have the stdio interface, and it is being integrated into kdevelop, via I think @arrowd. But there has been little work there recently.

carymrobbins commented 5 years ago

@alanz Is there anything exposed via the JSONRPC transport that is not LSP compliant, e.g. type info?

alanz commented 5 years ago

TBH, I am not at all sure what is exposed on the JSONRPC transport.

Everything that the plugins do, but I think there is a slant toward LSP, wrt types and so on, and there is logic in the LspStdio.hs that glues things together functionally, that should perhaps be moved to a more general location.

I know @Bubba has done a good job of moving things out of the transport, and if necessary we can do more.

The best would be to look at the tests, I guess.