Skip to content

Update lsp.config to invoke roslyn-language-server directly#607

Open
JoeRobich wants to merge 4 commits into
dotnet:mainfrom
JoeRobich:install-roslyn-lsp-prereq
Open

Update lsp.config to invoke roslyn-language-server directly#607
JoeRobich wants to merge 4 commits into
dotnet:mainfrom
JoeRobich:install-roslyn-lsp-prereq

Conversation

@JoeRobich
Copy link
Copy Markdown
Member

Due to the behavior of dotnet SDK resolution when running in repos which use a global.json, we are not gaurenteed that the choosen SDK will be new enough to support the dotnet dnx command which we were using to install and run the roslyn-language-server. Instead, we make having roslyn-language-server installed a prerequisite so that we can invoke it directly.

Due to the behavior of dotnet SDK resolution when running in repos which use a global.json, we are not gaurenteed that the choosen SDK will be new enough to support the `dotnet dnx` command, which we were using to install and run the roslyn-language-server. Instead, we make having roslyn-language-server installed a prerequisite so that we can invoke it directly.
Copilot AI review requested due to automatic review settings May 4, 2026 17:50
@JoeRobich JoeRobich requested review from a team, dbreshears and timheuer as code owners May 4, 2026 17:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR changes the .NET plugin to launch Roslyn's language server as a preinstalled executable instead of using dotnet dnx, to avoid SDK-resolution problems in repositories that pin older SDKs with global.json.

Changes:

  • Replaces the C# LSP launch command in plugins/dotnet/lsp.json with direct roslyn-language-server execution.
  • Updates the plugin README to make global installation of roslyn-language-server a prerequisite.
  • Documents a new setup flow based on installing the Roslyn language server tool globally.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
plugins/dotnet/lsp.json Switches the C# LSP server command from dotnet dnx to direct roslyn-language-server execution.
plugins/dotnet/README.md Updates setup instructions and prerequisites to match the new Roslyn server launch model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/dotnet/README.md Outdated
Comment thread plugins/dotnet/README.md Outdated
Comment thread plugins/dotnet/README.md Outdated
Comment thread plugins/dotnet/README.md Outdated
Copilot AI review requested due to automatic review settings May 4, 2026 18:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/dotnet/lsp.json
Copy link
Copy Markdown
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this is the best we can do without dotnet/sdk#51085


if ($currentVersion -ne $latestVersion) {
Write-Host "[$ToolName] Updating from $currentVersion to $latestVersion..."
dotnet tool update --global --prerelease $ToolName --add-source $NuGetSource
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently update fails due to the LSP being launched by copilot prior to the hook running. This does not impact the user experience so decided to leave it in. If github/copilot-cli#3112 is addressed, then we get the benefit of auto-updating the LSP.

Comment thread plugins/dotnet/hooks.json
{
"version": 1,
"hooks": {
"sessionStart": [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does this mean we'll always run this at the start of a session, even if the LSP server isn't going to be used?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this gets run at the beginning of every session.


echo "[$TOOL_NAME] Latest available version: $latest_version"

if [[ "$current_version" != "$latest_version" ]]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we're not just shelling out to dotnet tool update no matter what and skipping all our own version checking?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I was trying to be smart. I will update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants