csharp-language-server-protocol icon indicating copy to clipboard operation
csharp-language-server-protocol copied to clipboard

Purpose of this library is not immediately obvious

Open mattgallagher92 opened this issue 2 years ago • 3 comments

I've come to this repo because I've seen a project which refers to it to create a language server.

After spending a while digging around, it's not obvious to me whether this is meant to be a language server for the C# language (which the project I've seen has hijacked), or a library that can be used to write a language server implemented in .NET (for any language). My assumption is that it's the latter, but I think it would be worth making it obvious with a sentence or two at the beginning of the README.

One example could be "csharp-language-server-protocol is a library that makes it easy to create language servers (and clients) that run on .NET, by abstracting away boilerplate. It can be used to implement language servers for any language."

mattgallagher92 avatar Sep 12 '23 16:09 mattgallagher92

It is the latter. See this pinned issue for examples: https://github.com/OmniSharp/csharp-language-server-protocol/issues/193 But yes the documentation (and project as a whole) is needing some updates.

andyleejordan avatar Sep 12 '23 16:09 andyleejordan

Thanks for clarifying!

mattgallagher92 avatar Sep 13 '23 16:09 mattgallagher92

If your "language" for which you want LSP support already has a compiler written in C# it's an obvious step to use this library, and the sample is a good stating point (was for me).

Also I'd suggest you take a look at the Azure Bicep implementation as this is also based on OmniSharp and has the entire Language ecosystem for other hints of how to make it all work together.

A good place to start is with a TextDocumentSyncHandler : TextDocumentSyncHandler implementation that you can hook in some kind of Compilation Manager via DI, so you can track compilation for each source file as they change.

Simonl9l avatar Nov 05 '23 01:11 Simonl9l