@@ -21,6 +21,8 @@ import CompositeDisposable from '../compositeDisposable';
21
21
import { BaseVsDbgConfigurationProvider } from '../shared/configurationProvider' ;
22
22
import { omnisharpOptions } from '../shared/options' ;
23
23
import { ActionOption , showErrorMessage } from '../shared/observers/utils/showMessage' ;
24
+ import { getCSharpDevKit } from '../utils/getCSharpDevKit' ;
25
+ import { Command } from 'vscode-languageserver-types' ;
24
26
25
27
export async function activate (
26
28
thisExtension : vscode . Extension < any > ,
@@ -222,12 +224,18 @@ function showInstallErrorMessage(eventStream: EventStream) {
222
224
function showDotnetToolsWarning ( message : string ) : void {
223
225
const config = vscode . workspace . getConfiguration ( 'csharp' ) ;
224
226
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
+ } ;
231
239
const goToSettingsMessage : ActionOption = {
232
240
title : vscode . l10n . t ( 'Disable message in settings' ) ,
233
241
action : async ( ) => {
0 commit comments