From 11799bc2e2ca7e0ae931f75ba21ab8c4978a50f1 Mon Sep 17 00:00:00 2001 From: dibarbet Date: Fri, 25 Oct 2024 23:17:37 +0000 Subject: [PATCH 01/16] Update main version --- CHANGELOG.md | 2 ++ version.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d8713336..2fb9f49b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ - Diagnostics related feature requests and improvements [#5951](https://github.com/dotnet/vscode-csharp/issues/5951) - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) +# 2.55.x + # 2.54.x * Update debugger packages to v2.54.0 (PR: [#7691](https://github.com/dotnet/vscode-csharp/pull/7691)) * Only show misc files warning toast after delay. (PR: [#7689](https://github.com/dotnet/vscode-csharp/pull/7689)) diff --git a/version.json b/version.json index a0d2dfb02..4aeb56e77 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "2.54", + "version": "2.55", "publicReleaseRefSpec": [ "^refs/heads/release$", "^refs/heads/prerelease$", From f0b9dbf0826ac5214f298e5e8ebe0669ec75e8a6 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Mon, 30 Sep 2024 18:45:16 -0700 Subject: [PATCH 02/16] Use new LogOutputChannel for improved logging experience --- .vscode/launch.json | 12 +- SUPPORT.md | 24 +++- docs/csharp_trace.png | Bin 0 -> 10380 bytes docs/trace_logs.png | Bin 12897 -> 0 bytes package-lock.json | 19 +-- package.json | 19 +-- package.nls.cs.json | 1 - package.nls.de.json | 1 - package.nls.es.json | 1 - package.nls.fr.json | 1 - package.nls.it.json | 1 - package.nls.ja.json | 1 - package.nls.json | 1 - package.nls.ko.json | 1 - package.nls.pl.json | 1 - package.nls.pt-br.json | 1 - package.nls.ru.json | 1 - package.nls.tr.json | 1 - package.nls.zh-cn.json | 1 - package.nls.zh-tw.json | 1 - src/lsptoolshost/commands.ts | 8 +- src/lsptoolshost/copilot.ts | 25 +--- src/lsptoolshost/debugger.ts | 2 +- src/lsptoolshost/fixAllCodeAction.ts | 8 +- src/lsptoolshost/nestedCodeAction.ts | 8 +- src/lsptoolshost/restore.ts | 12 +- src/lsptoolshost/roslynLanguageServer.ts | 133 ++++++++++-------- ...slynWorkspaceDebugConfigurationProvider.ts | 4 +- src/lsptoolshost/unitTesting.ts | 12 +- src/main.ts | 8 +- src/shared/options.ts | 5 - src/shared/reportIssue.ts | 4 +- .../devkit_slnWithCsproj.code-workspace | 1 - .../.vscode/slnWithCsproj.code-workspace | 1 - ...languageServerConfigChangeObserver.test.ts | 6 +- ...sp_tools_host_slnWithCsproj.code-workspace | 1 - .../.vscode/BasicRazorApp2_1.code-workspace | 1 - test/vscodeLauncher.ts | 2 +- 38 files changed, 158 insertions(+), 171 deletions(-) create mode 100644 docs/csharp_trace.png delete mode 100644 docs/trace_logs.png diff --git a/.vscode/launch.json b/.vscode/launch.json index 377cb83ac..d88a00df5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -24,7 +24,9 @@ "csharp-test-profile", "${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace", "--extensionDevelopmentPath=${workspaceRoot}", - "--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests" + "--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests", + "--log", + "ms-dotnettools.csharp:trace" ], "env": { "CODE_EXTENSIONS_PATH": "${workspaceRoot}", @@ -49,7 +51,9 @@ "csharp-test-profile", "${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace", "--extensionDevelopmentPath=${workspaceRoot}", - "--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests" + "--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests", + "--log", + "ms-dotnettools.csharp:trace" ], "env": { "CODE_EXTENSIONS_PATH": "${workspaceRoot}", @@ -74,7 +78,9 @@ "csharp-test-profile", "${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace", "--extensionDevelopmentPath=${workspaceRoot}", - "--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests" + "--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests", + "--log", + "ms-dotnettools.csharp:trace" ], "env": { "CODE_EXTENSIONS_PATH": "${workspaceRoot}", diff --git a/SUPPORT.md b/SUPPORT.md index 6a60ce364..291b9e650 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -19,15 +19,25 @@ We highly recommend using the C# extension's built-in command, `CSharp: Report a The template has a section to include the `C#` output window logs. These logs are not automatically included as they may contain personal information (such as full file paths and project names), but they are key to resolving problems. -1. First, set `dotnet.server.trace` to `Trace` in VSCode settings - ![settings window showing trace option](./docs/trace_logs.png) -2. Reload the window via the `Developer: Reload Window` (`workbench.action.reloadWindow`) command +1. Find the `C#` output window (`View` -> `Output`) and set the log level to `Trace` + ![c# output window showing trace option](./docs/csharp_trace.png) +2. Reproduce the issue +3. In the `C#` output window, select all (e.g. `cntrl+a`) and copy paste into the issue template under the 'C# Log' section. If you need to redact file paths and other information, please do so at this time. +4. Once the logs are collected, reset the window log level to `Info` + +If the issue only reproduces on extension startup, you can set `Trace` as the default (see screenshot above), reload the window, and trace logs will be captured on startup. + +##### C# LSP Trace Logs +Sometimes we need to know exactly what requests were sent to the Roslyn language server. To capture these logs: + +1. Set the log level to `Trace` for the `C#` output window as described above. +2. Find the `C# LSP Trace Logs` output window 3. Reproduce the issue -4. Open the output window via `View` -> `Output` and change to the `C#` output window. -5. Select all (e.g. cntrl+a) and copy paste into the issue template under the 'C# Log' section. If you need to redact file paths and other information, please do so at this time. -6. Once the logs are collected, reset `dotnet.server.trace` back to `Information` +4. Copy the contents of the `C# LSP Trace Logs` output window. -Oftentimes the C# logs are enough, but sometimes when dealing with LSP server issues, the LSP trace logs are required. These can be found by following the same steps as above, but using the `C# LSP Trace Logs` output window instead. +##### Other ways to set the log level +1. When launching VSCode from the CLI, pass the `--log ms-dotnettools.csharp:trace` parameter. +2. Invoke the `Developer: Set Log Level` command from the VSCode command palette, find the `C#` entry and set the level. #### Project loading problems diff --git a/docs/csharp_trace.png b/docs/csharp_trace.png new file mode 100644 index 0000000000000000000000000000000000000000..215b8185b0589d96bdde5e52f2c69357884d2c9d GIT binary patch literal 10380 zcmdsddpy(q|2LN_I!UDyVs)uhNDfgBQ|W}zl_G~(F2_PE$2Qy4l|u(oi4|rQS_mN) z#)=#la|mf{EoNre%qiRr?c1PAe!V*2^E0rONV_goR26`Hy16>EnkLN;)?)<$rz;I^=Xn zL7^;lh17S6{Qt7cCp;n)6xK$5dlV^wfU61$JGa^&IdtZ#&(v^Os5c|(%gk@XQ@`Co z?(F)5o#AhF_rlTg;*I2!1{?4H=5qKeGkN0hy5>K0mpxpnthMh`LWNL#%i-Ap=@4l{@}5@aUOf(X7_jykabdf>c-J>N)Bz7TiI?2 zBFxiBggSgUU>KPP=^eGKrBEy?{%X2C2$Rrxtv9o$*=V1Ba@-MdtR4X=ZM~VCy!n1h zFJB*)zYrNPc)taU1J4N8RHRIgyiU%ZMp0nIu_!`Y3n?{*yXp97>xiqM0Eq4FCHX$6 zqkf!i1%ymgwx$+{KZznLCnGNB^xj^dO1wWQ)Uka~DoE9jLssw~-!--3PlVjl#@2ctfS3)eLTgJ_)Z`P{haEL4YKx!*fJ~I?hab32&ji}2YSFz zsj?5MAdbakn8+SMs4@M5-hwtpW%$HAwvb$s?G1qp;9a6?pWzlh@Y3l$W!6F7%5fh(?+1`8w4*ZC^1wv%c`OjQoFs|>unpEXdNrmAIOepK*O z(u07dCeVw5g>QP4HY9dFu<(2I`eNU1kBaDGtyc-Jp07QKSjjFcl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ew;f!KNBpkcGPfE5U`0Dmm91k;U2{Rk!hl z)OgbT*N!^Cd_7L&TAUulMOTlr4!!PUHl@^UXkyr?U_FpsFN!E?Qf{a4GoUT!F{nBh z-BK^?Vpk0+Vxd7Pom;J?epTmnfR=kN*1^ z_r*5NEn3*@X``cuaK(ai86_l~J7x9+*Y7Mexd&Ej5VsP9eVQGT^%~ z-e02GHTvH_p#ATt)IV6mcOm6lGe!wU9jfy4fbSbO@{o}kQWB-2GahNFwdj`Jso>?* z!n5wRc50E9=oD*s~9$_Y>7HDJN9-(RTyYxWk|=5Ppjt~gu;Fn-2TeHSdg zbftV72(o{clP}Dt)$>0KYV{PJ^o|>hdyl%u#zUBEfbr1A0%jX`nDSW z$;h|>k7N@VHfa#Z^YMI6-yQjp@9K`N@JAaV2WL6Znb?6^%GtTjnEHss82pI#LGmjq zl_{azp?K3~1JycozkPV3SHWT}A=~Cph2jqq9gM#G2!0oY-(}s91f5AdL%$I^f>L?q z_WSkd`*EcV)2?9NLyOp89aPJXed#Oj ztJI1P`4z1dsT|*TS8uF*VoW*ddu27yU_a!Aq7bjq@bwS)IWx*Vr7h9r?OXk<{-FEUDgbMaYosX0pKL7WB0hb0S Ai2wiq literal 0 HcmV?d00001 diff --git a/docs/trace_logs.png b/docs/trace_logs.png deleted file mode 100644 index c1a72d0edf0406a112bcd40f23dcbde3bffa2d05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12897 zcmb`Obx>U0w%~C-AV9Dn!QI_8xVyVUa0$|Qa0u@1+PDO_K=8&jI3#%EG;Y(mx8|Q$ zZ*I-2nN!t$`kcLYZ#(;}wSH^uXf+jCbW|c#7#J9Ic{wQ!7#KJ;=?idsbH=>-~1z? z35xl9->RfC=XIKFZzDK0?$1oKt!nIACS1EuNq$TqmNRBg^vosIEU;!z;BN=}^k*4T zHf7HvtNJH7NKl@1j>DPmXvj(OF9Iv^kOGL}8K(Kdy~{q`WQzYCZ*}$5+DJO>ue;II zgY|srbqT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O6XgB#n(9KK{U{$Jm3JVu~UYwb?6}Fuip6 z<)&r}-id_?`c~;pB0uiS?BuE-ucAJ_^9k?QgnhbO{6w-5HIvm^q{O{6IF5^`;;Pj+ zbpvtIHw;IsXmFCL^wqVA=8|j_6c?%d@KrQjIs$jlX_~@JekFWSY=sz=x7eV`}WI+_p`6Y0kY?5{py+-6QE z-Ie#>!n+n*HylcobuF_fI0QkDAD75Y=zt|*3DD5Vb5^qrYCrK*8o=?|MCjkc4>DFv&pIx$Rwou)yeFeWQAb@|3?*r~#K>ZOdV(2rHHdFq;L_DhJ37 zIposEDN8AQVoValQLhv}VuqW_LIRv{dvo7MTtvx9$;gP7JQ9Tqk0c$hsj9T`9W-{9(*ZPfDE@CFU9yHn=;I}(_%ndDBnHE3Yx(|lYi#9FZ?BKuF$IWX1b1;?s!mW8Z+>rR z$>Ae`2{0Mm3~L)c?9%F5qxbBly4Z`%3Rm%Njb zWmLJrb_Tr$t;-Q-TNR`{&B)6NEWzD`Swal zP!eQNa^POIIqDub3HBvF{XrC#fFe`r6o>z})`blLoWJ4g8{AV;`CLo?gJA#vBDBvk zVaB0~!yJk6ze4J@5=$r2nleuQdL0wOc=+{7=t7|?PB9#g#%*$d_k?Ok)cj-w z`B;|#t57O?`g`ay4@}9XL&;xX3Up#FsyVCtm%qA_-Hgut?{ { const componentName = '[roslyn.client.completionComplexEdit]'; @@ -167,9 +167,9 @@ async function completionComplexEdit( } } -function outputAndThrow(outputChannel: vscode.OutputChannel, message: string): void { +function outputAndThrow(outputChannel: vscode.LogOutputChannel, message: string): void { outputChannel.show(); - outputChannel.appendLine(message); + outputChannel.error(message); throw new Error(message); } diff --git a/src/lsptoolshost/copilot.ts b/src/lsptoolshost/copilot.ts index 65c6519d4..a9c1780f8 100644 --- a/src/lsptoolshost/copilot.ts +++ b/src/lsptoolshost/copilot.ts @@ -9,7 +9,6 @@ import { CopilotRelatedDocumentsReport, CopilotRelatedDocumentsRequest } from '. import { RoslynLanguageServer } from './roslynLanguageServer'; import { UriConverter } from './uriConverter'; import { TextDocumentIdentifier } from 'vscode-languageserver-protocol'; -import { languageServerOptions } from '../shared/options'; interface CopilotTrait { name: string; @@ -29,34 +28,22 @@ interface CopilotRelatedFilesProviderRegistration { ): vscode.Disposable; } -export function registerCopilotExtension(languageServer: RoslynLanguageServer, channel: vscode.OutputChannel) { - const isTraceLogLevel = - languageServerOptions.logLevel && - (languageServerOptions.logLevel === 'Trace' || languageServerOptions.logLevel === 'Debug'); - +export function registerCopilotExtension(languageServer: RoslynLanguageServer, channel: vscode.LogOutputChannel) { const ext = vscode.extensions.getExtension('github.copilot'); if (!ext) { - if (isTraceLogLevel) { - channel.appendLine( - 'GitHub Copilot extension not installed. Skip registeration of C# related files provider.' - ); - } + channel.debug('GitHub Copilot extension not installed. Skip registeration of C# related files provider.'); return; } ext.activate().then(() => { const relatedAPI = ext.exports as CopilotRelatedFilesProviderRegistration | undefined; if (!relatedAPI) { - if (isTraceLogLevel) { - channel.appendLine( - 'Incompatible GitHub Copilot extension installed. Skip registeration of C# related files provider.' - ); - } + channel.debug( + 'Incompatible GitHub Copilot extension installed. Skip registeration of C# related files provider.' + ); return; } - if (isTraceLogLevel) { - channel.appendLine('registration of C# related files provider for GitHub Copilot extension succeeded.'); - } + channel.debug('registration of C# related files provider for GitHub Copilot extension succeeded.'); const id = { extensionId: CSharpExtensionId, diff --git a/src/lsptoolshost/debugger.ts b/src/lsptoolshost/debugger.ts index f9fbcf57d..c7d2a3bc0 100644 --- a/src/lsptoolshost/debugger.ts +++ b/src/lsptoolshost/debugger.ts @@ -20,7 +20,7 @@ export function registerDebugger( languageServer: RoslynLanguageServer, languageServerEvents: RoslynLanguageServerEvents, platformInfo: PlatformInformation, - csharpOutputChannel: vscode.OutputChannel + csharpOutputChannel: vscode.LogOutputChannel ) { const workspaceInformationProvider: IWorkspaceDebugInformationProvider = new RoslynWorkspaceDebugInformationProvider(languageServer, csharpOutputChannel); diff --git a/src/lsptoolshost/fixAllCodeAction.ts b/src/lsptoolshost/fixAllCodeAction.ts index d4a510f94..429b8ad9e 100644 --- a/src/lsptoolshost/fixAllCodeAction.ts +++ b/src/lsptoolshost/fixAllCodeAction.ts @@ -13,7 +13,7 @@ import { UriConverter } from './uriConverter'; export function registerCodeActionFixAllCommands( context: vscode.ExtensionContext, languageServer: RoslynLanguageServer, - outputChannel: vscode.OutputChannel + outputChannel: vscode.LogOutputChannel ) { context.subscriptions.push( vscode.commands.registerCommand( @@ -26,7 +26,7 @@ export function registerCodeActionFixAllCommands( export async function getFixAllResponse( data: RoslynProtocol.CodeActionResolveData, languageServer: RoslynLanguageServer, - outputChannel: vscode.OutputChannel + outputChannel: vscode.LogOutputChannel ) { if (!data.FixAllFlavors) { throw new Error(`FixAllFlavors is missing from data ${JSON.stringify(data)}`); @@ -64,7 +64,7 @@ export async function getFixAllResponse( const componentName = '[roslyn.client.fixAllCodeAction]'; const errorMessage = 'Failed to make a fix all edit for completion.'; outputChannel.show(); - outputChannel.appendLine(`${componentName} ${errorMessage}`); + outputChannel.error(`${componentName} ${errorMessage}`); throw new Error('Tried to insert multiple code action edits, but an error occurred.'); } } @@ -76,7 +76,7 @@ export async function getFixAllResponse( async function registerFixAllResolveCodeAction( languageServer: RoslynLanguageServer, codeActionData: RoslynProtocol.CodeActionResolveData, - outputChannel: vscode.OutputChannel + outputChannel: vscode.LogOutputChannel ) { if (codeActionData) { const data = codeActionData; diff --git a/src/lsptoolshost/nestedCodeAction.ts b/src/lsptoolshost/nestedCodeAction.ts index 39bc22db7..633d6f19c 100644 --- a/src/lsptoolshost/nestedCodeAction.ts +++ b/src/lsptoolshost/nestedCodeAction.ts @@ -13,7 +13,7 @@ import { getFixAllResponse } from './fixAllCodeAction'; export function registerNestedCodeActionCommands( context: vscode.ExtensionContext, languageServer: RoslynLanguageServer, - outputChannel: vscode.OutputChannel + outputChannel: vscode.LogOutputChannel ) { context.subscriptions.push( vscode.commands.registerCommand( @@ -26,7 +26,7 @@ export function registerNestedCodeActionCommands( async function registerNestedResolveCodeAction( languageServer: RoslynLanguageServer, codeActionData: any, - outputChannel: vscode.OutputChannel + outputChannel: vscode.LogOutputChannel ): Promise { if (codeActionData) { const data = codeActionData; @@ -69,7 +69,7 @@ async function registerNestedResolveCodeAction( if (!response.edit) { outputChannel.show(); - outputChannel.appendLine(`Failed to make an edit for completion.`); + outputChannel.error(`Failed to make an edit for completion.`); throw new Error('Tried to retrieve a code action edit, but an error occurred.'); } @@ -81,7 +81,7 @@ async function registerNestedResolveCodeAction( const componentName = '[roslyn.client.nestedCodeAction]'; const errorMessage = 'Failed to make am edit for completion.'; outputChannel.show(); - outputChannel.appendLine(`${componentName} ${errorMessage}`); + outputChannel.error(`${componentName} ${errorMessage}`); throw new Error('Tried to insert code action edit, but an error occurred.'); } } diff --git a/src/lsptoolshost/restore.ts b/src/lsptoolshost/restore.ts index 4ea9f8599..5153becaa 100644 --- a/src/lsptoolshost/restore.ts +++ b/src/lsptoolshost/restore.ts @@ -14,14 +14,16 @@ import { } from './roslynProtocol'; import path = require('path'); import { showErrorMessage } from '../shared/observers/utils/showMessage'; +import { getCSharpDevKit } from '../utils/getCSharpDevKit'; let _restoreInProgress = false; -export function registerRestoreCommands( - context: vscode.ExtensionContext, - languageServer: RoslynLanguageServer, - restoreChannel: vscode.OutputChannel -) { +export function registerRestoreCommands(context: vscode.ExtensionContext, languageServer: RoslynLanguageServer) { + if (getCSharpDevKit()) { + // We do not need to register restore commands if using C# devkit. + return; + } + const restoreChannel = vscode.window.createOutputChannel('.NET NuGet Restore'); context.subscriptions.push( vscode.commands.registerCommand('dotnet.restore.project', async (_request): Promise => { return chooseProjectAndRestore(languageServer, restoreChannel); diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 817321b9d..9e7adf6b2 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -77,7 +77,7 @@ import { import { registerSourceGeneratedFilesContentProvider } from './sourceGeneratedFilesContentProvider'; import { registerMiscellaneousFileNotifier } from './miscellaneousFileNotifier'; -let _channel: vscode.OutputChannel; +let _channel: vscode.LogOutputChannel; let _traceChannel: vscode.OutputChannel; // Flag indicating if C# Devkit was installed the last time we activated. @@ -164,11 +164,25 @@ export class RoslynLanguageServer { // setTrace only works after the client is already running. this._languageClient.onDidChangeState(async (state) => { if (state.newState === State.Running) { - const languageClientTraceLevel = RoslynLanguageServer.GetTraceLevel(languageServerOptions.logLevel); - - await this._languageClient.setTrace(languageClientTraceLevel); + await this.updateLogLevel(); } }); + // Register for changes to the log level. + _channel.onDidChangeLogLevel(async () => { + await this.updateLogLevel(); + }); + } + + private async updateLogLevel(): Promise { + if (this._languageClient.state === State.Running) { + const languageClientTraceLevel = RoslynLanguageServer.GetTraceLevel(_channel.logLevel); + // Update the server's log level. + await this.sendNotification('roslyn/updateLogLevel', { + logLevel: RoslynLanguageServer.GetServerLogLevel(_channel.logLevel), + }); + // Update the trace level that the client uses to log trace messages. + await this._languageClient.setTrace(languageClientTraceLevel); + } } private registerServerStateChanged() { @@ -467,7 +481,7 @@ export class RoslynLanguageServer { } if (!(error instanceof vscode.CancellationError)) { - _channel.appendLine(`Error making ${request} request: ${error.message}`); + _channel.error(`Error making ${request} request`, error); } return error; } @@ -565,7 +579,7 @@ export class RoslynLanguageServer { const dotnetInfo = await hostExecutableResolver.getHostExecutableInfo(); const dotnetExecutablePath = dotnetInfo.path; - _channel.appendLine('Dotnet path: ' + dotnetExecutablePath); + _channel.info('Dotnet path: ' + dotnetExecutablePath); let args: string[] = []; @@ -573,7 +587,10 @@ export class RoslynLanguageServer { args.push('--debug'); } - const logLevel = languageServerOptions.logLevel; + // Get the initial log level from the channel. + // Changes to the channel log level will be picked up by the server after + // LSP finishes initializing and we're able to pick up the new value. + const logLevel = this.GetServerLogLevel(_channel.logLevel); if (logLevel) { args.push('--logLevel', logLevel); } @@ -602,14 +619,14 @@ export class RoslynLanguageServer { csharpDevkitIntelliCodeExtensionId ); if (csharpDevkitIntelliCodeExtension) { - _channel.appendLine('Activating C# + C# Dev Kit + C# IntelliCode...'); + _channel.info('Activating C# + C# Dev Kit + C# IntelliCode...'); const csharpDevkitIntelliCodeArgs = await this.getCSharpDevkitIntelliCodeExportArgs( csharpDevkitIntelliCodeExtension, context ); args = args.concat(csharpDevkitIntelliCodeArgs); } else { - _channel.appendLine('Activating C# + C# Dev Kit...'); + _channel.info('Activating C# + C# Dev Kit...'); } // Set command enablement as soon as we know devkit is available. @@ -621,7 +638,7 @@ export class RoslynLanguageServer { await this.setupDevKitEnvironment(dotnetInfo.env, csharpDevkitExtension); } else { // C# Dev Kit is not installed - continue C#-only activation. - _channel.appendLine('Activating C# standalone...'); + _channel.info('Activating C# standalone...'); // Set command enablement to use roslyn standalone commands. await vscode.commands.executeCommand('setContext', 'dotnet.server.activationContext', 'Roslyn'); @@ -632,11 +649,7 @@ export class RoslynLanguageServer { args.push('--extension', extensionPath); } - const isTraceLogLevel = logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel)); - - if (isTraceLogLevel) { - _channel.appendLine(`Starting server at ${serverPath}`); - } + _channel.debug(`Starting server at ${serverPath}`); // shouldn't this arg only be set if it's running with CSDevKit? args.push('--telemetryLevel', telemetryReporter.telemetryLevel); @@ -647,9 +660,7 @@ export class RoslynLanguageServer { if (!languageServerOptions.useServerGC) { // The server by default uses serverGC, if the user opts out we need to set the environment variable to disable it. env.DOTNET_gcServer = '0'; - if (isTraceLogLevel) { - _channel.appendLine('ServerGC disabled'); - } + _channel.debug('ServerGC disabled'); } let childProcess: cp.ChildProcessWithoutNullStreams; @@ -663,16 +674,12 @@ export class RoslynLanguageServer { // If we were given a path to a dll, launch that via dotnet. const argsWithPath = [serverPath].concat(args); - if (logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel))) { - _channel.appendLine(`Server arguments ${argsWithPath.join(' ')}`); - } + _channel.debug(`Server arguments ${argsWithPath.join(' ')}`); childProcess = cp.spawn(dotnetExecutablePath, argsWithPath, cpOptions); } else { // Otherwise assume we were given a path to an executable. - if (logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel))) { - _channel.appendLine(`Server arguments ${args.join(' ')}`); - } + _channel.debug(`Server arguments ${args.join(' ')}`); childProcess = cp.spawn(serverPath, args, cpOptions); } @@ -680,14 +687,14 @@ export class RoslynLanguageServer { // Record the stdout and stderr streams from the server process. childProcess.stdout.on('data', (data: { toString: (arg0: any) => any }) => { const result: string = isString(data) ? data : data.toString(RoslynLanguageServer.encoding); - _channel.append('[stdout] ' + result); + _channel.info('[stdout] ' + result); }); childProcess.stderr.on('data', (data: { toString: (arg0: any) => any }) => { const result: string = isString(data) ? data : data.toString(RoslynLanguageServer.encoding); - _channel.append('[stderr] ' + result); + _channel.error('[stderr] ' + result); }); childProcess.on('exit', (code) => { - _channel.appendLine(`Language server process exited with ${code}`); + _channel.info(`Language server process exited with ${code}`); }); // Timeout promise used to time out the connection process if it takes too long. @@ -707,14 +714,14 @@ export class RoslynLanguageServer { // The server process will create the named pipe used for communication. Wait for it to be created, // and listen for the server to pass back the connection information via stdout. const namedPipePromise = new Promise((resolve) => { - _channel.appendLine('waiting for named pipe information from server...'); + _channel.debug('waiting for named pipe information from server...'); childProcess.stdout.on('data', (data: { toString: (arg0: any) => any }) => { const result: string = isString(data) ? data : data.toString(RoslynLanguageServer.encoding); // Use the regular expression to find all JSON lines const jsonLines = result.match(RoslynLanguageServer.namedPipeKeyRegex); if (jsonLines) { const transmittedPipeNameInfo: NamedPipeInformation = JSON.parse(jsonLines[0]); - _channel.appendLine('received named pipe information from server'); + _channel.info('received named pipe information from server'); resolve(transmittedPipeNameInfo); } }); @@ -722,9 +729,9 @@ export class RoslynLanguageServer { const socketPromise = namedPipePromise.then(async (pipeConnectionInfo) => { return new Promise((resolve, reject) => { - _channel.appendLine('attempting to connect client to server...'); + _channel.debug('attempting to connect client to server...'); const socket = net.createConnection(pipeConnectionInfo.pipeName, () => { - _channel.appendLine('client has connected to server'); + _channel.info('client has connected to server'); resolve(socket); }); @@ -879,7 +886,7 @@ export class RoslynLanguageServer { if (csharpDevkitExtension && !_wasActivatedWithCSharpDevkit) { // We previously started without C# Dev Kit and its now installed. // Offer a prompt to restart the server to use C# Dev Kit. - _channel.appendLine(`Detected new installation of ${csharpDevkitExtensionId}`); + _channel.info(`Detected new installation of ${csharpDevkitExtensionId}`); const message = `Detected installation of ${csharpDevkitExtensionId}. Would you like to relaunch the language server for added features?`; showInformationMessage(vscode, message, title); } else { @@ -942,10 +949,9 @@ export class RoslynLanguageServer { ]; return csharpIntelliCodeArgs; } catch (e) { - _channel.appendLine(`Activation of ${csharpDevkitIntelliCodeExtensionId} failed`); - _channel.appendLine(e instanceof Error ? e.message : (e as string)); + _channel.error(`Activation of ${csharpDevkitIntelliCodeExtensionId} failed`, e); if (e instanceof Error && e.stack) { - _channel.appendLine(e.stack); + _channel.info(e.stack); } const stateKey = 'disableIntellicodeFailedPopup'; @@ -991,26 +997,44 @@ export class RoslynLanguageServer { await exports.setupTelemetryEnvironmentAsync(env); } - private static GetTraceLevel(logLevel: string): Trace { + /** + * Returns the C# Microsoft.Extensions.Logging.LogLevel enum string value + * corresponding to the given vscode.LogLevel. + */ + private static GetServerLogLevel(logLevel: vscode.LogLevel): string { + switch (logLevel) { + case vscode.LogLevel.Trace: + return 'Trace'; + case vscode.LogLevel.Debug: + return 'Debug'; + case vscode.LogLevel.Info: + return 'Information'; + case vscode.LogLevel.Warning: + return 'Warning'; + case vscode.LogLevel.Error: + return 'Error'; + case vscode.LogLevel.Off: + return 'None'; + default: + throw new Error(`Invalid log level ${logLevel}`); + } + } + + private static GetTraceLevel(logLevel: vscode.LogLevel): Trace { switch (logLevel) { - case 'Trace': + case vscode.LogLevel.Trace: return Trace.Verbose; - case 'Debug': + case vscode.LogLevel.Debug: return Trace.Messages; - case 'Information': + case vscode.LogLevel.Info: return Trace.Off; - case 'Warning': + case vscode.LogLevel.Warning: return Trace.Off; - case 'Error': + case vscode.LogLevel.Error: return Trace.Off; - case 'Critical': - return Trace.Off; - case 'None': + case vscode.LogLevel.Off: return Trace.Off; default: - _channel.appendLine( - `Invalid log level ${logLevel}, server will not start. Please set the 'dotnet.server.trace' configuration to a valid value` - ); throw new Error(`Invalid log level ${logLevel}`); } } @@ -1038,15 +1062,14 @@ export async function activateRoslynLanguageServer( context: vscode.ExtensionContext, platformInfo: PlatformInformation, optionObservable: Observable, - outputChannel: vscode.OutputChannel, - dotnetTestChannel: vscode.OutputChannel, - dotnetChannel: vscode.OutputChannel, + outputChannel: vscode.LogOutputChannel, reporter: TelemetryReporter, languageServerEvents: RoslynLanguageServerEvents ): Promise { // Create a channel for outputting general logs from the language server. _channel = outputChannel; // Create a separate channel for outputting trace logs - these are incredibly verbose and make other logs very difficult to see. + // The trace channel verbosity is controlled by the _channel verbosity. _traceChannel = vscode.window.createOutputChannel('C# LSP Trace Logs'); const hostExecutableResolver = new DotnetRuntimeExtensionResolver( @@ -1077,12 +1100,12 @@ export async function activateRoslynLanguageServer( registerRazorCommands(context, languageServer); - registerUnitTestingCommands(context, languageServer, dotnetTestChannel); + registerUnitTestingCommands(context, languageServer); // Register any needed debugger components that need to communicate with the language server. registerDebugger(context, languageServer, languageServerEvents, platformInfo, _channel); - registerRestoreCommands(context, languageServer, dotnetChannel); + registerRestoreCommands(context, languageServer); registerSourceGeneratedFilesContentProvider(context, languageServer); @@ -1094,19 +1117,19 @@ export async function activateRoslynLanguageServer( const extensionsFromPackageJson = vscode.extensions.all.flatMap((extension) => { let loadPaths = extension.packageJSON.contributes?.['csharpExtensionLoadPaths']; if (loadPaths === undefined || loadPaths === null) { - _traceChannel.appendLine(`Extension ${extension.id} does not contribute csharpExtensionLoadPaths`); + _channel.debug(`Extension ${extension.id} does not contribute csharpExtensionLoadPaths`); return []; } if (!Array.isArray(loadPaths) || loadPaths.some((loadPath) => typeof loadPath !== 'string')) { - _channel.appendLine( + _channel.warn( `Extension ${extension.id} has invalid csharpExtensionLoadPaths. Expected string array, found ${loadPaths}` ); return []; } loadPaths = loadPaths.map((loadPath) => path.join(extension.extensionPath, loadPath)); - _traceChannel.appendLine(`Extension ${extension.id} contributes csharpExtensionLoadPaths: ${loadPaths}`); + _channel.trace(`Extension ${extension.id} contributes csharpExtensionLoadPaths: ${loadPaths}`); return loadPaths; }); const extensionsFromOptions = languageServerOptions.extensionsPaths ?? []; diff --git a/src/lsptoolshost/roslynWorkspaceDebugConfigurationProvider.ts b/src/lsptoolshost/roslynWorkspaceDebugConfigurationProvider.ts index 9e820c656..2b5666c83 100644 --- a/src/lsptoolshost/roslynWorkspaceDebugConfigurationProvider.ts +++ b/src/lsptoolshost/roslynWorkspaceDebugConfigurationProvider.ts @@ -19,7 +19,7 @@ import { import { UriConverter } from './uriConverter'; export class RoslynWorkspaceDebugInformationProvider implements IWorkspaceDebugInformationProvider { - constructor(private server: RoslynLanguageServer, private outputChannel: vscode.OutputChannel) {} + constructor(private server: RoslynLanguageServer, private outputChannel: vscode.LogOutputChannel) {} public async getWorkspaceDebugInformation( workspaceFolder: vscode.Uri @@ -43,7 +43,7 @@ export class RoslynWorkspaceDebugInformationProvider implements IWorkspaceDebugI // Server errors are already logged by the language client, but its totally possible // that we fail because the server is restarting or a process got killed, etc. // Catch the error and log to the correct output (instead of going to the extension host output). - this.outputChannel.appendLine(`Failed to get debug configuration: ${e}`); + this.outputChannel.error(`Failed to get debug configuration`, e); return; } diff --git a/src/lsptoolshost/unitTesting.ts b/src/lsptoolshost/unitTesting.ts index 27da8f892..956be85fc 100644 --- a/src/lsptoolshost/unitTesting.ts +++ b/src/lsptoolshost/unitTesting.ts @@ -12,12 +12,14 @@ import { RunTestsParams, RunTestsPartialResult, RunTestsRequest, TestProgress } import { commonOptions } from '../shared/options'; import { UriConverter } from './uriConverter'; import { showErrorMessage } from '../shared/observers/utils/showMessage'; +import { getCSharpDevKit } from '../utils/getCSharpDevKit'; -export function registerUnitTestingCommands( - context: vscode.ExtensionContext, - languageServer: RoslynLanguageServer, - dotnetTestChannel: vscode.OutputChannel -) { +export function registerUnitTestingCommands(context: vscode.ExtensionContext, languageServer: RoslynLanguageServer) { + if (getCSharpDevKit()) { + // If using C# devkit, we don't need to register any test commands. + return; + } + const dotnetTestChannel = vscode.window.createOutputChannel('.NET Test Log'); context.subscriptions.push( vscode.commands.registerCommand( 'dotnet.test.run', diff --git a/src/main.ts b/src/main.ts index 3e560dc32..1f7eaa7f8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -65,9 +65,7 @@ export async function activate( // ensure it gets properly disposed. Upon disposal the events will be flushed. context.subscriptions.push(reporter); - const dotnetTestChannel = vscode.window.createOutputChannel('.NET Test Log'); - const dotnetChannel = vscode.window.createOutputChannel('.NET NuGet Restore'); - const csharpChannel = vscode.window.createOutputChannel('C#'); + const csharpChannel = vscode.window.createOutputChannel('C#', { log: true }); const csharpchannelObserver = new CsharpChannelObserver(csharpChannel); const csharpLogObserver = new CsharpLoggerObserver(csharpChannel); eventStream.subscribe(csharpchannelObserver.post); @@ -141,13 +139,13 @@ export async function activate( platformInfo, optionStream, csharpChannel, - dotnetTestChannel, - dotnetChannel, reporter, roslynLanguageServerEvents ); } else { // activate language services + const dotnetTestChannel = vscode.window.createOutputChannel('.NET Test Log'); + const dotnetChannel = vscode.window.createOutputChannel('.NET NuGet Restore'); omnisharpLangServicePromise = activateOmniSharpLanguageServer( context, platformInfo, diff --git a/src/shared/options.ts b/src/shared/options.ts index 469c01124..3ed6a19f5 100644 --- a/src/shared/options.ts +++ b/src/shared/options.ts @@ -69,7 +69,6 @@ export interface OmnisharpServerOptions { } export interface LanguageServerOptions { - readonly logLevel: string; readonly documentSelector: DocumentSelector; readonly extensionsPaths: string[] | null; readonly preferCSharpExtension: boolean; @@ -379,9 +378,6 @@ class OmnisharpOptionsImpl implements OmnisharpServerOptions { } class LanguageServerOptionsImpl implements LanguageServerOptions { - public get logLevel() { - return readOption('dotnet.server.trace', 'Information'); - } public get documentSelector() { return readOption('dotnet.server.documentSelector', ['csharp']); } @@ -511,7 +507,6 @@ export const OmnisharpOptionsThatTriggerReload: ReadonlyArray = [ - 'logLevel', 'documentSelector', 'preferCSharpExtension', 'componentPaths', diff --git a/src/shared/reportIssue.ts b/src/shared/reportIssue.ts index 16345aaf5..a818423b1 100644 --- a/src/shared/reportIssue.ts +++ b/src/shared/reportIssue.ts @@ -125,14 +125,14 @@ function getLogInfo(useOmnisharp: boolean): string { return ` ### C# log ###
Post the output from Output-->C# here
### C# LSP Trace Logs ### -
Post the output from Output-->C# LSP Trace Logs here. Requires \`dotnet.server.trace\` to be set to \`Trace\`
`; +
Post the output from Output-->C# LSP Trace Logs here. Requires the \`C#\` output window log level to be set to \`Trace\`
`; } } diff --git a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace index cb1af05bd..e045c4670 100644 --- a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace +++ b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace @@ -6,7 +6,6 @@ ], "settings": { "dotnet.defaultSolution": "b_SecondInOrder_SlnFile.sln", - "dotnet.server.trace": "Trace", "dotnet.server.useOmnisharp": false, "dotnet.preferCSharpExtension": false, } diff --git a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace index 6da609d8b..06c4a6bea 100644 --- a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace +++ b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace @@ -6,7 +6,6 @@ ], "settings": { "dotnet.defaultSolution": "b_SecondInOrder_SlnFile.sln", - "dotnet.server.trace": "Trace", "dotnet.server.useOmnisharp": false, "dotnet.preferCSharpExtension": true, } diff --git a/test/lsptoolshost/unitTests/languageServerConfigChangeObserver.test.ts b/test/lsptoolshost/unitTests/languageServerConfigChangeObserver.test.ts index 6b8ef6750..e8bf2928d 100644 --- a/test/lsptoolshost/unitTests/languageServerConfigChangeObserver.test.ts +++ b/test/lsptoolshost/unitTests/languageServerConfigChangeObserver.test.ts @@ -35,7 +35,6 @@ describe('Option changes observer', () => { [ { config: 'dotnet', section: 'server.documentSelector', value: ['other'] }, - { config: 'dotnet', section: 'server.trace', value: 'trace' }, { config: 'dotnet', section: 'preferCSharpExtension', value: true }, ].forEach((elem) => { describe(`When the ${elem.config}.${elem.section} changes`, () => { @@ -99,10 +98,7 @@ describe('Option changes observer', () => { }); }); - [ - { config: 'dotnet', section: 'server.documentSelector', value: ['csharp'] }, - { config: 'dotnet', section: 'server.trace', value: 'Information' }, - ].forEach((elem) => { + [{ config: 'dotnet', section: 'server.documentSelector', value: ['csharp'] }].forEach((elem) => { test(`Information Message is not shown if no change in value for ${elem.config}.${elem.section}`, async () => { expect(infoMessage).toBe(undefined); expect(invokedCommand).toBe(undefined); diff --git a/test/omnisharp/omnisharpIntegrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace b/test/omnisharp/omnisharpIntegrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace index 46ef8b6ed..767f2bb63 100644 --- a/test/omnisharp/omnisharpIntegrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace +++ b/test/omnisharp/omnisharpIntegrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace @@ -6,7 +6,6 @@ ], "settings": { "dotnet.defaultSolution": "b_SecondInOrder_SlnFile.sln", - "dotnet.server.trace": "Trace", "dotnet.server.useOmnisharp": false, "omnisharp.enableLspDriver": false, "dotnet.preferCSharpExtension": true, diff --git a/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/BasicRazorApp2_1.code-workspace b/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/BasicRazorApp2_1.code-workspace index 805d62e7e..7df1142a2 100644 --- a/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/BasicRazorApp2_1.code-workspace +++ b/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/BasicRazorApp2_1.code-workspace @@ -6,7 +6,6 @@ ], "settings": { "dotnet.defaultSolution": "BasicRazorApp2_1.sln", - "dotnet.server.trace": "Trace", "dotnet.server.useOmnisharp": false, "omnisharp.enableLspDriver": false, "razor.server.trace": "Trace", diff --git a/test/vscodeLauncher.ts b/test/vscodeLauncher.ts index 13e6798aa..76a63d031 100644 --- a/test/vscodeLauncher.ts +++ b/test/vscodeLauncher.ts @@ -54,7 +54,7 @@ export async function prepareVSCodeAndExecuteTests( extensionDevelopmentPath: extensionDevelopmentPath, extensionTestsPath: extensionTestsPath, // Launch with info logging as anything else is way too verbose and will hide test results. - launchArgs: [workspacePath, '-n', '--log', 'info', '--user-data-dir', userDataDir], + launchArgs: [workspacePath, '-n', '--user-data-dir', userDataDir, '--log', 'ms-dotnettools.csharp:trace'], extensionTestsEnv: env, }); From 05d941672dd4fe4c9ef3bd5e43d579e013fe0ae7 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Mon, 28 Oct 2024 16:48:18 -0700 Subject: [PATCH 03/16] Update to version of roslyn with dynamic log change --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb9f49b0..e502f8e98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) # 2.55.x +* Switch to new log output window API and remove `dotnet.server.trace` (PR: [#7688](https://github.com/dotnet/vscode-csharp/pull/7688)) +* Update Roslyn to 4.13.0-1.24528.3 (PR: [#7688](https://github.com/dotnet/vscode-csharp/pull/7688)) + * Fix crash when 'add await' analyzers binding expressions (PR: [#75644](https://github.com/dotnet/roslyn/pull/75644)) + * Shorten names shown in 'pull member up' (PR: [#75643](https://github.com/dotnet/roslyn/pull/75643)) + * Fix inaccessible constructors shown in sighelp (PR: [#75642](https://github.com/dotnet/roslyn/pull/75642)) + * Allow the client to update the server logging level dynamically (PR: [#75615](https://github.com/dotnet/roslyn/pull/75615)) # 2.54.x * Update debugger packages to v2.54.0 (PR: [#7691](https://github.com/dotnet/vscode-csharp/pull/7691)) diff --git a/package.json b/package.json index 65de09378..88e86d3f4 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ } }, "defaults": { - "roslyn": "4.13.0-1.24525.2", + "roslyn": "4.13.0-1.24528.3", "omniSharp": "1.39.11", "razor": "9.0.0-preview.24524.4", "razorOmnisharp": "7.0.0-preview.23363.1", From a6e8298793efbd2907296b6c24d5eea71e0c0131 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Mon, 28 Oct 2024 17:38:50 -0700 Subject: [PATCH 04/16] Update tests to account for adjusted command enablement --- src/lsptoolshost/commands.ts | 9 ++- .../commandEnablement.integration.test.ts | 32 +++++++--- .../integrationTests/expectedCommands.ts | 63 +++++++++++++++---- .../omnisharpCommands.integration.test.ts | 13 +--- 4 files changed, 83 insertions(+), 34 deletions(-) diff --git a/src/lsptoolshost/commands.ts b/src/lsptoolshost/commands.ts index 8ecb6dff4..5d8d1edf3 100644 --- a/src/lsptoolshost/commands.ts +++ b/src/lsptoolshost/commands.ts @@ -11,6 +11,7 @@ import { createLaunchTargetForSolution } from '../shared/launchTarget'; import reportIssue from '../shared/reportIssue'; import { getDotnetInfo } from '../shared/utils/getDotnetInfo'; import { IHostExecutableResolver } from '../shared/constants/IHostExecutableResolver'; +import { getCSharpDevKit } from '../utils/getCSharpDevKit'; export function registerCommands( context: vscode.ExtensionContext, @@ -38,9 +39,11 @@ export function registerCommands( context.subscriptions.push( vscode.commands.registerCommand('dotnet.restartServer', async () => restartServer(languageServer)) ); - context.subscriptions.push( - vscode.commands.registerCommand('dotnet.openSolution', async () => openSolution(languageServer)) - ); + if (!getCSharpDevKit()) { + context.subscriptions.push( + vscode.commands.registerCommand('dotnet.openSolution', async () => openSolution(languageServer)) + ); + } context.subscriptions.push( vscode.commands.registerCommand('csharp.reportIssue', async () => reportIssue( diff --git a/test/lsptoolshost/integrationTests/commandEnablement.integration.test.ts b/test/lsptoolshost/integrationTests/commandEnablement.integration.test.ts index 167f59aba..c84d995fb 100644 --- a/test/lsptoolshost/integrationTests/commandEnablement.integration.test.ts +++ b/test/lsptoolshost/integrationTests/commandEnablement.integration.test.ts @@ -3,11 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { expect, test, beforeAll, afterAll, describe } from '@jest/globals'; +import { expect, beforeAll, afterAll, describe } from '@jest/globals'; import * as vscode from 'vscode'; -import { activateCSharpExtension } from './integrationHelpers'; +import { activateCSharpExtension, testIfCSharp, testIfDevKit } from './integrationHelpers'; import testAssetWorkspace from './testAssets/testAssetWorkspace'; -import { CommonCommands, OmniSharpCommands, RoslynCommands } from './expectedCommands'; +import { + RoslynDevKitCommands, + RoslynStandaloneCommands, + UnexpectedRoslynDevKitCommands, + UnexpectedRoslynStandaloneCommands, +} from './expectedCommands'; describe(`Command Enablement Tests`, () => { beforeAll(async () => { @@ -18,19 +23,30 @@ describe(`Command Enablement Tests`, () => { await testAssetWorkspace.cleanupWorkspace(); }); - test('Roslyn commands are available', async () => { + testIfCSharp('Roslyn standalone commands are available', async () => { const commands = await vscode.commands.getCommands(true); // Ensure the standalone Roslyn commands are available. - RoslynCommands.forEach((command) => { + RoslynStandaloneCommands.forEach((command) => { expect(commands).toContain(command); }); - CommonCommands.forEach((command) => { + + // Ensure other commands are not available. + UnexpectedRoslynStandaloneCommands.forEach((command) => { + expect(commands).not.toContain(command); + }); + }); + + testIfDevKit('Roslyn + C# Dev Kit commands are available', async () => { + const commands = await vscode.commands.getCommands(true); + + // Ensure the Roslyn + C# Dev Kit commands are available + RoslynDevKitCommands.forEach((command) => { expect(commands).toContain(command); }); - // Ensure O# commands are not available. - OmniSharpCommands.forEach((command) => { + // Ensure other commands are not available. + UnexpectedRoslynDevKitCommands.forEach((command) => { expect(commands).not.toContain(command); }); }); diff --git a/test/lsptoolshost/integrationTests/expectedCommands.ts b/test/lsptoolshost/integrationTests/expectedCommands.ts index f8f0d6b61..26efe1214 100644 --- a/test/lsptoolshost/integrationTests/expectedCommands.ts +++ b/test/lsptoolshost/integrationTests/expectedCommands.ts @@ -3,7 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export const OmniSharpCommands = [ +// Commands used by all activation contexts of the extension. +const CommonCommands = [ + 'dotnet.generateAssets', + 'csharp.listProcess', + 'csharp.listRemoteProcess', + 'csharp.listRemoteDockerProcess', + 'csharp.attachToProcess', + 'csharp.reportIssue', +]; + +// Commands used by both O# and Roslyn standalone activation contexts. +const CommonStandaloneCommands = [ + 'dotnet.restore.project', + 'dotnet.restore.all', + 'dotnet.test.runTestsInContext', + 'dotnet.test.debugTestsInContext', +]; + +// Commands used only in an O# activation context. +const OmniSharpOnlyCommands = [ 'o.restart', 'o.pickProjectAndStart', 'o.fixAll.solution', @@ -13,17 +32,35 @@ export const OmniSharpCommands = [ 'o.reanalyze.currentProject', ]; -export const RoslynCommands = ['dotnet.openSolution', 'dotnet.restartServer']; +// All commands used in the O# activation context. +export const OmniSharpCommands = [...OmniSharpOnlyCommands, ...CommonCommands, ...CommonStandaloneCommands]; -export const CommonCommands = [ - 'dotnet.generateAssets', - 'dotnet.restore.project', - 'dotnet.restore.all', - 'dotnet.test.runTestsInContext', - 'dotnet.test.debugTestsInContext', - 'csharp.listProcess', - 'csharp.listRemoteProcess', - 'csharp.listRemoteDockerProcess', - 'csharp.attachToProcess', - 'csharp.reportIssue', +// Commands used only in a Roslyn activation context. +const RoslynCommonCommands = ['dotnet.restartServer']; + +// Commands used only in a Roslyn standalone activation context. +const RoslynStandaloneOnlyCommands = ['dotnet.openSolution']; + +// All commands used in a Roslyn standalone activation context. +export const RoslynStandaloneCommands = [ + ...CommonCommands, + ...CommonStandaloneCommands, + ...RoslynCommonCommands, + ...RoslynStandaloneOnlyCommands, +]; + +// All commands used in a Roslyn + C# Dev Kit activation context. +export const RoslynDevKitCommands = [...CommonCommands, ...RoslynCommonCommands]; + +// All commands that should not be available in an O# activation context. +export const UnexpectedOmniSharpCommands = [...RoslynStandaloneOnlyCommands, ...RoslynCommonCommands]; + +// All commands that should not be available in a Roslyn standalone activation context. +export const UnexpectedRoslynStandaloneCommands = [...OmniSharpOnlyCommands]; + +// All commands that should not be available in a Roslyn + C# Dev Kit activation context. +export const UnexpectedRoslynDevKitCommands = [ + ...CommonStandaloneCommands, + ...OmniSharpOnlyCommands, + ...RoslynStandaloneOnlyCommands, ]; diff --git a/test/omnisharp/omnisharpIntegrationTests/omnisharpCommands.integration.test.ts b/test/omnisharp/omnisharpIntegrationTests/omnisharpCommands.integration.test.ts index efad59c9a..f3d567ee5 100644 --- a/test/omnisharp/omnisharpIntegrationTests/omnisharpCommands.integration.test.ts +++ b/test/omnisharp/omnisharpIntegrationTests/omnisharpCommands.integration.test.ts @@ -7,11 +7,7 @@ import { expect, test, beforeAll, afterAll, describe } from '@jest/globals'; import * as vscode from 'vscode'; import { activateCSharpExtension } from './integrationHelpers'; import testAssetWorkspace from './testAssets/activeTestAssetWorkspace'; -import { - CommonCommands, - OmniSharpCommands, - RoslynCommands, -} from '../../lsptoolshost/integrationTests/expectedCommands'; +import { OmniSharpCommands, UnexpectedOmniSharpCommands } from '../../lsptoolshost/integrationTests/expectedCommands'; describe(`Command Enablement: ${testAssetWorkspace.description}`, function () { beforeAll(async function () { @@ -31,12 +27,9 @@ describe(`Command Enablement: ${testAssetWorkspace.description}`, function () { OmniSharpCommands.forEach((command) => { expect(commands).toContain(command); }); - CommonCommands.forEach((command) => { - expect(commands).toContain(command); - }); - // Ensure Roslyn standalone commands are not available. - RoslynCommands.forEach((command) => { + // Ensure other commands are not available. + UnexpectedOmniSharpCommands.forEach((command) => { expect(commands).not.toContain(command); }); }); From f679df2975cf8e784c656f8ee9d65c6a702e350f Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Tue, 29 Oct 2024 15:48:49 -0700 Subject: [PATCH 05/16] Move checkDevCert to be Modal This PR converts the checkDevCert method to block the debug session from starting as it waits for user input. --- l10n/bundle.l10n.json | 7 +- src/shared/configurationProvider.ts | 122 +++++++++++++++------------- 2 files changed, 70 insertions(+), 59 deletions(-) diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index 2c1332f49..5032b3955 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -29,13 +29,13 @@ "Can't parse envFile {0} because of {1}": "Can't parse envFile {0} because of {1}", "Open envFile": "Open envFile", "Yes": "Yes", + "More Information": "More Information", + "Security Warning": "Security Warning", + "The selected launch configuration is configured to launch a web browser but no trusted development certificate was found. Create a trusted self-signed certificate?": "The selected launch configuration is configured to launch a web browser but no trusted development certificate was found. Create a trusted self-signed certificate?", "Self-signed certificate sucessfully {0}": "Self-signed certificate sucessfully {0}", "Couldn't create self-signed certificate. {0}\ncode: {1}\nstdout: {2}": "Couldn't create self-signed certificate. {0}\ncode: {1}\nstdout: {2}", "Show Output": "Show Output", "Couldn't create self-signed certificate. See output for more information.": "Couldn't create self-signed certificate. See output for more information.", - "Not Now": "Not Now", - "More Information": "More Information", - "The selected launch configuration is configured to launch a web browser but no trusted development certificate was found. Create a trusted self-signed certificate?": "The selected launch configuration is configured to launch a web browser but no trusted development certificate was found. Create a trusted self-signed certificate?", "No executable projects": "No executable projects", "Select the project to launch": "Select the project to launch", "Invalid project index": "Invalid project index", @@ -50,6 +50,7 @@ "WARNING": "WARNING", "The C# extension was unable to automatically decode projects in the current workspace to create a runnable launch.json file. A template launch.json file has been created as a placeholder.\n\nIf the server is currently unable to load your project, you can attempt to resolve this by restoring any missing project dependencies (example: run 'dotnet restore') and by fixing any reported errors from building the projects in your workspace.\nIf this allows the server to now load your project then --\n * Delete this file\n * Open the Visual Studio Code command palette (View->Command Palette)\n * run the command: '.NET: Generate Assets for Build and Debug'.\n\nIf your project requires a more complex launch configuration, you may wish to delete this configuration and pick a different template using the 'Add Configuration...' button at the bottom of this file.": "The C# extension was unable to automatically decode projects in the current workspace to create a runnable launch.json file. A template launch.json file has been created as a placeholder.\n\nIf the server is currently unable to load your project, you can attempt to resolve this by restoring any missing project dependencies (example: run 'dotnet restore') and by fixing any reported errors from building the projects in your workspace.\nIf this allows the server to now load your project then --\n * Delete this file\n * Open the Visual Studio Code command palette (View->Command Palette)\n * run the command: '.NET: Generate Assets for Build and Debug'.\n\nIf your project requires a more complex launch configuration, you may wish to delete this configuration and pick a different template using the 'Add Configuration...' button at the bottom of this file.", "Failed to parse tasks.json file: {0}": "Failed to parse tasks.json file: {0}", + "Not Now": "Not Now", "Don't Ask Again": "Don't Ask Again", "Required assets to build and debug are missing from '{0}'. Add them?": "Required assets to build and debug are missing from '{0}'. Add them?", "Cancel": "Cancel", diff --git a/src/shared/configurationProvider.ts b/src/shared/configurationProvider.ts index 8c4360ef6..fdd2e773d 100644 --- a/src/shared/configurationProvider.ts +++ b/src/shared/configurationProvider.ts @@ -150,7 +150,9 @@ export class BaseVsDbgConfigurationProvider implements vscode.DebugConfiguration } if (debugConfiguration.checkForDevCert) { - await this.checkForDevCerts(commonOptions.dotnetPath); + if (!(await this.checkForDevCerts(commonOptions.dotnetPath))) { + return undefined; + } } } @@ -233,70 +235,78 @@ export class BaseVsDbgConfigurationProvider implements vscode.DebugConfiguration } } - private async checkForDevCerts(dotnetPath: string) { - await hasDotnetDevCertsHttps(dotnetPath).then(async (returnData) => { + private async checkForDevCerts(dotnetPath: string): Promise { + let result: boolean | undefined = undefined; + + while (result === undefined) { + const returnData = await hasDotnetDevCertsHttps(dotnetPath); const errorCode = returnData.error?.code; if ( errorCode === CertToolStatusCodes.CertificateNotTrusted || errorCode === CertToolStatusCodes.ErrorNoValidCertificateFound ) { - const labelYes: ActionOption = { - title: vscode.l10n.t('Yes'), - action: async () => { - const returnData = await createSelfSignedCert(dotnetPath); - if (returnData.error === null) { - // if the process returns 0, returnData.error is null, otherwise the return code can be accessed in returnData.error.code - const message = - errorCode === CertToolStatusCodes.CertificateNotTrusted ? 'trusted' : 'created'; - showInformationMessage( - vscode, - vscode.l10n.t('Self-signed certificate sucessfully {0}', message) - ); - } else { - this.csharpOutputChannel.appendLine( - vscode.l10n.t( - `Couldn't create self-signed certificate. {0}\ncode: {1}\nstdout: {2}`, - returnData.error.message, - `${returnData.error.code}`, - returnData.stdout - ) - ); - - const labelShowOutput: ActionOption = { - title: vscode.l10n.t('Show Output'), - action: async () => { - this.csharpOutputChannel.show(); - }, - }; - showWarningMessage( - vscode, - vscode.l10n.t( - "Couldn't create self-signed certificate. See output for more information." - ), - labelShowOutput - ); - } - }, - }; - const labelNotNow = vscode.l10n.t('Not Now'); - const labelMoreInfo: ActionOption = { - title: vscode.l10n.t('More Information'), - action: async () => { - const launchjsonDescriptionURL = 'https://aka.ms/VSCode-CS-CheckForDevCert'; - await vscode.env.openExternal(vscode.Uri.parse(launchjsonDescriptionURL)); - await this.checkForDevCerts(dotnetPath); + const labelYes = vscode.l10n.t('Yes'); + const labelMoreInfo = vscode.l10n.t('More Information'); + + const dialogResult = await vscode.window.showWarningMessage( + vscode.l10n.t('Security Warning'), + { + modal: true, + detail: vscode.l10n.t( + 'The selected launch configuration is configured to launch a web browser but no trusted development certificate was found. Create a trusted self-signed certificate?' + ), }, - }; - showInformationMessage( - vscode, - vscode.l10n.t( - 'The selected launch configuration is configured to launch a web browser but no trusted development certificate was found. Create a trusted self-signed certificate?' - ), labelYes, - labelNotNow, labelMoreInfo ); + + if (dialogResult === labelYes) { + const returnData = await createSelfSignedCert(dotnetPath); + if (returnData.error === null) { + // if the process returns 0, returnData.error is null, otherwise the return code can be accessed in returnData.error.code + const message = errorCode === CertToolStatusCodes.CertificateNotTrusted ? 'trusted' : 'created'; + showInformationMessage( + vscode, + vscode.l10n.t('Self-signed certificate sucessfully {0}', message) + ); + + result = true; + } else { + this.csharpOutputChannel.appendLine( + vscode.l10n.t( + `Couldn't create self-signed certificate. {0}\ncode: {1}\nstdout: {2}`, + returnData.error.message, + `${returnData.error.code}`, + returnData.stdout + ) + ); + + const labelShowOutput: ActionOption = { + title: vscode.l10n.t('Show Output'), + action: async () => { + this.csharpOutputChannel.show(); + }, + }; + showWarningMessage( + vscode, + vscode.l10n.t("Couldn't create self-signed certificate. See output for more information."), + labelShowOutput + ); + + result = false; + } + } else if (dialogResult === labelMoreInfo) { + const launchjsonDescriptionURL = 'https://aka.ms/VSCode-CS-CheckForDevCert'; + await vscode.env.openExternal(vscode.Uri.parse(launchjsonDescriptionURL)); + } else if (dialogResult === undefined) { + // User cancelled dialog and wishes to continue debugging. + result = true; + } + } else { + result = true; } - }); + } + + return result; } } From a7673be8cda614142510f0dc73d2833f3dcd1b06 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 30 Oct 2024 12:47:58 +1100 Subject: [PATCH 06/16] Bump Razor and Roslyn --- CHANGELOG.md | 2 ++ package.json | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb9f49b0..c1a9556dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) # 2.55.x +* Update Roslyn to 4.13.0-2.24529.3 (PR: [#???](https://github.com/dotnet/vscode-csharp/pull/???)) +* Update Razor to 9.0.0-preview.24528.3 (PR: [#???](https://github.com/dotnet/vscode-csharp/pull/???)) # 2.54.x * Update debugger packages to v2.54.0 (PR: [#7691](https://github.com/dotnet/vscode-csharp/pull/7691)) diff --git a/package.json b/package.json index 6cf827002..17fc719b0 100644 --- a/package.json +++ b/package.json @@ -37,9 +37,9 @@ } }, "defaults": { - "roslyn": "4.13.0-1.24525.2", + "roslyn": "4.13.0-2.24529.3", "omniSharp": "1.39.11", - "razor": "9.0.0-preview.24524.4", + "razor": "9.0.0-preview.24528.3", "razorOmnisharp": "7.0.0-preview.23363.1", "xamlTools": "17.13.35422.31" }, @@ -5602,4 +5602,4 @@ } } } -} \ No newline at end of file +} From 1f097bee2ae9da6e02c6aa6e0814e9b434949f83 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 30 Oct 2024 12:59:02 +1100 Subject: [PATCH 07/16] Update changelog --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1a9556dd..93a5599ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,11 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) # 2.55.x -* Update Roslyn to 4.13.0-2.24529.3 (PR: [#???](https://github.com/dotnet/vscode-csharp/pull/???)) -* Update Razor to 9.0.0-preview.24528.3 (PR: [#???](https://github.com/dotnet/vscode-csharp/pull/???)) +* Update Roslyn to 4.13.0-2.24529.3 (PR: [#7705](https://github.com/dotnet/vscode-csharp/pull/7705)) +* Update Razor to 9.0.0-preview.24528.3 (PR: [#7705](https://github.com/dotnet/vscode-csharp/pull/7705)) + * Update project configuration from Roslyn info (#11092) (PR: [#11092](https://github.com/dotnet/razor/pull/11092)) + * Reduce the amount of telemetry emitted (#11094) (PR: [#11094](https://github.com/dotnet/razor/pull/11094)) + * Remove tooling MvcShims (#11088) (PR: [#11088](https://github.com/dotnet/razor/pull/11088)) # 2.54.x * Update debugger packages to v2.54.0 (PR: [#7691](https://github.com/dotnet/vscode-csharp/pull/7691)) From 9bfb753654cc6cbebcd51f87458d5ef6074431b0 Mon Sep 17 00:00:00 2001 From: Timothy Miller Date: Wed, 30 Oct 2024 17:26:18 +0900 Subject: [PATCH 08/16] Bump xamlTools to 17.13.35429.30 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6cf827002..c1bb8d9cc 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "omniSharp": "1.39.11", "razor": "9.0.0-preview.24524.4", "razorOmnisharp": "7.0.0-preview.23363.1", - "xamlTools": "17.13.35422.31" + "xamlTools": "17.13.35429.30" }, "main": "./dist/extension", "l10n": "./l10n", From b177d6d768d54da13f8c0df980e153b90fc10e99 Mon Sep 17 00:00:00 2001 From: Timothy Miller Date: Wed, 30 Oct 2024 17:27:49 +0900 Subject: [PATCH 09/16] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb9f49b0..c3ba929d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) # 2.55.x +* Bumped xamlTools to 17.13.35429.30 (PR: [#7706](https://github.com/dotnet/vscode-csharp/pull/7706)) # 2.54.x * Update debugger packages to v2.54.0 (PR: [#7691](https://github.com/dotnet/vscode-csharp/pull/7691)) From 310e3b7dc0851ae5a894f684e5b561b23c7e2481 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Wed, 30 Oct 2024 11:17:22 -0700 Subject: [PATCH 10/16] Temporarily downgrade VSCode version to fix integration tests --- test/vscodeLauncher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vscodeLauncher.ts b/test/vscodeLauncher.ts index 13e6798aa..e52610fc3 100644 --- a/test/vscodeLauncher.ts +++ b/test/vscodeLauncher.ts @@ -15,7 +15,7 @@ export async function prepareVSCodeAndExecuteTests( userDataDir: string, env: NodeJS.ProcessEnv ): Promise { - const vscodeExecutablePath = await downloadAndUnzipVSCode('stable'); + const vscodeExecutablePath = await downloadAndUnzipVSCode('1.94.2'); const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); console.log('Display: ' + env.DISPLAY); From 2f185f7c88453c77ba97980c3e27017653e7db38 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 31 Oct 2024 21:58:54 -0700 Subject: [PATCH 11/16] Localize the 'Select project' string --- l10n/bundle.l10n.json | 1 + src/omnisharp/observers/projectStatusBarObserver.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index 5032b3955..64885d6e5 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -148,6 +148,7 @@ "project.json is no longer a supported project format for .NET Core applications.": "project.json is no longer a supported project format for .NET Core applications.", "More Detail": "More Detail", "Some projects have trouble loading. Please review the output for more details.": "Some projects have trouble loading. Please review the output for more details.", + "Select project": "Select project", "There are unresolved dependencies. Please execute the restore command to continue.": "There are unresolved dependencies. Please execute the restore command to continue.", "Restore": "Restore", "Package {0} download from {1} failed integrity check. Some features may not work as expected. Please restart Visual Studio Code to retrigger the download": "Package {0} download from {1} failed integrity check. Some features may not work as expected. Please restart Visual Studio Code to retrigger the download", diff --git a/src/omnisharp/observers/projectStatusBarObserver.ts b/src/omnisharp/observers/projectStatusBarObserver.ts index b79167daa..419bd4e23 100644 --- a/src/omnisharp/observers/projectStatusBarObserver.ts +++ b/src/omnisharp/observers/projectStatusBarObserver.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; import { basename } from 'path'; import { BaseEvent } from '../../shared/loggingEvents'; import { WorkspaceInformationUpdated } from '../omnisharpLoggingEvents'; @@ -14,7 +15,7 @@ export class ProjectStatusBarObserver extends BaseStatusBarItemObserver { switch (event.type) { case EventType.OmnisharpOnMultipleLaunchTargets: this.SetAndShowStatusBar( - '$(file-submodule) Select project', + '$(file-submodule) ' + vscode.l10n.t('Select project'), 'o.pickProjectAndStart', 'rgb(90, 218, 90)' ); From 1d3c49936a914f04449ab3225ff3557e92419b41 Mon Sep 17 00:00:00 2001 From: Timothy Miller Date: Fri, 1 Nov 2024 18:07:01 +0900 Subject: [PATCH 12/16] Bump xamlTools to 17.13.35431.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25677e3c7..5a1e9e5b3 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "omniSharp": "1.39.11", "razor": "9.0.0-preview.24528.3", "razorOmnisharp": "7.0.0-preview.23363.1", - "xamlTools": "17.13.35429.30" + "xamlTools": "17.13.35431.11" }, "main": "./dist/extension", "l10n": "./l10n", From 6f167e0e5b6318477818598fded3237c9289ac0d Mon Sep 17 00:00:00 2001 From: Timothy Miller Date: Fri, 1 Nov 2024 18:09:08 +0900 Subject: [PATCH 13/16] Include CHANGELOG --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7910c502..1f4388dc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,13 @@ * Shorten names shown in 'pull member up' (PR: [#75643](https://github.com/dotnet/roslyn/pull/75643)) * Fix inaccessible constructors shown in sighelp (PR: [#75642](https://github.com/dotnet/roslyn/pull/75642)) * Allow the client to update the server logging level dynamically (PR: [#75615](https://github.com/dotnet/roslyn/pull/75615)) -* Bumped xamlTools to 17.13.35429.30 (PR: [#7706](https://github.com/dotnet/vscode-csharp/pull/7706)) +* Bumped xamlTools to 17.13.35431.11 (PR: [#7719](https://github.com/dotnet/vscode-csharp/pull/7719)) + * XAML validation improvements + * Validating properties of Setters, Triggers, Conditions. + * Validating text values like ` Red ` + * Warnings for obsolete values like LayoutOptions.CenterAndExpand + * XAML IntelliseSense completions for ResourceDictionary.Source + * XAML IntelliseSense completions for name properties like Setter.TargetName # 2.54.x * Update debugger packages to v2.54.0 (PR: [#7691](https://github.com/dotnet/vscode-csharp/pull/7691)) From 12b1061f7a571edb148192ab3fb5af4323591ac6 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 1 Nov 2024 09:16:40 -0700 Subject: [PATCH 14/16] Update Roslyn version --- CHANGELOG.md | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f4388dc8..62fb94823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,11 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) # 2.55.x -* Update Roslyn to 4.13.0-2.24529.3 (PR: [#7705](https://github.com/dotnet/vscode-csharp/pull/7705)) +* Update Roslyn to 4.13.0-2.24531.3 (PR: [#7722](https://github.com/dotnet/vscode-csharp/pull/7722)) + * Proffer project system query service (PR: [#75682](https://github.com/dotnet/roslyn/pull/75682)) + * Ensure discards are initially soft selected in VSCode (PR: [#75655](https://github.com/dotnet/roslyn/pull/75655)) + * Reduce allocations in VirtualCharService.CreateVirtualCharSequence (PR: [#75654](https://github.com/dotnet/roslyn/pull/75654)) + * Reduce allocations in TextDocumentStates.AddRange (PR: [#75640](https://github.com/dotnet/roslyn/pull/75640)) * Update Razor to 9.0.0-preview.24528.3 (PR: [#7705](https://github.com/dotnet/vscode-csharp/pull/7705)) * Update project configuration from Roslyn info (#11092) (PR: [#11092](https://github.com/dotnet/razor/pull/11092)) * Reduce the amount of telemetry emitted (#11094) (PR: [#11094](https://github.com/dotnet/razor/pull/11094)) diff --git a/package.json b/package.json index 5a1e9e5b3..70e3daae0 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ } }, "defaults": { - "roslyn": "4.13.0-2.24529.3", + "roslyn": "4.13.0-2.24531.3", "omniSharp": "1.39.11", "razor": "9.0.0-preview.24528.3", "razorOmnisharp": "7.0.0-preview.23363.1", From af225e20d241a0a06f3c2b600d35ed4a215c5f89 Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Fri, 1 Nov 2024 12:15:41 -0700 Subject: [PATCH 15/16] Update razor (#7723) Bump razor to 9.0.0-preview.24531.4 SHA 76cd92a65ea7104cc600d03cc50db4ad9438b488 --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f4388dc8..87944ad71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) # 2.55.x +* Update Razor to 9.0.0-preview.24531.4 (PR: [#7723](https://github.com/dotnet/vscode-csharp/pull/7723)) + * Fix aggregate telemetry reliability (PR: [#11134](https://github.com/dotnet/razor/pull/11134)) + * [FUSE] Fix OnAutoInsert and override completion and possible others (PR: [#11122](https://github.com/dotnet/razor/pull/11122)) * Update Roslyn to 4.13.0-2.24529.3 (PR: [#7705](https://github.com/dotnet/vscode-csharp/pull/7705)) * Update Razor to 9.0.0-preview.24528.3 (PR: [#7705](https://github.com/dotnet/vscode-csharp/pull/7705)) * Update project configuration from Roslyn info (#11092) (PR: [#11092](https://github.com/dotnet/razor/pull/11092)) diff --git a/package.json b/package.json index 5a1e9e5b3..ea0ee7482 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "defaults": { "roslyn": "4.13.0-2.24529.3", "omniSharp": "1.39.11", - "razor": "9.0.0-preview.24528.3", + "razor": "9.0.0-preview.24531.4", "razorOmnisharp": "7.0.0-preview.23363.1", "xamlTools": "17.13.35431.11" }, From 1adbb4aecd2adb39bbe9e88c100f1bd7c89caa23 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 1 Nov 2024 14:02:05 -0700 Subject: [PATCH 16/16] Update changelog before release --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a88c1f93..8ba503733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * Report a better error for void components (#11041) (PR: [#11041](https://github.com/dotnet/razor/pull/11041)) * Ensure model directives are mapped at runtime (#11007) (PR: [#11007](https://github.com/dotnet/razor/pull/11007)) * Including @using for Out-of-Scope Razor Component References (#10651) (PR: [#10651](https://github.com/dotnet/razor/pull/10651)) +* Make checkDevCert a modal dialogue (PR: [#7704](https://github.com/dotnet/vscode-csharp/pull/7704)) # 2.53.x * Update Roslyn to 4.13.0-1.24518.1 (PR: [#7670](https://github.com/dotnet/vscode-csharp/pull/7670))