Skip to content

Commit 1e08959

Browse files
committed
Add 'Learn more' to miscellaneous files warning.
1 parent aa6bc5f commit 1e08959

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

l10n/bundle.l10n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
"C# configuration has changed. Would you like to reload the window to apply your changes?": "C# configuration has changed. Would you like to reload the window to apply your changes?",
173173
"Nested Code Action": "Nested Code Action",
174174
"Fix All: ": "Fix All: ",
175+
"Learn more": "Learn more",
175176
"The active document is not part of the open workspace. Not all language features will be available.": "The active document is not part of the open workspace. Not all language features will be available.",
176177
"Dismiss": "Dismiss",
177178
"Do not show for this workspace": "Do not show for this workspace",

src/lsptoolshost/languageStatusBar.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { languageServerOptions } from '../shared/options';
1010
import { ServerState } from './serverStateChange';
1111
import { getCSharpDevKit } from '../utils/getCSharpDevKit';
1212
import { RazorLanguage } from '../razor/src/razorLanguage';
13+
import { LearnMoreAboutMiscellaneousFilesCommand } from './miscellaneousFileNotifier';
1314

1415
export function registerLanguageStatusItems(
1516
context: vscode.ExtensionContext,
@@ -91,6 +92,7 @@ class ProjectContextStatus {
9192
'The active document is not part of the open workspace. Not all language features will be available.'
9293
)
9394
: vscode.l10n.t('Active File Context');
95+
item.command = e.context._vs_is_miscellaneous ? LearnMoreAboutMiscellaneousFilesCommand : undefined;
9496
});
9597

9698
// Trigger a refresh, but don't block creation on the refresh completing.

src/lsptoolshost/miscellaneousFileNotifier.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ import { languageServerOptions } from '../shared/options';
1313
const SuppressMiscellaneousFilesToastsOption = 'dotnet.server.suppressMiscellaneousFilesToasts';
1414
const NotifiedDocuments = new Set<string>();
1515

16+
export const LearnMoreAboutMiscellaneousFilesCommand = {
17+
command: 'vscode.open',
18+
title: vscode.l10n.t('Learn more'),
19+
arguments: [
20+
vscode.Uri.parse(
21+
'https://learn.microsoft.com/en-us/visualstudio/ide/reference/miscellaneous-files?view=vs-2022'
22+
),
23+
],
24+
};
25+
1626
export function registerMiscellaneousFileNotifier(
1727
context: vscode.ExtensionContext,
1828
languageServer: RoslynLanguageServer
@@ -50,7 +60,7 @@ export function registerMiscellaneousFileNotifier(
5060
context.workspaceState.update(SuppressMiscellaneousFilesToastsOption, true);
5161
},
5262
};
53-
showWarningMessage(vscode, message, dismissItem, disableWorkspace);
63+
showWarningMessage(vscode, message, dismissItem, disableWorkspace, LearnMoreAboutMiscellaneousFilesCommand);
5464
});
5565
}
5666

0 commit comments

Comments
 (0)