一键重装系统工具 | U盘启动盘制作工具 | 误删文件恢复软件 | 硬盘数据抢救专家 | 电脑蓝屏修复助手 | C盘空间清理神器 | 电脑驱动离线安装工具 | 微信聊天记录恢复工具 | 照片误格式化恢复 | 电脑密码破解清除工具 | 系统崩溃紧急救援盘 | 电脑加速优化大师 | 电脑开不了机怎么重装系统 | 回收站清空了怎么恢复 | 硬盘分区丢失数据恢复 | 电脑卡顿重装系统有用吗 | U盘插入提示格式化数据恢复 | 电脑中毒文件被隐藏恢复 | 忘记电脑开机密码怎么办 | 新硬盘分区对齐工具 | 旧电脑装Win10流畅工具 | SD卡照片删除恢复免费版 | 移动硬盘打不开提示损坏修复 | 电脑无故重启系统修复工具 | 电脑小白一键重装神器 | 程序员电脑环境配置助手 | 设计师电脑字体/素材恢复工具 | 网吧网管系统维护工具箱 | 财务人员电脑发票备份恢复 | 学生党免费电脑系统安装包 | 电脑维修师傅必备工具盘 | 游戏玩家电脑性能优化助手 | 办公白领误删文档恢复软件 | 自媒体视频素材恢复工具 | 网课录制视频损坏修复工具 | 最好的U盘PE系统排名 | 数据恢复软件哪个最强 | 免费电脑助手与收费版区别 | 国产装机工具哪款无广告 | 离线版驱动助手推荐 | 轻量级电脑优化工具对比 | 支持NVMe驱动的PE工具 | 带网络功能的应急启动盘 | 2026最新版万能装机工具 | 支持Win11 24H2的PE工具 | 最新免激活系统重装工具 | 2026数据恢复软件破解版合集 | 纯净无捆绑装机助手V3.0 | 支持苹果M芯片的电脑助手 | 秋季更新版系统维护工具箱 | 电脑系统崩了怎么用U盘把重要资料拷贝出来 | 重装系统前哪些文件夹必须备份 | 固态硬盘误格式化还能恢复数据吗 | 如何制作一个既带PE又能存数据的双分区U盘 | 电脑总是弹窗广告用什么助手彻底拦截 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

Integrating the C# LSP in Claude Code

发布时间:2026-09-13 | 浏览:2
📥 下载地址(文章开头)
软件神器安装一切软件。
Instantly share code, notes, and snippets. Star 12 ( 12 ) You must be signed in to star a gist Fork 0 ( 0 ) You must be signed in to fork a gist Embed Select an option Embed Embed this gist in your website. Share Copy sharable link for this gist. Clone via HTTPS Clone using the web URL. No results found Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/jrusbatch/1d2c539ef17476c8703f04a2e9148693.js"></script> Embed Embed this gist in your website. Share Copy sharable link for this gist. Clone via HTTPS Clone using the web URL. No results found Save jrusbatch/1d2c539ef17476c8703f04a2e9148693 to your computer and use it in GitHub Desktop. Embed Embed this gist in your website. Share Copy sharable link for this gist. Clone via HTTPS Clone using the web URL. No results found The roslyn-language-server is a .NET tool that provides rich language features for C# through the Language Server Protocol. It powers editor integrations including the C# extension for Visual Studio Code and C# Dev Kit. It offers several operations that Claude can use to navigate C# code rather than using grep and friends. The Roslyn LSP supports many operations defined by the language service protocol, but from what I read only these commands are supported by Claude as of v2.1.62. goToDefinition : find where a symbol is defined. findReferences : find all references to a symbol. hover : get documentation and type info for a symbol. documentSymbol : list all symbols in a document. workspaceSymbol : search for symbols by name across the entire workspaced. goToImplementation : find implementations of an interface or abstract method. prepareCallHierarchy : get call hierarchy item at a position. incomingCalls : find all callers of a function/method. outgoingCalls : find all functions/methods called by a function. The instructions below describe how I integrated the roslyn-language-server into Claude Code to give Claude smarter tools for working with C# in the console. My understanding is that Claude in VS Code (especially as part of Copilot) shares VS Code's LSP. I ran these on Windows using Claude Code v2.1.62. The language server is cross platform so it should work on osx or linux. There might be ways to simplify this but this worked so I stopped fiddling with it. Set the env variable ENABLE_LSP_TOOL=1 in ~/.claude/settings.json : Run dotnet tool install --global roslyn-language-server --prerelease . This will put roslyn-language-server.cmd (or .sh? ) in your global tools directory (for me, ~/.dotnet/tools/ ). Create a local marketplace folder. Name/location of the directory doesn't matter, but I used ~/.claude-custom-plugins/ . Inside your marketplace folder, create a directory .claude-plugin . In the new directory create marketplace.json with the following content. Note that all slashes should be forward slashes. When providing an absolute path start with / (ex: /Users/{{ Your Name }}. Claude was very finicky about the structure of this document. I went through multiple iterations of this and now that it's working I'm scared to touch it. Inside your custom plugins directory, next to the .claude-plugin folder, create the directories plugins/roslyn-ls/ (this must match the source in the marketplace.json file). Create the JSON files .lsp.json and .claude-plugin/plugin.json . Your final directory structure should look like this: The content of .claude-plugin/plugin.json should look like the JSON below. I don't know if all these are necessary, but it at least works for me. I also think these values need to match their respective properties in marketplace.json . The content of .lsp.json properties under the csharp peroperty should match the properties in the roslyn-ls object in marketplace.json . Start claude and run the command /plugin marketplace add {{ absolute path to custom plugins folder }} . Ex. for me it was: /plugin marketplace add /Users/{{me}}/.claude-custom-plugins . Exit claude and run claude plugin install -s user roslyn-ls .
📥 下载地址(文章中间)
软件神器安装一切软件。
In claude you can verify the LSP is working with these two commands: /plugin -> select the Installed tab, and you should see roslyn-ls Plugin · local · ✔ enabled . Tell claude to run the C# LSP command documentSymbols on {{ path to some C# file }} . You should see a line like ● LSP(operation: "documentSymbol", file: "src\Vendors\IVendor.cs") /plugin -> select the Installed tab, and you should see roslyn-ls Plugin · local · ✔ enabled . Tell claude to run the C# LSP command documentSymbols on {{ path to some C# file }} . You should see a line like ● LSP(operation: "documentSymbol", file: "src\Vendors\IVendor.cs") You should be all set! mottdisco commented Mar 3, 2026 • edited Loading Uh oh! There was an error while loading. Please reload this page . There was an error while loading. Please reload this page . There was an error while loading. Please reload this page . Hey, I found this while trying to set this up at the new gig, and look who it is! wudishidove commented Mar 4, 2026 awesome thanks! Audun97 commented Mar 7, 2026 @jrusbatch Thanks for the guide — this got me further than anything else I found for C# LSP in Claude Code. I followed your steps on WSL2 (Ubuntu) with Claude Code v2.1.71. A few things I ran into that others might hit: The roslyn-language-server NuGet package requires .NET 10 SDK. On .NET 9, dotnet tool install --global roslyn-language-server --prerelease fails with "Settings file 'DotnetToolSettings.xml' was not found in the package." Installing .NET 10 SDK alongside .NET 9 fixed this. On Ubuntu/WSL2, note that if DOTNET_ROOT points to a user-level .dotnet install, apt install dotnet-sdk-10.0 installs to /usr/lib/dotnet/ but dotnet --list-sdks won't see it — you need to update DOTNET_ROOT to /usr/lib/dotnet. documentSymbol works, but semantic operations hang. After setup, documentSymbol returns results fine (found 17 symbols in my file). However hover, goToDefinition, findReferences, and workspaceSymbol all hang indefinitely or return empty. This appears to be the same issue as #16360 — Claude Code's LSP client doesn't implement workspace/configuration, client/registerCapability, or window/workDoneProgress/create, which Roslyn needs for full solution analysis. Structural queries work because they don't require the full project graph; semantic queries do and get stuck waiting for responses that never come. Did you get hover, goToDefinition, or findReferences returning actual results on your setup? Curious if native Windows behaves differently here. mnmr commented Mar 13, 2026 Did you get hover, goToDefinition, or findReferences returning actual results on your setup? Curious if native Windows behaves differently here. You can use https://github.com/Agasper/CSharpLspAdapter (an LSP adapter that handles the missing LSP commands but otherwise just works as a proxy) to make it work. I've used it with the C# LSP and it seems to also do the job for the Roslyn LSP (just tested findReferences) Trinitek commented Mar 30, 2026 Hi, I have the understanding that the official Claude plugin csharp-ls uses https://github.com/razzmatazz/csharp-language-server . What is the difference between these two since I understand that project also uses Roslyn as its backend? nicholasptran commented May 8, 2026 Hi, I have the understanding that the official Claude plugin csharp-ls uses https://github.com/razzmatazz/csharp-language-server . What is the difference between these two since I understand that project also uses Roslyn as its backend? this one is the official lsp. it works for me with .net framework47 but csharp-ls didn't unsafePtr commented May 25, 2026 • edited Loading Uh oh! There was an error while loading. Please reload this page . There was an error while loading. Please reload this page . There was an error while loading. Please reload this page . Worked for me using the official roslyn-language-server https://github.com/unsafePtr/ClaudeCodeRoslynLspProxy marcel-jackow commented Jun 3, 2026 Recommendations from step 5 of the instructions do not work on Windows. At least for me on Windows 11. It has to be a regular Windows path (starting with a drive letter and using backslashes), so for example c:\\Users\\{username}\\.dotnet\\tools\\roslyn-language-server.cmd (backslash needs to be escaped in JSON by the second backslash). Everything works with such paths. Thank you for the guide. nicholasptran commented Jun 3, 2026 via email aetos382 commented Jun 18, 2026 If you install dotnet/skills/dotnet , the Roslyn LSP is included out of the box; there is no longer any need to create a plugin yourself. Phlow2001 commented Jun 20, 2026 If you install dotnet/skills/dotnet , the Roslyn LSP is included out of the box; there is no longer any need to create a plugin yourself. I did not work for me. There's an issue with it that's waiting to be fixed: dotnet/skills#598 I used @unsafePtr 's proxy with a local repo wrapper to pass the correct .sln. nicholasptran commented Jul 23, 2026 If you install dotnet/skills/dotnet , the Roslyn LSP is included out of the box; there is no longer any need to create a plugin yourself. I did not work for me. There's an issue with it that's waiting to be fixed: dotnet/skills#598 I used @unsafePtr 's proxy with a local repo wrapper to pass the correct .sln.
📥 下载地址(文章结尾)
软件神器安装一切软件。