@@ -48,27 +48,22 @@ export abstract class LanguageServerContext extends AbstractWatcher implements I
4848 const helpLabel = this . translator . t ( 'sdk.error.helpLabel' )
4949 const detail = this . errorToString ( error )
5050
51- // 循环显示对话框,直到用户选择操作
52- let result : string | undefined
53- do {
54- result = await vscode . window . showWarningMessage (
55- 'ArkTS Language Server Warning' ,
56- { modal : true , detail } ,
57- choiceSdkPath ,
58- downloadOrChoiceSdkPath ,
59- helpLabel ,
60- )
51+ let result : string | undefined = await vscode . window . showWarningMessage (
52+ 'ArkTS Language Server Warning' ,
53+ { modal : true , detail } ,
54+ choiceSdkPath ,
55+ downloadOrChoiceSdkPath ,
56+ helpLabel ,
57+ )
6158
62- if ( result === helpLabel ) {
63- // 打开帮助文档,但不关闭对话框
64- const helpUrl = vscode . Uri . parse ( 'https://arkcode.dev/arkts/install/#方法一-选择自带在-deveco-studio-中的-sdk-推荐' )
65- await vscode . env . openExternal ( helpUrl )
66- // 继续循环,重新显示对话框
67- result = undefined
68- }
69- } while ( result === undefined )
70-
71- if ( result === choiceSdkPath ) {
59+ if ( result === helpLabel ) {
60+ // 打开帮助文档,但不关闭对话框
61+ const helpUrl = vscode . Uri . parse ( 'https://arkcode.dev/arkts/install/#方法一-选择自带在-deveco-studio-中的-sdk-推荐' )
62+ await vscode . env . openExternal ( helpUrl )
63+ // 继续循环,重新显示对话框
64+ result = undefined
65+ }
66+ else if ( result === choiceSdkPath ) {
7267 const [ sdkPath ] = await vscode . window . showOpenDialog ( {
7368 canSelectFiles : false ,
7469 canSelectFolders : true ,
0 commit comments