Skip to content

Commit 14871df

Browse files
fix: #276 (#277)
* fix: #276 * docs(changeset): fix: #276
1 parent cfab6f6 commit 14871df

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

.changeset/hip-cycles-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vscode-naily-ets": patch
3+
---
4+
5+
fix: #276

ohos-typescript

Submodule ohos-typescript updated from 97b7fd4 to 0b986ad

packages/vscode/src/context/server-context.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)