Skip to content

Commit 6ebfbd7

Browse files
committed
0.6.6
1 parent 11d90cb commit 6ebfbd7

File tree

6 files changed

+49
-26
lines changed

6 files changed

+49
-26
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
[English Change Log](CHANGELOG_EN.md)
44

5+
# 0.6.6
6+
7+
`FIX` 修复一些补全问题
8+
9+
`NEW` 增加一个显示解析进度的条
10+
11+
`NEW` 替换插件端的debug inline values特性, 改为语言服务实现
12+
13+
`NEW` 实现函数环境下self字段的直接补全而不用写self
14+
15+
516
# 0.6.5
617

718
`FIX` 修复部分全局变量没有标记为红色的BUG

CHANGELOG_EN.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
# 0.6.6
4+
5+
`FIX` Fixed some completion issues
6+
7+
`NEW` Added a progress bar for parsing
8+
9+
`NEW` Replaced the debug inline values feature on the plugin side with language service implementation
10+
11+
`NEW` Implemented direct completion of the `self` field in function context without having to write `self`
12+
313
# 0.6.5
414

515
`FIX` Fixed the bug where some global variables were not marked in red

build/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ exports.default = {
33
emmyDebuggerUrl: 'https://github.com/EmmyLua/EmmyLuaDebugger/releases/download',
44
lanServerVersion: "0.5.16",
55
lanServerUrl: 'https://github.com/EmmyLua/EmmyLua-LanguageServer/releases/download',
6-
newLanguageServerVersion: "0.1.4",
6+
newLanguageServerVersion: "0.1.5",
77
newLanguageServerUrl: "https://github.com/CppCXY/EmmyLuaAnalyzer/releases/download"
88
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "emmylua",
33
"displayName": "EmmyLua",
44
"description": "EmmyLua for vscode",
5-
"version": "0.6.5",
5+
"version": "0.6.6",
66
"icon": "res/icon.png",
77
"publisher": "tangzx",
88
"engines": {

src/emmyContext.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class EmmyContext {
7272
registerProtocol() {
7373
this.client?.onNotification("emmy/progressReport", (d: IProgressReport) => {
7474
this.loadBar.show();
75-
this.loadBar.text = `${d.text}`;
75+
this.loadBar.text = `$(sync~spin) ${d.text}`;
7676
if (d.percent >= 1) {
7777
setTimeout(() => {
7878
this.loadBar.hide();

src/extension.ts

+25-23
Original file line numberDiff line numberDiff line change
@@ -76,36 +76,38 @@ function registerDebuggers() {
7676
context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory('emmylua_attach', factory));
7777
context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory('emmylua_launch', factory));
7878
}
79-
context.subscriptions.push(vscode.languages.registerInlineValuesProvider('lua', {
80-
// 不知道是否应该发到ls上再做处理
81-
// 先简单处理一下吧
82-
provideInlineValues(document: vscode.TextDocument, viewport: vscode.Range, context: vscode.InlineValueContext): vscode.ProviderResult<vscode.InlineValue[]> {
79+
if (!ctx.newLanguageServer) {
80+
context.subscriptions.push(vscode.languages.registerInlineValuesProvider('lua', {
81+
// 不知道是否应该发到ls上再做处理
82+
// 先简单处理一下吧
83+
provideInlineValues(document: vscode.TextDocument, viewport: vscode.Range, context: vscode.InlineValueContext): vscode.ProviderResult<vscode.InlineValue[]> {
8384

84-
const allValues: vscode.InlineValue[] = [];
85-
const regExps = [
86-
/(?<=local\s+)[^\s,\<]+/,
87-
/(?<=---@param\s+)\S+/
88-
]
85+
const allValues: vscode.InlineValue[] = [];
86+
const regExps = [
87+
/(?<=local\s+)[^\s,\<]+/,
88+
/(?<=---@param\s+)\S+/
89+
]
8990

90-
for (let l = viewport.start.line; l <= context.stoppedLocation.end.line; l++) {
91-
const line = document.lineAt(l);
91+
for (let l = viewport.start.line; l <= context.stoppedLocation.end.line; l++) {
92+
const line = document.lineAt(l);
9293

93-
for (const regExp of regExps) {
94-
const match = regExp.exec(line.text);
95-
if (match) {
96-
const varName = match[0];
97-
const varRange = new vscode.Range(l, match.index, l, match.index + varName.length);
98-
// value found via variable lookup
99-
allValues.push(new vscode.InlineValueVariableLookup(varRange, varName, false));
100-
break;
94+
for (const regExp of regExps) {
95+
const match = regExp.exec(line.text);
96+
if (match) {
97+
const varName = match[0];
98+
const varRange = new vscode.Range(l, match.index, l, match.index + varName.length);
99+
// value found via variable lookup
100+
allValues.push(new vscode.InlineValueVariableLookup(varRange, varName, false));
101+
break;
102+
}
101103
}
104+
102105
}
103106

107+
return allValues;
104108
}
105-
106-
return allValues;
107-
}
108-
}));
109+
}));
110+
}
109111
}
110112

111113
function onDidChangeTextDocument(event: vscode.TextDocumentChangeEvent) {

0 commit comments

Comments
 (0)