Skip to content

Commit 2532f72

Browse files
committed
Use the new SDK install experience when available.
1 parent 0e0db7a commit 2532f72

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/coreclrDebug/activate.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import CompositeDisposable from '../compositeDisposable';
2121
import { BaseVsDbgConfigurationProvider } from '../shared/configurationProvider';
2222
import { omnisharpOptions } from '../shared/options';
2323
import { ActionOption, showErrorMessage } from '../shared/observers/utils/showMessage';
24+
import { getCSharpDevKit } from '../utils/getCSharpDevKit';
25+
import { Command } from 'vscode-languageserver-types';
2426

2527
export async function activate(
2628
thisExtension: vscode.Extension<any>,
@@ -222,12 +224,18 @@ function showInstallErrorMessage(eventStream: EventStream) {
222224
function showDotnetToolsWarning(message: string): void {
223225
const config = vscode.workspace.getConfiguration('csharp');
224226
if (!config.get('suppressDotnetInstallWarning', false)) {
225-
const getDotNetMessage: ActionOption = {
226-
title: vscode.l10n.t('Get the SDK'),
227-
action: async () => {
228-
await vscode.env.openExternal(vscode.Uri.parse('https://dot.net/core-sdk-vscode'));
229-
},
230-
};
227+
const getDotNetMessage: ActionOption | Command =
228+
getCSharpDevKit() !== undefined
229+
? {
230+
title: vscode.l10n.t('Get the SDK'),
231+
command: 'csdevkit.installDotnetSdk',
232+
}
233+
: {
234+
title: vscode.l10n.t('Get the SDK'),
235+
action: async () => {
236+
await vscode.env.openExternal(vscode.Uri.parse('https://dot.net/core-sdk-vscode'));
237+
},
238+
};
231239
const goToSettingsMessage: ActionOption = {
232240
title: vscode.l10n.t('Disable message in settings'),
233241
action: async () => {

0 commit comments

Comments
 (0)