Skip to content

Commit 1c80f7a

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents aecaf27 + 9e2363e commit 1c80f7a

File tree

92 files changed

+491
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+491
-436
lines changed

en/ExtensionDocs/Api/windows/showMessageBox.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
# showMessageBox
2-
> `从HBuilderX 2.9.12及以上版本开始支持`
2+
> Supported from HBuilderX 2.9.12+ version
33
4-
在窗口显示可供选择的对话框
4+
Show a dialog box for selection in the window
55

66
#### Parameter
77

88
|Name |Type |Description |
99
|-- |-- |-- |
10-
|options |[MessageBoxOptions](#对话框属性)|对话框内容|
10+
|options |[MessageBoxOptions](#Dialog properties)|Dialog content|
1111

1212
#### Returns
1313

1414
|Type |Description |
1515
|-- |-- |
16-
|Promise<String> |如果设置了按钮,返回用户点击了哪个按钮 |
16+
|Promise<String> |If a button is set, return the button clicked by the user。 |
1717

1818

19-
#### 对话框属性
19+
#### Dialog properties
2020

21-
对话框设置,相关属性
21+
Dialog settings, related attributes
2222

2323
|Attribute name |Type |Description |
2424
|-- |-- |-- |
25-
|type |String |消息类型,取值有['warning','info','error','question'] |
26-
|title |String |对话框标题 |
27-
|text |String |对话框内容 |
28-
|buttons |Array<String>|对话框中的按钮组 |
29-
|defaultButton |String |默认按钮索引,可不填默认0 |
30-
|escapeButton |String |默认Esc后执行的操作按钮索引,可不填默认1 |
25+
|type |String |Message type,Values are['warning','info','error','question'] |
26+
|title |String |Dialog title |
27+
|text |String |Dialog content |
28+
|buttons |Array<String>|Button group in dialog box |
29+
|defaultButton |String |Default button index, can be left blank, default 0 |
30+
|escapeButton |String |The index of the operation button to be executed after the default Esc, can be left blank, the default is 1 |
3131

3232

3333
#### Example
3434

3535
``` javascript
3636
let result = hx.window.showMessageBox({
3737
type: 'error',
38-
title: '测试对话框',
39-
text: '这里是测试对话框内容',
40-
buttons: ['确定', '取消']
38+
title: 'Dialog title',
39+
text: 'Dialog content',
40+
buttons: ['Ok', 'Cancel']
4141
});
4242
result.then((button) => {
43-
if (button == '确定') {
43+
if (button == 'Ok') {
4444

45-
} else if (button == '取消') {
45+
} else if (button == 'Cancel') {
4646

4747
}
4848
});

en/ExtensionDocs/Api/windows/showView.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# showView
22

3-
> `从HBuilderX 2.9.9及以上版本开始支持`
3+
> Supported from HBuilderX 2.9.9+ version
44
5-
切换指定viewId的WebView控件视图。插件创建多个WebView视图并打开后,可以通过该接口切换窗口左侧/右侧视图区域中指定的tab页。该接口不适用于创建
5+
Switch the WebView control view of the specified viewId.
6+
7+
After the plug-in creates multiple WebView views and opens them, you can switch the specified tab page in the left/right view area of the window through this interface.
8+
9+
This interface is not suitable for creating
610

711
#### Parameter
812

913
|Name |Type |Description |
1014
|-- |-- |-- |
11-
|viewInfo |Object | 包含viewId, conTainerId的视图信息 |
15+
|viewInfo |Object | View information including viewId, conTainerId |
1216

1317
#### Example
1418
```Javascript

en/ExtensionDocs/Api/workspace/applyEdit.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# applyEdit
22

3-
根据指定的WorkspaceEdit对象编辑文档。WorkspaceEdit对象内要设定被修改文档的uri和要执行修改的TextEdit操作对象。
3+
create, delete, and rename resources as defined by the given workspace edit.
44

5-
## applyEdit介绍
5+
The uri of the modified document and the TextEdit operation object to be modified should be set in the WorkspaceEdit object.
6+
7+
## Introduce
68

79
**Parameter**
810

911
|Name |Type |Description |
1012
|-- |-- |-- |
11-
|edit |[WorkspaceEdit](#WorkspaceEdit) |文档编辑操作 |
13+
|edit |[WorkspaceEdit](#WorkspaceEdit) |A workspace edit. |
1214

1315
**Returns**
16+
1417
|Type |Description |
1518
|-- |-- |
1619
|Promise<void> |Promise |
@@ -34,16 +37,18 @@
3437

3538
## WorkspaceEdit
3639

37-
WorkspaceEdit: 工作空间的一组编辑操作
40+
A workspace edit is a collection of textual and files changes for multiple resources and documents.
41+
42+
Use the applyEdit-function to apply a workspace edit.
3843

3944
#### set
4045

4146
**Parameter**
4247

4348
|Name |Type |Description |
4449
|-- |-- |-- |
45-
|uri |String或Uri |文档地址 |
46-
|edits |Array<[TextEdit](#TextEdit)> |编辑操作数组 |
50+
|uri |String或Uri |A resource identifier. |
51+
|edits |Array<[TextEdit](#TextEdit)> |An array of text edits. |
4752

4853
**Returns**
4954

@@ -65,37 +70,35 @@ WorkspaceEdit: 工作空间的一组编辑操作
6570

6671
## TextEdit
6772

68-
TextEdit: 文档编辑
69-
7073
#### Attribute list
7174

7275
|Attribute name |Type |Description |
7376
|-- |-- |-- |
74-
|range |[Range](#Range) |要修改的区域 |
75-
|newText|String |要插入的新内容 |
77+
|range |[Range](#Range) |A range. |
78+
|newText|String |A string. |
7679

7780
#### replace **static**
7881

7982
**Parameter**
8083

8184
|Name |Type |Description |
8285
|-- |-- |-- |
83-
|range |[Range](#Range) |要修改的区域 |
84-
|newText |String |要插入的新内容 |
86+
|range |[Range](#Range) |A range. |
87+
|newText |String |A string. |
8588

8689
**Returns**
8790

8891
|Type |Description |
8992
|-- |-- |
90-
|[TextEdit](#TextEdit)| 文档编辑对象|
93+
|[TextEdit](#TextEdit)| A new text edit object.|
9194

9295
## Range
9396

94-
Range: 文本区域
97+
Create a new range from two positions. If start is not before or equal to end, the values will be swapped.
9598

9699
**Attribute list**
97100

98101
|Attribute name |Type |Description |
99102
|-- |-- |-- |
100-
|start |Number |起始位置 |
101-
|end |Number |结束位置 |
103+
|start |Number |A position. |
104+
|end |Number |A position. |

en/ExtensionDocs/Api/workspace/getConfiguration.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,43 @@ Get a workspace configuration object.
88

99
|Name |Type |Description |
1010
|-- |-- |-- |
11-
|section |String |配置项分类名称 |
11+
|section |String |Configuration name |
1212

1313
**Returns**
14+
1415
|Type |Description |
1516
|-- |-- |
16-
|[Configuration](#Configuration)|返回配置 |
17+
|[Configuration](/ExtensionDocs/Api/workspace/onDidChangeConfiguration?id=configurationchangeevent)|The full configuration or a subset. |
1718

1819
**Example**
1920

2021
``` javascript
21-
let config = hx.workspace.getConfiguration()
22-
let fontSize = config.get("editor.fontSize");
23-
//或者也可以这样
24-
let config = hx.workspace.getConfiguration("editor")
25-
let fontSize = config.get("fontSize");
22+
let config = hx.workspace.getConfiguration()
23+
let fontSize = config.get("editor.fontSize");
24+
25+
or
26+
27+
let config = hx.workspace.getConfiguration("editor")
28+
let fontSize = config.get("fontSize");
2629
```
2730

2831

2932
## get
3033

31-
> get: 获取配置项
34+
> get: Get configuration items
3235
3336
**Parameter**
3437

3538
|Name |Type |Description |
3639
|-- |-- |-- |
37-
|section |String |配置项的key|
38-
|defaultValue |Any |默认值,当key不存在时返回该值|
40+
|section |String |Configuration name。|
41+
|defaultValue |Any |A value should be returned when no value could be found, is undefined.|
3942

4043
**Returns**
4144

4245
|Type |Description |
4346
|-- |-- |
44-
|Any |配置项的值 |
47+
|Any |Return a value from this configuration. |
4548

4649
**Example**
4750
``` javascript
@@ -51,14 +54,14 @@ Get a workspace configuration object.
5154

5255
## update
5356

54-
> update: 更新配置项
57+
> update: Update configuration items
5558
5659
**Parameter**
5760

5861
|Name |Type |Description |
5962
|-- |-- |-- |
60-
|section |String |配置项的key|
61-
|value |Any |配置项的值 |
63+
|section |String |Configuration name|
64+
|value |Any |Configuration item value |
6265

6366
**Returns**
6467

@@ -70,6 +73,6 @@ Get a workspace configuration object.
7073
``` javascript
7174
let eslintConfig = hx.workspace.getConfiguration("eslint-js")
7275
eslintConfig.update("validateOnDocumentChanged",true).then(()=>{
73-
console.log("更新配置成功。");
76+
console.log("Successfully updated the configuration.");
7477
});
7578
```

en/ExtensionDocs/Api/workspace/getWorkspaceFolder.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,30 @@ Get the project where a file is located.
77
#### Parameter
88
|Name |Type |Description |
99
|-- |-- |-- |
10-
|uri |String或Uri|文件绝对路径或者文件Uri|
10+
|uri |String or Uri|File absolute path or file Uri|
1111

1212
#### Returns
1313
|Type |Description |
1414
|-- |-- |
15-
|Promise<[WorkspaceFolder](/ExtensionDocs/Api/other/WorkspaceFolder)>|文件所在的项目 |
15+
|Promise<[WorkspaceFolder](/ExtensionDocs/Api/other/WorkspaceFolder)>|The project where the file is located. |
1616

1717
#### Example
1818
``` javascript
1919
var wsPromise = hx.workspace.getWorkspaceFolder("%fsPath%");
2020
wsPromise.then(function(wsFolder) {
21-
console.log("文件所在项目:",wsFolder.name);
21+
console.log("The project where the file is located:",wsFolder.name);
2222
});
2323
```
2424

2525
#### WorkspaceFolder
26-
工作空间下的项目目录,在左侧项目管理器内的每一个项目表示一个WorkspaceFolder
26+
27+
The project directory under the workspace, each project in the project manager on the left represents a WorkspaceFolder
2728

2829
**Attribute list**
2930

3031
|Attribute name |Type |Description |
3132
|-- |-- |-- |
32-
|uri |String或[Uri](/ExtensionDocs/Api/other/Uri.md)|项目目录地址 |
33-
|name |String |项目目录名称 |
34-
|nature |String |项目类型 |
35-
|id |String |项目唯一id |
33+
|uri |String or [Uri](/ExtensionDocs/Api/other/Uri.md)|Project directory path |
34+
|name |String |Project Name |
35+
|nature |String |project type |
36+
|id |String |Project unique id |

en/ExtensionDocs/Api/workspace/getWorkspaceFolders.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ No
1111
#### Returns
1212
|Type |Description |
1313
|-- |-- |
14-
|Promise<Array<[WorkspaceFolder](/ExtensionDocs/Api/other/WorkspaceFolder)>>|项目管理器下所有的项目 |
14+
|Promise<Array<[WorkspaceFolder](/ExtensionDocs/Api/other/WorkspaceFolder)>>|All projects under the project manager |
1515

1616
#### Example
1717
``` javascript
1818
var wsPromise = hx.workspace.getWorkspaceFolders();
1919
wsPromise.then(function(wsFolders) {
20-
console.log("项目管理器包含的项目数量:",wsFolders.length);
20+
console.log("Number of projects included in the project manager:",wsFolders.length);
2121
});
2222
```
2323

@@ -30,7 +30,7 @@ The project directory under the workspace, each project in the project manager o
3030

3131
|Attribute name |Type |Description |
3232
|-- |-- |-- |
33-
|uri |String或[Uri](/ExtensionDocs/Api/other/Uri)|Project Path |
33+
|uri |String or [Uri](/ExtensionDocs/Api/other/Uri)|Project Path |
3434
|name |String |Project directory name |
3535
|nature |String |Project Type |
3636
|id |String |Project ID |

en/ExtensionDocs/Api/workspace/onDidChangeConfiguration.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,39 @@
2121
**Example**
2222

2323
``` javascript
24-
let configurationChangeDisplose = hx.workspace.onDidChangeConfiguration(function(event){
25-
if(event.affectsConfiguration("editor.fontSize")){
26-
console.log("修改了字体大小");
27-
}
28-
});
24+
let configurationChangeDisplose = hx.workspace.onDidChangeConfiguration(function(event){
25+
if(event.affectsConfiguration("editor.fontSize")){
26+
console.log("Modified font size");
27+
}
28+
});
2929
```
3030

3131
## ConfigurationChangeEvent
3232

33-
> 配置改变产生的事件
33+
> An event that is emitted when the configuration changed.
3434
3535
### affectsConfiguration
36-
判断该事件该变了哪个配置项值
36+
37+
Checks if the given section has changed.
3738

3839
**Parameter**
3940

4041
|Name |Type |Description |
4142
|-- |-- |-- |
42-
|section |String |配置项的key,比如:"editor.fontSize"|
43+
|section |String |Configuration name, Example:"editor.fontSize"|
4344

4445
**Parameter**
4546

4647
|Type |Description |
4748
|-- |-- |
48-
|Boolean |`true`表示配置项被修改,`false`表示配置项没有被修改|
49+
|Boolean |`true` if the given section has changed.|
4950

5051
**Example**
5152

5253
``` javascript
53-
let configurationChangeDisplose = hx.workspace.onDidChangeConfiguration(function(event){
54-
if(event.affectsConfiguration("editor.fontSize")){
55-
console.log("修改了字体大小");
56-
}
57-
});
54+
let configurationChangeDisplose = hx.workspace.onDidChangeConfiguration(function(event){
55+
if(event.affectsConfiguration("editor.fontSize")){
56+
console.log("Modified font size");
57+
}
58+
});
5859
```

0 commit comments

Comments
 (0)