Skip to content

Commit 8198df8

Browse files
committed
修复:pcall(function () ... end)场景下,function函数体内无法提供局部符号表信息和自动补全功能;优化:使用:调用.定义的函数时,不自动补全第一个参数
1 parent bb739c3 commit 8198df8

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
All notable changes to the "luacoderassist" extension will be documented in this file.
44

5+
## 2.3.3 @ 2019-8-11
6+
7+
- 修复:`pcall(function () ... end)`场景下,`function`函数体内无法提供局部符号表信息和自动补全功能
8+
- 优化:使用`:`调用`.`定义的函数时,不自动补全第一个参数
9+
510
## 2.3.2 @ 2019-7-31
611

712
- 修复:#71
8-
- 优化:#70
13+
- 优化:#70
914
- 优化:支持提供通过下标表达式的方式添加的字符串类型的域段的代码补全(形如如:foo['xx-yy'] = bar),暂不支持hover
1015

1116
## 2.3.1 @ 2019-7-31

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "LuaCoderAssist",
44
"description": "lua编程助手,包括代码补全、符号预览&跳转、函数特征帮助、符号类型推导、静态检查、格式化、代码度量等功能",
55
"icon": "images/icon.png",
6-
"version": "2.3.2",
6+
"version": "2.3.3",
77
"publisher": "liwangqian",
88
"engines": {
99
"vscode": "^1.25.0"

server/lib/engine/completion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class CompletionContext {
3333
this.names = expr.trim().split(/[\.\:]/);
3434
this.range = range;
3535
this.uri = uri;
36-
this.functionOnly = expr.lastIndexOf(':') > 0;
3736
this.isString = false;
37+
this.functionOnly = expr.lastIndexOf(':') > expr.lastIndexOf('.');
3838
}
3939
};
4040

server/lib/engine/core.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ function analysis(code, uri) {
376376
case 'pcall':
377377
if (node.arguments[0].value === 'require') {
378378
parseDependence(node, node.arguments[1]);
379+
} else {
380+
walkNodes(node.arguments);
379381
}
380382
return;
381383
case 'setmetatable':

0 commit comments

Comments
 (0)