|
6 | 6 | - [Setting Up Local Language Servers](#setting-up-local-language-servers)
|
7 | 7 | - [Roslyn](#roslyn)
|
8 | 8 | - [Razor](#razor)
|
| 9 | + - [Debugging Local Language Servers](#debugging-local-language-servers) |
9 | 10 | - [Configuring Local Language Servers](#configuring-local-language-servers)
|
10 | 11 | - [Finding the `settings.json` file for your workspace](#finding-the-settingsjson-file-for-your-workspace)
|
11 | 12 | - [Configuring Roslyn Language Server](#configuring-roslyn-language-server)
|
12 | 13 | - [Configuring Razor Language Server](#configuring-razor-language-server)
|
13 |
| - - [Debugging Local Language Servers](#debugging-local-language-servers) |
14 | 14 | - [Creating VSIX Packages for the Extension](#creating-vsix-packages-for-the-extension)
|
15 | 15 | - [Updating the `Roslyn` Language Server Version](#updating-the-roslyn-language-server-version)
|
16 | 16 |
|
@@ -76,6 +76,23 @@ The server DLL is typically at `$roslynRepoRoot/artifacts/bin/Microsoft.CodeAnal
|
76 | 76 |
|
77 | 77 | The server DLL is typically at `$razorRepoRoot/artifacts/bin/rzls/Debug/net8.0`.
|
78 | 78 |
|
| 79 | +### Debugging Local Language Servers |
| 80 | + |
| 81 | +Before running the language servers, familiarize yourself with the steps in the [Configuring Local Language Servers](#configuring-local-language-servers) section to configure either the Roslyn or Razor language servers for debugging . |
| 82 | + |
| 83 | +**Note**: You would only need to configure this for the workspace you wish to debug, NOT for the repo root of vscode-csharp repo. |
| 84 | + |
| 85 | +Follow these steps to enable debugging: |
| 86 | + |
| 87 | +1. Press `Ctrl+Shift+D` and then `F5` to launch the extension. This will open a new VS Code instance for `vscode-csharp` repo. |
| 88 | +2. In the new VS Code instance, open the project or solution you want to debug. |
| 89 | +3. Follow instructions in [Configuring Local Language Servers](#configuring-local-language-servers) to find and configure the workspace settings for the language server you want to debug. |
| 90 | +4. Ensure the language server is fully built in Debug mode. |
| 91 | +5. Meanwhile in a Visual Studio instance open the `.sln` solution file for the language server you want to debug. Keep this instance open for use in a later step. |
| 92 | +6. Back on VS Code, press `Ctrl+Shift+P` and select `Reload Window`. This ensures the changes made in step 3 are applied. |
| 93 | +7. After reloading, a window will pop up prompting you to select or open a Visual Studio instance. Now, select the instance you opened in step 5. |
| 94 | +8. The language server will now trigger a breakpoint on `Debugger.Launch()` when it starts. |
| 95 | + |
79 | 96 | ### Configuring Local Language Servers
|
80 | 97 |
|
81 | 98 | This section provides instructions on how to debug locally built Roslyn and Razor language servers. You can do this by either directly editing the `settings.json` file of your workspace or through the VSCode settings interface.
|
@@ -123,21 +140,6 @@ Or, in VSCode settings (`Ctrl+,`):
|
123 | 140 | 3. Enable `razor.languageServer.debug`.
|
124 | 141 | 4. Set `razor.server.trace` to `Debug`. This gives you more detailed log messages in the output window.
|
125 | 142 |
|
126 |
| -### Debugging Local Language Servers |
127 |
| - |
128 |
| -Before running the language servers, ensure you have followed the steps in the [Configuring Local Language Servers](#configuring-local-language-servers) section to configure either the Roslyn or Razor language servers for debugging. |
129 |
| - |
130 |
| -After completing the configuration, follow these steps: |
131 |
| - |
132 |
| -1. Press `Ctrl+Shift+D` and then `F5` to launch the extension. This will open a new VS Code instance for `vscode-csharp` repo. |
133 |
| -2. In the new VS Code instance, open the project or solution you want to debug. |
134 |
| -3. Follow instructions in [Finding the `settings.json` file for your workspace](#finding-the-settingsjson-file-for-your-workspace) to find and set the workspace settings for the language server you want to debug. |
135 |
| -4. Ensure the language server is fully built in Debug mode. |
136 |
| -5. Meanwhile in a Visual Studio instance open the `.sln` solution file for the language server you want to debug. Keep this instance open for use in a later step. |
137 |
| -6. Back on VS Code, press `Ctrl+Shift+P` and select `Reload Window`. This ensures the changes made in step 3 are applied. |
138 |
| -7. After reloading, a window will pop up prompting you to select or open a Visual Studio instance. Now, select the instance you opened in step 5. |
139 |
| -8. The language server will now trigger a breakpoint on `Debugger.Launch()` when it starts. |
140 |
| - |
141 | 143 | ## Creating VSIX Packages for the Extension
|
142 | 144 |
|
143 | 145 | To package this extension, we need to create VSIX Packages. The VSIX packages can be created using the gulp command `gulp vsix:release:package`. This will create all the platform specific VSIXs that you can then install manually in VSCode.
|
|
0 commit comments