Hacker News new | ask | show | jobs
by FloatArtifact 741 days ago
It would be very interesting to leverage this to edit documents as much as code. Obviously editor-dependent due to the language server.
1 comments

Isn't the entire point behind "language server" (guess it's referring to LSP - Language Server Protocol) that it gets rid of editor-dependent stuff?

The dream (as I understood it) was that people could write things like this, and it'll work out-of-the-box for a bunch of other editors, as long as they follow LSP.

Are there any text editors that use LSPs for non-coding tasks?
It's not really about the editor. The editor (the LSP client) just provides support for telling the server what the user wants a definition for, and how to display that back to the user.

As a simple example, I'm learning japanese so I built a 50-line LSP server that just looks up definitions of a word under cursor in a dictionary. This is an almost-trivial server. Its only capability is to offer definitions when hovering a position in a text document. It works perfectly well in neovim with lspconfig with 2 lines of configuration. I'm sure it would be similarly trivial to integrate in VSCode, Emacs, etc.

Other non-coding uses of LSP that I'm aware of are spell-checking and grammar suggestions (LSP clients can display diagnostics), semantic syntax highlighting (e.g. for highlighting a markdown document), and projects like the one discussed here which just integrate more general-purpose AI.

I've seen one for Bean ledgers, so that's a bookkeeping LSP, I guess.