All Projects → razzmatazz → csharp-language-server

razzmatazz / csharp-language-server

Licence: MIT license
Roslyn-based LSP language server for C#

Programming Languages

F#
602 projects

Projects that are alternatives of or similar to csharp-language-server

glsp-examples
Example diagram editors built with Eclipse GLSP
Stars: ✭ 28 (-81.94%)
Mutual labels:  lsp-server
LspCpp
A Language Server Protocol implementation in C++
Stars: ✭ 40 (-74.19%)
Mutual labels:  lsp-server
tds-vscode
Totvs Developer Studio for vscode
Stars: ✭ 135 (-12.9%)
Mutual labels:  lsp-server
Ccls
C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Stars: ✭ 2,756 (+1678.06%)
Mutual labels:  lsp-server
Haskell Language Server
Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Stars: ✭ 1,857 (+1098.06%)
Mutual labels:  lsp-server
Rust Analyzer
A Rust compiler front-end for IDEs
Stars: ✭ 7,991 (+5055.48%)
Mutual labels:  lsp-server
camel-language-server
The Apache Camel LSP server implementation
Stars: ✭ 31 (-80%)
Mutual labels:  lsp-server
atom-languageclient
Provide integration support for adding Language Server Protocol servers to Atom.
Stars: ✭ 34 (-78.06%)
Mutual labels:  lsp-server
ltex-ls
LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others
Stars: ✭ 182 (+17.42%)
Mutual labels:  lsp-server
jsonnet-language-server
A Language Server Protocol (LSP) server for Jsonnet (https://jsonnet.org)
Stars: ✭ 55 (-64.52%)
Mutual labels:  lsp-server
ansible-language-server
Ansible Language Server
Stars: ✭ 114 (-26.45%)
Mutual labels:  lsp-server
merlin-language-server
Minimal cross-platform LSP wrapper for merlin
Stars: ✭ 28 (-81.94%)
Mutual labels:  lsp-server
glsp-server
Java-based server framework of the graphical language server platform
Stars: ✭ 25 (-83.87%)
Mutual labels:  lsp-server

Description

This is a hacky Roslyn-based LSP server as an alternative to omnisharp-roslyn.

csharp-ls requires .NET 6 SDK to be installed. However it has been reported to work with projects using older versions of dotnet SDK, including .NET Core 3, .NET Framework 4.8 and possibly older ones too as it uses the standard Roslyn/MSBuild libs that Visual Studio & omnisharp does.

See CHANGELOG.md for the list of recent improvements/fixes.

Installation

dotnet tool install --global csharp-ls

See csharp-ls nuget page

Building

On Linux/macOS

$ (cd src && dotnet build)

Features

  • symbol rename;
  • code refactorings from roslyn;
  • go-to-definition;
  • find references;
  • document/workspace symbol search;
  • textDocument/documentHighlight support:
    • highlighting other symbol references in the document on hover;
  • codeAction/resolve support for better performance when invoking code actions;
  • go-to-definition in metadata support (needs integration from your LSP client).

Acknowledgements

  • csharp-ls is not affiliated with Microsoft Corp;
  • csharp-ls uses LSP interface from Ionide.LanguageServerProtocol;
  • csharp-ls uses Roslyn to parse and update code; Roslyn maps really nicely to LSP w/relatively little impedance mismatch;
  • csharp-ls uses ILSpy/ICSharpCode.Decompiler to decompile types in assemblies to C# source.

TODO list

  • it seems push diagnostics logic we have is not very responsive when we have a lot of documents open;
  • check we're not doing lense stuff or other funny things on metadata code (emacs-lsp/lsp-mode issue?);
  • find-refs is blocking r/w operations, request scheduling needs smarter refactoring;
    • should we cancel existing ones? -- where cancellable? how to know?
  • support for pull diagnostics (lsp 3.17);
  • support for inlay hints (lsp 3.17);
  • go-to-def in metadata does not work for Attribute as those have Attribute suffix;
  • progress support;
  • properly escape docxml text, e.g. backquote is a special character in markdown;
  • selection range provider
  • semantic tokens
  • ability to run tests / test browser support like fsac has?
  • razorls integration (server-side)
  • analyzer support
  • code generator support
  • vscode plugin

FAQ

decompile for your editor , with the example of neovim

api

The api is "csharp/metadata", in neovim ,you can request it like

  local result, err = client.request_sync("csharp/metadata", params, 10000)

sender

You need to send a uri, it is like

csharp:/metadata/projects/trainning2/assemblies/System.Console/symbols/System.Console.cs

In neovim, it will be result(s) from vim.lsp.handles["textDocument/definition"]

and the key of uri is the key,

The key to send is like

local params = {
	timeout = 5000,
	textDocument = {
		uri = uri,
	}
}

The key of textDocument is needed. And timeout is just for neovim. It is the same if is expressed by json.

receiver

The object received is like

{
	projectName = "csharp-test",
	assemblyName = "System.Runtime",
	symbolName = "System.String",
	source = "using System.Buffers;\n ...."
}

And In neovim, You receive the "result" above, you can get the decompile source from

local result, err = client.request_sync("csharp/metadata", params, 10000)
local source
if not err then
	source = result.result.source	
end

And there is a plugin of neovim for you to decompile it.

csharpls-extended-lsp.nvim

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].