@@ -21,6 +21,8 @@ import CompositeDisposable from '../compositeDisposable';
2121import { BaseVsDbgConfigurationProvider } from '../shared/configurationProvider' ;
2222import { omnisharpOptions } from '../shared/options' ;
2323import { ActionOption , showErrorMessage } from '../shared/observers/utils/showMessage' ;
24+ import { getCSharpDevKit } from '../utils/getCSharpDevKit' ;
25+ import { Command } from 'vscode-languageserver-types' ;
2426
2527export async function activate (
2628 thisExtension : vscode . Extension < any > ,
@@ -222,12 +224,18 @@ function showInstallErrorMessage(eventStream: EventStream) {
222224function 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