diff --git a/CHANGELOG.md b/CHANGELOG.md index 897fafc..096a258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ [English Change Log](CHANGELOG_EN.md) +# 0.6.6 + +`FIX` 修复一些补全问题 + +`NEW` 增加一个显示解析进度的条 + +`NEW` 替换插件端的debug inline values特性, 改为语言服务实现 + +`NEW` 实现函数环境下self字段的直接补全而不用写self + + # 0.6.5 `FIX` 修复部分全局变量没有标记为红色的BUG diff --git a/CHANGELOG_EN.md b/CHANGELOG_EN.md index 544a7e9..72258d6 100644 --- a/CHANGELOG_EN.md +++ b/CHANGELOG_EN.md @@ -1,5 +1,15 @@ # Change Log +# 0.6.6 + +`FIX` Fixed some completion issues + +`NEW` Added a progress bar for parsing + +`NEW` Replaced the debug inline values feature on the plugin side with language service implementation + +`NEW` Implemented direct completion of the `self` field in function context without having to write `self` + # 0.6.5 `FIX` Fixed the bug where some global variables were not marked in red diff --git a/build/config.js b/build/config.js index dbaf083..9c250ab 100644 --- a/build/config.js +++ b/build/config.js @@ -3,6 +3,6 @@ exports.default = { emmyDebuggerUrl: 'https://github.com/EmmyLua/EmmyLuaDebugger/releases/download', lanServerVersion: "0.5.16", lanServerUrl: 'https://github.com/EmmyLua/EmmyLua-LanguageServer/releases/download', - newLanguageServerVersion: "0.1.4", + newLanguageServerVersion: "0.1.5", newLanguageServerUrl: "https://github.com/CppCXY/EmmyLuaAnalyzer/releases/download" } diff --git a/package.json b/package.json index 33e3016..a0789ce 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "emmylua", "displayName": "EmmyLua", "description": "EmmyLua for vscode", - "version": "0.6.5", + "version": "0.6.6", "icon": "res/icon.png", "publisher": "tangzx", "engines": { diff --git a/src/emmyContext.ts b/src/emmyContext.ts index aff236f..39c8360 100644 --- a/src/emmyContext.ts +++ b/src/emmyContext.ts @@ -72,7 +72,7 @@ export class EmmyContext { registerProtocol() { this.client?.onNotification("emmy/progressReport", (d: IProgressReport) => { this.loadBar.show(); - this.loadBar.text = `${d.text}`; + this.loadBar.text = `$(sync~spin) ${d.text}`; if (d.percent >= 1) { setTimeout(() => { this.loadBar.hide(); diff --git a/src/extension.ts b/src/extension.ts index 0878fed..6ae5663 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -76,36 +76,38 @@ function registerDebuggers() { context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory('emmylua_attach', factory)); context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory('emmylua_launch', factory)); } - context.subscriptions.push(vscode.languages.registerInlineValuesProvider('lua', { - // 不知道是否应该发到ls上再做处理 - // 先简单处理一下吧 - provideInlineValues(document: vscode.TextDocument, viewport: vscode.Range, context: vscode.InlineValueContext): vscode.ProviderResult { + if (!ctx.newLanguageServer) { + context.subscriptions.push(vscode.languages.registerInlineValuesProvider('lua', { + // 不知道是否应该发到ls上再做处理 + // 先简单处理一下吧 + provideInlineValues(document: vscode.TextDocument, viewport: vscode.Range, context: vscode.InlineValueContext): vscode.ProviderResult { - const allValues: vscode.InlineValue[] = []; - const regExps = [ - /(?<=local\s+)[^\s,\<]+/, - /(?<=---@param\s+)\S+/ - ] + const allValues: vscode.InlineValue[] = []; + const regExps = [ + /(?<=local\s+)[^\s,\<]+/, + /(?<=---@param\s+)\S+/ + ] - for (let l = viewport.start.line; l <= context.stoppedLocation.end.line; l++) { - const line = document.lineAt(l); + for (let l = viewport.start.line; l <= context.stoppedLocation.end.line; l++) { + const line = document.lineAt(l); - for (const regExp of regExps) { - const match = regExp.exec(line.text); - if (match) { - const varName = match[0]; - const varRange = new vscode.Range(l, match.index, l, match.index + varName.length); - // value found via variable lookup - allValues.push(new vscode.InlineValueVariableLookup(varRange, varName, false)); - break; + for (const regExp of regExps) { + const match = regExp.exec(line.text); + if (match) { + const varName = match[0]; + const varRange = new vscode.Range(l, match.index, l, match.index + varName.length); + // value found via variable lookup + allValues.push(new vscode.InlineValueVariableLookup(varRange, varName, false)); + break; + } } + } + return allValues; } - - return allValues; - } - })); + })); + } } function onDidChangeTextDocument(event: vscode.TextDocumentChangeEvent) {