From 4afada8138975cd421abca8c83b0a44bb0850628 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 8 Sep 2023 14:58:58 -0700 Subject: [PATCH 1/4] Add tasks for running a new vscode instance with a specific language server Depends on https://github.com/dotnet/vscode-csharp/pull/6316. --- .vscode/tasks.json | 24 +++++++++++++++++++ ...uilding, Debugging, and Testing on Unix.md | 1 + 2 files changed, 25 insertions(+) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index bbbb1c4d21ad7..f486ae86c0410 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -119,6 +119,30 @@ }, "problemMatcher": "$msCompile", "group": "build" + }, + { + "label": "build language server", + "command": "dotnet", + "type": "shell", + "args": [ + "build", + "-c", + "Debug", + "src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Microsoft.CodeAnalysis.LanguageServer.csproj" + ], + "problemMatcher": "$msCompile", + "group": "build" + }, + { + "label": "launch vscode with language server", + "command": "${execPath}", + "type": "process", + "options": { + "env": { + "DOTNET_ROSLYN_LANGUAGE_SERVER": "${workspaceFolder}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/net7.0/Microsoft.CodeAnalysis.LanguageServer.dll" + } + }, + "dependsOn": [ "build language server" ] } ] } diff --git a/docs/contributing/Building, Debugging, and Testing on Unix.md b/docs/contributing/Building, Debugging, and Testing on Unix.md index c908a48594f6c..3b126b2d467fa 100644 --- a/docs/contributing/Building, Debugging, and Testing on Unix.md +++ b/docs/contributing/Building, Debugging, and Testing on Unix.md @@ -15,6 +15,7 @@ Particularly for developers who aren't experienced with .NET Core development on 2. Install the latest [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0). 3. You can build from VS Code by running the *Run Build Task* command, then selecting an appropriate task such as *build* or *build current project* (the latter builds the containing project for the current file you're viewing in the editor). 4. You can run tests from VS Code by opening a test class in the editor, then using the *Run Tests in Context* and *Debug Tests in Context* editor commands. You may want to bind these commands to keyboard shortcuts that match their Visual Studio equivalents (**Ctrl+R, T** for *Run Tests in Context* and **Ctrl+R, Ctrl+T** for *Debug Tests in Context*). +5. You can launch a new VS Code instance with the language server from your current code by running the "launch vscode with language server" task. ## Running Tests The unit tests can be executed by running `./build.sh --test`. From 7ccd2a4cba17d921e8d3c7b34f7155a9985edbb3 Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Fri, 3 May 2024 14:07:51 -0700 Subject: [PATCH 2/4] Update .vscode/tasks.json --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f486ae86c0410..a8f3595cc4b1b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -139,7 +139,7 @@ "type": "process", "options": { "env": { - "DOTNET_ROSLYN_LANGUAGE_SERVER": "${workspaceFolder}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/net7.0/Microsoft.CodeAnalysis.LanguageServer.dll" + "DOTNET_ROSLYN_LANGUAGE_SERVER": "${workspaceFolder}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll" } }, "dependsOn": [ "build language server" ] From 4300528c10c5f94b12111547ee4096bd4a8037ed Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Fri, 3 May 2024 14:09:30 -0700 Subject: [PATCH 3/4] Update .vscode/tasks.json --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a8f3595cc4b1b..e8474027919f0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -139,7 +139,7 @@ "type": "process", "options": { "env": { - "DOTNET_ROSLYN_LANGUAGE_SERVER": "${workspaceFolder}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll" + "DOTNET_ROSLYN_LANGUAGE_SERVER": "${workspaceRoot}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll" } }, "dependsOn": [ "build language server" ] From a1b5ace9c02c29b40997bf871a5d3ca0c0e68361 Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Fri, 3 May 2024 15:11:04 -0700 Subject: [PATCH 4/4] Update .vscode/tasks.json --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e8474027919f0..4c0ff94a92dcb 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -139,7 +139,7 @@ "type": "process", "options": { "env": { - "DOTNET_ROSLYN_LANGUAGE_SERVER": "${workspaceRoot}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll" + "DOTNET_ROSLYN_SERVER_PATH": "${workspaceRoot}/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net8.0/Microsoft.CodeAnalysis.LanguageServer.dll" } }, "dependsOn": [ "build language server" ]