mirror of
https://gitee.com/ssssssss-team/magic-api.git
synced 2026-05-30 18:40:27 +08:00
代码提示优化
This commit is contained in:
@@ -299,9 +299,9 @@ const quickSuggestions = [
|
||||
['ife', 'if (${1:condition}) {\r\n\t$2\r\n} else { \r\n\t$3\r\n}', '判断'],
|
||||
['for', 'for (item in ${1:collection}) {\r\n\t$2\r\n}', '循环集合'],
|
||||
['exit', 'exit ${1:code}, ${2:message};', '退出'],
|
||||
['info', 'log.info($1);', 'info日志'],
|
||||
['debug', 'log.debug($1);', 'debug日志'],
|
||||
['err', 'log.error($1);', 'error日志'],
|
||||
['logi', 'log.info($1);', 'info日志'],
|
||||
['logd', 'log.debug($1);', 'debug日志'],
|
||||
['loge', 'log.error($1);', 'error日志'],
|
||||
['ass', 'assert ${1:condition} : ${2:code}, ${3:message}', '校验参数']
|
||||
]
|
||||
|
||||
|
||||
@@ -589,14 +589,9 @@ export class Parser {
|
||||
}
|
||||
if (this.stream.match(TokenType.StringLiteral, false)) {
|
||||
key = this.stream.expect(TokenType.StringLiteral);
|
||||
} else if (this.stream.match(TokenType.LeftBracket, false)) { // [key]
|
||||
let opening = this.stream.expect(TokenType.LeftBracket).getSpan();
|
||||
this.stream.expect(TokenType.Identifier);
|
||||
let closing = this.stream.expect(TokenType.RightBracket).getSpan();
|
||||
let span = new Span(opening, closing);
|
||||
let dynamicKey = span.getText();
|
||||
dynamicKey = dynamicKey.substring(1, dynamicKey.length - 1);
|
||||
key = new VariableAccess(span, dynamicKey);
|
||||
} else if (this.stream.match(TokenType.LeftBracket, true)) { // [key]
|
||||
key = this.parseExpression()
|
||||
this.stream.expect(TokenType.RightBracket);
|
||||
} else {
|
||||
key = this.stream.expect(TokenType.Identifier);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user