I was taking a look at the LSP Spec and I noticed here that CommonMark currently doesn’t support this protocol.
Is there anyone currently working on support for this?
I was taking a look at the LSP Spec and I noticed here that CommonMark currently doesn’t support this protocol.
Is there anyone currently working on support for this?
Here’s a couple of pointers.
I do know of one editor, the Xi Editor project, that supports a client/server architecture.
In the “server” code, LSP is mentioned: xi-editor/rust at master · xi-editor/xi-editor · GitHub
And I know from testing that this editor does support Markdown. That happens through its component called “syntect”, where Sublime Text/TextMate highlighting is used.
I’m not fluent in Rust, the programming language of the Xi Editor – but I do think that one could replace this Markdown parser with a CommonMark implementation. In fact, the Xi Editor does support syntax highlighting for Rust itself via another extension in its core sans TextMate highlighting, so there’s hope.
So if one combined a Rust CommonMark implementation with this editor, you might end up with an LSP server for Markdown already
LSP is designed for programming languages, something Markdown/CommonMark is not*. Markdown doesn’t have reserved words, identifiers or symbols** needing auto-completion, method signatures for which help info can be displayed, etc. Okay, maybe LSP could still be useful to highlight syntax errors? Nope. In Markdown, there is no such thing as a syntax error. Every string of text is a valid Markdown document.
You’ll notice in the list of implementations there is not one that isn’t a programming language.
*though the complexity of the rules sometimes makes them feel like programming languages.
**with the exception of Link Ref Definitions
I disagree with @vas here and say that it makes sense to have a markdown server somewhere on github that editors can use.
textDocument/publishDiagnostics
textDocument/hover
about various markdown constructstextDocument/documentLink
to allow the user to click on a URL. This can be made smart by implementing it in such a way that even things like (foo)[1] work.textDocument/documentSymbol
to provide a sort of “table of contents” by collecting all the header titles.