Giter VIP home page Giter VIP logo

roslyn.nvim's Introduction

roslyn.nvim

This plugin adds support for the new Roslyn-based C# language server introduced in the vscode C# extension.

Dependencies

Ideally I would like to depend on the Dotnet SDK and everything else to be optional. But for now:

  • Dotnet SDK (Tested with .net7).
  • nvim-lspconfig for some path utility functions.
  • Neovim nightly required. Tested on 831d662ac6756cab4fed6a9b394e68933b5fe325 but anything after August 2023 would probably work.

Setup

Just install jmederosalvarado/roslyn.nvim using your plugin manager.

require("roslyn").setup({
    dotnet_cmd = "dotnet", -- this is the default
    roslyn_version = "4.8.0-3.23475.7", -- this is the default
    on_attach = <on_attach you would pass to nvim-lspconfig>, -- required
    capabilities = <capabilities you would pass to nvim-lspconfig>, -- required
})

Usage

Before trying to use the language server you should install it. You can do so by running :CSInstallRoslyn which will install the configured version of the plugin in neovim's datadir.

  1. Upon opening a C# file, the plugin will look for a .sln file in parent directories until it finds one. Make sure to have a .sln file somewhere in a parent dir, there is no support yet for .csproj only projects.
  2. If it only finds one .sln file, it will use that to start the server. If it finds multiple, it will ask you to choose one before starting the server. When multiple .sln files are found for a file, you can use the command :CSTarget to change the target for the buffer at any point.
  3. You'll see two notifications if everything goes well. The first one will say Roslyn client initialized for target <target>, which means the server is running, but it will just start indexing your sln. The second one will say Roslyn project initialization complete, it means that the server indexed your sln, only after you see the second notification will the go to definition and other lsp features be available.

Features

Please note that some features from the vscode extension might not yet be supported by this plugin. Most of them are part of the roadmap, however I don't use vscode myself, so I'm not aware of all the features available, feel free to open an issue if you notice something is missing.

roslyn.nvim's People

Contributors

jmederosalvarado avatar maxle5 avatar ppebb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.