amp icon indicating copy to clipboard operation
amp copied to clipboard

Support the Language Server Protocol

Open ghost opened this issue 7 years ago • 13 comments

Have you considered supporting the language server protocol (LSP)?

Supporting this directly in the editor might be a good idea since it would already cover a lot of the use cases that would otherwise be relegated to a plugin API. Pretty much all of the other major editors (atom, emacs, code, (neo)vim, etc.) have decent support for the LSP at this point and most major languages have good server implementations too.

ghost avatar Jan 28 '18 03:01 ghost

This is genius. 👌

I love the idea of an integrated, general solution that isn't language-specific. It looks like RLS supports it, and preliminary support is available for Ruby, too.

If there is broad enough language support for this, I think this is a great direction for Amp.

jmacdonald avatar Jan 28 '18 04:01 jmacdonald

Language support is rather reasonable: http://langserver.org/ (There is a table "Language servers") The page might be a bit outdated. Nonetheless, there are a plenty of languages there.

As an example sbt recently released support for Language Server protocol.

Yep, RLS is really well working.

zaynetro avatar Jan 28 '18 20:01 zaynetro

Any update on LSP support? For me this is the only thing missing to use amp day to day :)

Keep up the good work ^^

korken89 avatar Nov 24 '18 11:11 korken89

Thanks, @korken89!

The priority for 0.6 is moving away from termbox, which will get us 24-bit color support, drop the Python build requirement, and remove a C library dependency. I'm thinking the focus for 0.7 may be LSP support. I'll do a bit of roadmap planning and will add that to the README; thanks for the nudge. :slightly_smiling_face:

jmacdonald avatar Nov 24 '18 17:11 jmacdonald

Thanks for the update, can't wait to see where this goes!

korken89 avatar Nov 25 '18 10:11 korken89

Just a small nudge here, I am in the exact same boat as @korken89, where LSP being the main blocker for me. Would love to nuke my NeoVim config to use something that does not have 10x different plugins that breaks on libboost update or something similar .

Very nice editor you have created! Cant wait to see how 0.7 turns out!

TotalKrill avatar Aug 28 '19 08:08 TotalKrill

I'd love to know what, specifically, folks are after with LSP support. I've often wanted "jump to definition", as navigating/reading code is something I'm doing fairly often. Would appreciate other people's perspectives before I start planning the implementation for this. :slightly_smiling_face:

jmacdonald avatar Sep 02 '19 15:09 jmacdonald

Agree. This is one of the most important features of a dev env. Especially when reading someone else’s code. That and contextual auto suggestion.

mzarnitsa avatar Sep 02 '19 19:09 mzarnitsa

I constantly use tools to get autosuggestions about accessible methods and members on a structure, as well as their signatures, saves me a trip to the documentation quite often, as well as typing the entire function name.

This usually keeps me from using abbreviated method names which is common in environments without autocomplete.

The other thing which I do not know is LSP is syntax errors and compilation warning/error indication directly in the editor.

Ofcourse I also use jump to definition and to jump back to where I was after. In vim I have ctrl+I (jump in) gotot definition and ctrl+o (jump out) to go back

TotalKrill avatar Sep 03 '19 08:09 TotalKrill

@jmacdonald Here's why I want it:

  • Type ahead (huge)
  • Show types of variables (where the type is inferred) (huge)
  • Show declaration
  • Rename symbol
  • Go to definition

jrop avatar Dec 04 '19 23:12 jrop

Is there any status update on this?

TotalKrill avatar Apr 27 '20 12:04 TotalKrill

This might be helpful: autozimu/LanguageClient-neovim It's a Language Server Protocol client written in Rust, although intended for neovim 😄

nyaa8 avatar May 28 '20 13:05 nyaa8

My 2 cents on how I use LSP in the order from most to least important:

  1. Go to definition
  2. Lookup documentation or get an error on the current line as a pop-up message under cursor
  3. Rename symbol
  4. Semantic token highlighting (stock highlighting isn't even used, generally useful to get highlighting on defined variables to avoid typos and it is a superior highlighting method in all respects too)
  5. Formatting (mostly when it is interpreted language and formatting isn't as fast as Zig or Go version, I used it with Elixir and it's pleasingly fast)

EDIT: Also a link to LSP implementation for Kakoune text editor if useful, in Rust too https://github.com/kak-lsp/kak-lsp.

greenfork avatar Jun 14 '21 12:06 greenfork