howl icon indicating copy to clipboard operation
howl copied to clipboard

Support for Language Server Protocol

Open megatux opened this issue 7 years ago • 17 comments

Feature request. Any plans to implement a LSP client?

More docs Language Server Protocol on GH

megatux avatar Aug 11 '17 13:08 megatux

This probably needs socket support first (cough cough)...

refi64 avatar Aug 11 '17 13:08 refi64

@megatux - Yes! I've been interested in this for a while and have started looking into this more deeply, but as always, time is scarce.

@kirbyfan64 - this does not necessary need socket support. LSP does not require sockets (any stream transport works) and there are definitely implementations that just talk LSP over stdio - which already works well in Howl.

shalabhc avatar Aug 12 '17 00:08 shalabhc

For instance, the Python language server works on stdio by default (https://github.com/palantir/python-language-server/blob/develop/pyls/main.py). It also supports mypy, btw :smile:

shalabhc avatar Aug 12 '17 00:08 shalabhc

Ohh, nice...

refi64 avatar Aug 12 '17 03:08 refi64

So much this. Gets us advanced language modes for free :-)

ozra avatar Feb 10 '18 11:02 ozra

@shalabhc - will it work now by using the py-server as proxy?

I'm working my ass off atm, deadlines and stuff, with a codebase primarily in TypeScript, which really just is helpful when having the great input from the lang-server. Which means, I've left Howl aside for several weeks now, in favor of Atom — which blows balls in comparison to Howl, quality wise :'-(

ozra avatar Apr 19 '18 09:04 ozra

Just have to make a hopeful bump here... I'm continually working 12 hour days with exclusively typescript code bases, so am stuck with Atom, Visual Code and Sublime these days (sob, sob) — I miss Howl soooo much it hurts my heart :'-(

ozra avatar Feb 28 '19 10:02 ozra

This is probably the next thing I'll work on once I'm done with command-interaction-refactor (see branch of same name). I need langserver integration for stuff I'm working on atm. At one point I got the messaging between Howl and a langserver working, parsed using dkjson.

shalabhc avatar Mar 01 '19 00:03 shalabhc

@ozra - do you have ideas on what the best way to design the UI for this might be? Which LSP features do you need most? I assume goto-definition and maybe completion?

shalabhc avatar Mar 07 '19 06:03 shalabhc

I'll just randomly interject and say that it'd be really nice if the LSP and JSON-RPC parts were separate, since the latter could be reused for e.g. Dart's analysis server which really closely follows JSON-RPC.

(I actually had a sort-of-working JSON RPC that went in the black hole of data loss...)

refi64 avatar Mar 07 '19 06:03 refi64

I have a JSON-RPC thing working and unfinished LSP support. I can manually invoke 'textDocument/definition' etc and get meaningful results from within Howl. Nothing is tied into the editor yet. The JSON-RPC part is decoupled - we could pull it out into its own bundle (or even put in lib/howl?) if we want.

shalabhc avatar Mar 07 '19 06:03 shalabhc

@shalabhc

Regarding UI, there's not that much to talk about for the most important features, pretty basic UI elements.

Features I use all the time, in order of importance:

  • go to definition
  • see errors marked in code (same as for moonscript, etc.)
  • go to next / prev error in project (I use alt-up/down like in meld)
    • could be separated into two cmds: next/prev-err-in-file, or next/prev-err-in-project
    • I don't know if there are standardized commands for this in Howl already, since I've been out of it for too long: also good are: goto-next-error, goto-next-warning, goto-next-hint, goto-next-notice-of-any-level
  • auto completion of everything (basically I type everything super soundly with generic types, and make heavy use of literal types (akin to dependent types), making the whole program self documenting and impossible to get arguments etc. wrong, even when variant based on prior arguments values, etc, so it's the most important step in TDD imo and, also a driving factor, is that it makes it super easy for entry level coders in the teams to be way more productive and valuable — and learn faster [I wish there was a TypedMoonScript — holy shit that would rock!])
  • peek type (mouse hover, or command while cursor at identifier) - shows the inferred type of the identifier in the context
  • semantic rename of identifier - this is veeeery convenient for making semantically safe whole-program refactoring in just a second of work
  • auto add imports of identifiers that match in modules already declared in the program manifest
  • find usages

ozra avatar Mar 08 '19 03:03 ozra

Has there been any update on this? I love Howl as an editor but the lack of any meaningful autocomplete/autodocs/etc. is a bit of a productivity issue.

zesterer avatar Jul 23 '20 10:07 zesterer

Indeed. With this and a couple of extra features and fixes this editor will skyrocket :)

megatux avatar Aug 28 '20 13:08 megatux

I have a JSON-RPC thing working and unfinished LSP support. I can manually invoke 'textDocument/definition' etc and get meaningful results from within Howl. Nothing is tied into the editor yet. The JSON-RPC part is decoupled - we could pull it out into its own bundle (or even put in lib/howl?) if we want.

@shalabhc Would you mind sharing this code?

dgaw avatar Dec 19 '20 10:12 dgaw

Any updates on this? Howl is one the best editors I've ever used but the lack of LSP support makes it really useless for software development these days with modern languages...

quienn avatar Aug 18 '21 02:08 quienn

Hmm, I might try to find some time to have a look at this. Time is a short as ever, but will let you know.

nilnor avatar Sep 17 '21 10:09 nilnor