From 2e22590dc8fe124a4429ec25954fb757648e8c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 3 Mar 2022 20:01:41 +0800 Subject: fix --- script/files.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/files.lua b/script/files.lua index 37aef7e1..29e32c01 100644 --- a/script/files.lua +++ b/script/files.lua @@ -69,7 +69,6 @@ function m.open(uri) cache = {}, } m.onWatch('open', uri) - m.addRef(uri) end --- 关闭文件 @@ -81,7 +80,9 @@ function m.close(uri) file.trusted = false end m.onWatch('close', uri) - m.delRef(uri) + if (file._ref or 0) <= 0 and not file.isOpen(uri) then + m.remove(uri) + end end --- 是否打开 @@ -380,7 +381,7 @@ function m.delRef(uri) end file._ref = (file._ref or 0) - 1 log.debug('del ref', uri) - if file._ref <= 0 then + if file._ref <= 0 and not m.isOpen(uri) then m.remove(uri) end end -- cgit v1.2.3 From fe96e7600f227ed6f45e4a150156fbbe5077be3f Mon Sep 17 00:00:00 2001 From: wongxy Date: Fri, 4 Mar 2022 00:22:02 +0800 Subject: feat(semantic-tokens): mark annotations(@...) as keywords --- script/core/semantic-tokens.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index bb6282a4..a4429e03 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -828,7 +828,7 @@ return function (uri, start, finish) results[#results+1] = { start = comm.start + 3, finish = comm.start + 2 + #comm.text:match '%S+', - type = define.TokenTypes.comment, + type = define.TokenTypes.keyword, modifieres = define.TokenModifiers.documentation, } else -- cgit v1.2.3 From 659964c943c4b1e78c729318dd8537d0b8c4cbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 4 Mar 2022 14:24:48 +0800 Subject: don't open non-file uri --- script/file-uri.lua | 4 ++++ script/provider/diagnostic.lua | 4 ++-- script/provider/provider.lua | 9 +++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/script/file-uri.lua b/script/file-uri.lua index 7f3e36a8..ccd47156 100644 --- a/script/file-uri.lua +++ b/script/file-uri.lua @@ -94,4 +94,8 @@ function m.decode(uri) return value end +function m.split(uri) + return uri:match('([^:]*):?/?/?([^/]*)(.*)') +end + return m diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index de1a735e..3e587009 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -225,7 +225,7 @@ function m.doDiagnostic(uri, isScopeDiag) local prog = progress.create(scp, lang.script.WINDOW_DIAGNOSING, 0.5) prog:setMessage(ws.getRelativePath(uri)) - log.debug('Diagnostic file:', uri) + --log.debug('Diagnostic file:', uri) local syntax = m.syntaxErrors(uri, state) @@ -235,7 +235,7 @@ function m.doDiagnostic(uri, isScopeDiag) tracy.ZoneBeginN 'mergeSyntaxAndDiags' local _ = tracy.ZoneEnd local full = mergeDiags(syntax, lastDiag, diags) - log.debug(('Pushed [%d] results'):format(full and #full or 0)) + --log.debug(('Pushed [%d] results'):format(full and #full or 0)) if not full then m.clear(uri) return diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 5ee99b3e..eef22b21 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -225,8 +225,13 @@ m.register 'workspace/didRenameFiles' { m.register 'textDocument/didOpen' { ---@async function (params) - local doc = params.textDocument - local uri = files.getRealUri(doc.uri) + local doc = params.textDocument + local scheme = furi.split(doc.uri) + if scheme ~= 'file' then + return + end + local uri = files.getRealUri(doc.uri) + log.debug('didOpen', uri) workspace.awaitReady(uri) local text = doc.text files.setText(uri, text, true, function (file) -- cgit v1.2.3 From f583a9f73c9e6edc101ea657b0e28fb1726e0747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 4 Mar 2022 14:31:26 +0800 Subject: pass tests --- test/tclient/tests/folders-with-single-file.lua | 4 ++-- test/tclient/tests/single-mode.lua | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/tclient/tests/folders-with-single-file.lua b/test/tclient/tests/folders-with-single-file.lua index e77535c9..2a5db70b 100644 --- a/test/tclient/tests/folders-with-single-file.lua +++ b/test/tclient/tests/folders-with-single-file.lua @@ -45,7 +45,7 @@ print(x) client:notify('textDocument/didOpen', { textDocument = { - uri = 'test://single-file.lua', + uri = 'file://single-file.lua', languageId = 'lua', version = 0, text = [[ @@ -58,7 +58,7 @@ print(x) ws.awaitReady(nil) local locations = client:awaitRequest('textDocument/definition', { - textDocument = { uri = 'test://single-file.lua' }, + textDocument = { uri = 'file://single-file.lua' }, position = { line = 1, character = 0 }, }) diff --git a/test/tclient/tests/single-mode.lua b/test/tclient/tests/single-mode.lua index f79fa2e8..4e14415b 100644 --- a/test/tclient/tests/single-mode.lua +++ b/test/tclient/tests/single-mode.lua @@ -9,7 +9,7 @@ lclient():start(function (client) client:notify('textDocument/didOpen', { textDocument = { - uri = 'test://single-file.lua', + uri = 'file://single-file.lua', languageId = 'lua', version = 0, text = [[ @@ -22,13 +22,13 @@ print(x) ws.awaitReady() local locations = client:awaitRequest('textDocument/definition', { - textDocument = { uri = 'test://single-file.lua' }, + textDocument = { uri = 'file://single-file.lua' }, position = { line = 1, character = 7 }, }) assert(util.equal(locations, { { - uri = 'test://single-file.lua', + uri = 'file://single-file.lua', range = { start = { line = 0, character = 6 }, ['end'] = { line = 0, character = 7 }, @@ -37,7 +37,7 @@ print(x) })) local locations = client:awaitRequest('textDocument/definition', { - textDocument = { uri = 'test://single-file.lua' }, + textDocument = { uri = 'file://single-file.lua' }, position = { line = 1, character = 0 }, }) -- cgit v1.2.3 From 22a1e4400b9dc25f8ef0c1b9fc323e8a07cb508e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 4 Mar 2022 14:38:03 +0800 Subject: diagnostic opened files first --- script/provider/diagnostic.lua | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 3e587009..ac93dc52 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -13,6 +13,7 @@ local converter = require 'proto.converter' local loading = require 'workspace.loading' local scope = require 'workspace.scope' local time = require 'bee.time' +local ltable = require 'linked-table' ---@class diagnosticProvider local m = {} @@ -360,28 +361,38 @@ local function askForDisable(uri) end ---@async -function m.awaitDiagnosticsScope(uri) - local scp = scope.getScope(uri) +function m.awaitDiagnosticsScope(suri) + local scp = scope.getScope(suri) while loading.count() > 0 do await.sleep(1.0) end local clock = os.clock() - local bar = progress.create(scope.getScope(uri), lang.script.WORKSPACE_DIAGNOSTIC, 1) + local bar = progress.create(scope.getScope(suri), lang.script.WORKSPACE_DIAGNOSTIC, 1) local cancelled bar:onCancel(function () log.debug('Cancel workspace diagnostics') cancelled = true ---@async await.call(function () - askForDisable(uri) + askForDisable(suri) end) end) - local uris = files.getAllUris(uri) + local uris = files.getAllUris(suri) + local sortedUris = ltable() + for _, uri in ipairs(uris) do + if files.isOpen(uri) then + sortedUris:pushHead(uri) + else + sortedUris:pushTail(uri) + end + end log.info(('Diagnostics scope [%s], files count:[%d]'):format(scp:getName(), #uris)) - for i, uri in ipairs(uris) do + local i = 0 + for uri in sortedUris:pairs() do while loading.count() > 0 do await.sleep(1.0) end + i = i + 1 bar:setMessage(('%d/%d'):format(i, #uris)) bar:setPercentage(i / #uris * 100) xpcall(m.doDiagnostic, log.error, uri, true) -- cgit v1.2.3 From 51f7c85993fd8673b08d6cf9399681527fa8ebec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 4 Mar 2022 14:38:12 +0800 Subject: update formatter --- 3rd/EmmyLuaCodeStyle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 66a38c05..7f903e2c 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 66a38c054a61fd5993c747cb967802f34e635ae0 +Subproject commit 7f903e2cd3b135d6148425db469c2e4ec53a8cba -- cgit v1.2.3 From 9693866308a8d72da5b1ab5b090cf178fe9be2e2 Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 4 Mar 2022 23:19:54 +0800 Subject: no longer provide syntax files --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 58877c5f..4cdb65d8 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## 2.6.7 * `NEW` offline diagnostic, [read more](https://github.com/sumneko/lua-language-server/wiki/Offline-Diagnostic) +* `CHG` `VSCode`: 1.65 has built in new lua syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions for syntax files, you can [open issues at here](https://github.com/sumneko/lua.tmbundle). * `FIX` [#965](https://github.com/sumneko/lua-language-server/issues/965) ## 2.6.6 -- cgit v1.2.3 From 227ad46469c6d740af26a87828cf0a01e574bb4b Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 4 Mar 2022 23:21:10 +0800 Subject: improve English --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 4cdb65d8..47411faa 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,7 @@ ## 2.6.7 * `NEW` offline diagnostic, [read more](https://github.com/sumneko/lua-language-server/wiki/Offline-Diagnostic) -* `CHG` `VSCode`: 1.65 has built in new lua syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions for syntax files, you can [open issues at here](https://github.com/sumneko/lua.tmbundle). +* `CHG` `VSCode`: 1.65 has built in new `Lua` syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions or issues, please [open issues here](https://github.com/sumneko/lua.tmbundle). * `FIX` [#965](https://github.com/sumneko/lua-language-server/issues/965) ## 2.6.6 -- cgit v1.2.3 From df8d04bbdd3dab65ca593783f97b7f4c56e351d3 Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 4 Mar 2022 23:39:08 +0800 Subject: add tip --- locale/en-us/script.lua | 7 +++++++ locale/zh-cn/script.lua | 7 +++++++ script/service/service.lua | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua index 5e9a4099..f5a3ec30 100644 --- a/locale/en-us/script.lua +++ b/locale/en-us/script.lua @@ -457,6 +457,13 @@ WINDOW_LUA_STATUS_CACHED_FILES = 'Cached files: {ast}/{max}' WINDOW_LUA_STATUS_MEMORY_COUNT = 'Memory usage: {mem:.f}M' +WINDOW_LUA_STATUS_TIP = +[[ + +This icon is a cat, +Not a dog nor a fox! + ↓↓↓ +]] WINDOW_APPLY_SETTING = 'Apply setting' WINDOW_CHECK_SEMANTIC = diff --git a/locale/zh-cn/script.lua b/locale/zh-cn/script.lua index 32cd7d13..f30257fb 100644 --- a/locale/zh-cn/script.lua +++ b/locale/zh-cn/script.lua @@ -456,6 +456,13 @@ WINDOW_LUA_STATUS_CACHED_FILES = '已缓存文件:{ast}/{max}' WINDOW_LUA_STATUS_MEMORY_COUNT = '内存占用:{mem:.f}M' +WINDOW_LUA_STATUS_TIP = +[[ + +这个图标是猫, +不是狗也不是狐狸! + ↓↓↓ +]] WINDOW_APPLY_SETTING = '应用设置' WINDOW_CHECK_SEMANTIC = diff --git a/script/service/service.lua b/script/service/service.lua index 66143f84..a1db02a8 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -197,6 +197,8 @@ function m.eventLoop() end end +local showStatusTip = math.random(100) == 1 + function m.reportStatus() local info = {} if m.workingClock and time.monotonic() - m.workingClock > 100 then @@ -218,6 +220,9 @@ function m.reportStatus() end tooltips[#tooltips+1] = lang.script('WINDOW_LUA_STATUS_CACHED_FILES', params) tooltips[#tooltips+1] = lang.script('WINDOW_LUA_STATUS_MEMORY_COUNT', params) + if showStatusTip then + tooltips[#tooltips+1] = lang.script('WINDOW_LUA_STATUS_TIP') + end info.tooltip = table.concat(tooltips, '\n') if util.equal(m.lastInfo, info) then -- cgit v1.2.3 From 2107c1c82bccaaf2e2cce937412ef8d5e8741b45 Mon Sep 17 00:00:00 2001 From: sumneko Date: Sat, 5 Mar 2022 02:25:04 +0800 Subject: fix --- script/files.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/files.lua b/script/files.lua index 29e32c01..7ba45262 100644 --- a/script/files.lua +++ b/script/files.lua @@ -80,7 +80,7 @@ function m.close(uri) file.trusted = false end m.onWatch('close', uri) - if (file._ref or 0) <= 0 and not file.isOpen(uri) then + if (file._ref or 0) <= 0 and not m.isOpen(uri) then m.remove(uri) end end -- cgit v1.2.3 From 1face5ab84618c03ad3077252ae289774ce7a816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 7 Mar 2022 16:47:10 +0800 Subject: fix #975 --- changelog.md | 1 + script/core/semantic-tokens.lua | 11 +++++------ script/parser/luadoc.lua | 11 ++++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 47411faa..4f885750 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ * `NEW` offline diagnostic, [read more](https://github.com/sumneko/lua-language-server/wiki/Offline-Diagnostic) * `CHG` `VSCode`: 1.65 has built in new `Lua` syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions or issues, please [open issues here](https://github.com/sumneko/lua.tmbundle). * `FIX` [#965](https://github.com/sumneko/lua-language-server/issues/965) +* `FIX` [#975](https://github.com/sumneko/lua-language-server/issues/975) ## 2.6.6 `2022-2-21` diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index a4429e03..c5a77563 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -817,17 +817,16 @@ return function (uri, start, finish) for _, comm in ipairs(state.comms) do if start <= comm.start and comm.finish <= finish then if comm.type == 'comment.short' then - local head = comm.text:sub(1, 2) - if head == '-@' - or head == '-|' then + local head = comm.text:match '^%-%s*[@|]' + if head then results[#results+1] = { start = comm.start, - finish = comm.start + 3, + finish = comm.start + #head + 1, type = define.TokenTypes.comment, } results[#results+1] = { - start = comm.start + 3, - finish = comm.start + 2 + #comm.text:match '%S+', + start = comm.start + #head + 1, + finish = comm.start + #head + 2 + #comm.text:match('%S+', #head + 1), type = define.TokenTypes.keyword, modifieres = define.TokenModifiers.documentation, } diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index a47ebe34..d15fd95a 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -668,20 +668,21 @@ function parseType(parent) if currentRow < nextCommRow then return false end - if nextComm.text:sub(1, 2) == '-@' then + if nextComm.text:match '^%-%s*%@' then return false else - if nextComm.text:sub(1, 2) == '-|' then + local resumeHead = nextComm.text:match '^%-%s*%|' + if resumeHead then NextComment(i) row = row + i + 1 - local finishPos = nextComm.text:find('#', 3) or #nextComm.text - parseTokens(nextComm.text:sub(3, finishPos), nextComm.start + 3) + local finishPos = nextComm.text:find('#', #resumeHead + 1) or #nextComm.text + parseTokens(nextComm.text:sub(#resumeHead + 1, finishPos), nextComm.start + #resumeHead + 1) local resume = parseResume(result) if resume then if comments then resume.comment = table.concat(comments, '\n') else - resume.comment = nextComm.text:match('#%s*(.+)', 3) + resume.comment = nextComm.text:match('#%s*(.+)', #resumeHead + 1) end result.types[#result.types+1] = resume result.finish = resume.finish -- cgit v1.2.3 From 2db1aed64ea3e43d3ee3e8a1ee5a53b8c1d9d95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 7 Mar 2022 16:47:50 +0800 Subject: update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/lovr-api | 2 +- meta/3rd/lovr/library/lovr.graphics.lua | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 7f903e2c..8fa05abb 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 7f903e2cd3b135d6148425db469c2e4ec53a8cba +Subproject commit 8fa05abbbeab5bd3e20d8710eb6d5e804f8800c6 diff --git a/3rd/lovr-api b/3rd/lovr-api index 8548de84..0cfe3e96 160000 --- a/3rd/lovr-api +++ b/3rd/lovr-api @@ -1 +1 @@ -Subproject commit 8548de845c91dfd8639d47018b7d421f857322e0 +Subproject commit 0cfe3e962df3d34ca996b9c74960cb52f9f2be62 diff --git a/meta/3rd/lovr/library/lovr.graphics.lua b/meta/3rd/lovr/library/lovr.graphics.lua index f0ccb310..fe0b6c33 100644 --- a/meta/3rd/lovr/library/lovr.graphics.lua +++ b/meta/3rd/lovr/library/lovr.graphics.lua @@ -1450,6 +1450,10 @@ function Canvas:isStereo() end --- ---Returns a new Image containing the contents of a Texture attached to the Canvas. --- +--- +---### NOTE: +---The Image will have the same pixel format as the Texture that is read from. +--- ---@param index? number # The index of the Texture to read from. ---@return lovr.Image image # The new Image. function Canvas:newImage(index) end -- cgit v1.2.3 From 82ec96f2bd63a1d691e919c668fb80b01a05a358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 8 Mar 2022 14:16:33 +0800 Subject: #977 cleanup --- script/files.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/script/files.lua b/script/files.lua index 7ba45262..7bd96611 100644 --- a/script/files.lua +++ b/script/files.lua @@ -662,13 +662,10 @@ end ---@param uri uri ---@return boolean function m.isLua(uri) - local ext = uri:match '%.([^%.%/%\\]+)$' - if not ext then - return false - end - if ext == 'lua' then + if util.stringEndWith(uri:lower(), '.lua') then return true end + -- check customed assoc, e.g. `*.lua.txt = *.lua` local matcher = m.getAssoc(uri) local path = furi.decode(uri) return matcher(path) -- cgit v1.2.3 From 964864d41cb1b888f9812d6edc7371762f16863f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 8 Mar 2022 19:35:12 +0800 Subject: fix --- script/core/semantic-tokens.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index c5a77563..ef426633 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -826,7 +826,7 @@ return function (uri, start, finish) } results[#results+1] = { start = comm.start + #head + 1, - finish = comm.start + #head + 2 + #comm.text:match('%S+', #head + 1), + finish = comm.start + #head + 2 + #comm.text:match('%S*', #head + 1), type = define.TokenTypes.keyword, modifieres = define.TokenModifiers.documentation, } -- cgit v1.2.3 From 28b3ab129a6c41d74a269bfa159ea15b569dd83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 9 Mar 2022 16:36:32 +0800 Subject: update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/lovr-api | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 8fa05abb..c474ffa3 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 8fa05abbbeab5bd3e20d8710eb6d5e804f8800c6 +Subproject commit c474ffa39e2735a9ac74dfc0dd5b53bc8b6620be diff --git a/3rd/lovr-api b/3rd/lovr-api index 0cfe3e96..e1e358a9 160000 --- a/3rd/lovr-api +++ b/3rd/lovr-api @@ -1 +1 @@ -Subproject commit 0cfe3e962df3d34ca996b9c74960cb52f9f2be62 +Subproject commit e1e358a9a5f60fb2d1ec7bd8361b36629577e451 -- cgit v1.2.3 From b9400e027908e61f01a9999af1a6946af575b94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 9 Mar 2022 16:45:39 +0800 Subject: resolve #973 don't show telemetry in non-VSCode avoid repeated prompts in non-VSCode due to the inability to automatically modify the settings --- changelog.md | 1 + script/service/telemetry.lua | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 4f885750..a5f063a2 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## 2.6.7 * `NEW` offline diagnostic, [read more](https://github.com/sumneko/lua-language-server/wiki/Offline-Diagnostic) * `CHG` `VSCode`: 1.65 has built in new `Lua` syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions or issues, please [open issues here](https://github.com/sumneko/lua.tmbundle). +* `CHG` telemetry: the prompt will only appear in VSCode to avoid repeated prompts in other platforms due to the inability to automatically modify the settings. * `FIX` [#965](https://github.com/sumneko/lua-language-server/issues/965) * `FIX` [#975](https://github.com/sumneko/lua-language-server/issues/975) diff --git a/script/service/telemetry.lua b/script/service/telemetry.lua index d975a986..1104865c 100644 --- a/script/service/telemetry.lua +++ b/script/service/telemetry.lua @@ -90,7 +90,6 @@ local function pushErrorLog(link) )) end -local validMap = {} local isValid = false timer.wait(5, function () @@ -145,6 +144,9 @@ function m.updateConfig() if isValid ~= nil then return end + if not client.getOption 'changeConfiguration' then + return + end if m.hasShowedMessage then return end -- cgit v1.2.3 From e3cf2df47f2201b6b8a45e1412d882260580494d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 9 Mar 2022 18:59:27 +0800 Subject: 2.6.7 --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index a5f063a2..8ef9b06a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 2.6.7 +`2022-3-9` * `NEW` offline diagnostic, [read more](https://github.com/sumneko/lua-language-server/wiki/Offline-Diagnostic) * `CHG` `VSCode`: 1.65 has built in new `Lua` syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions or issues, please [open issues here](https://github.com/sumneko/lua.tmbundle). * `CHG` telemetry: the prompt will only appear in VSCode to avoid repeated prompts in other platforms due to the inability to automatically modify the settings. -- cgit v1.2.3 From b8ceb409198684c5d4b4162cedfa8b270d62c261 Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 11 Mar 2022 23:53:59 +0800 Subject: check nil --- script/files.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/files.lua b/script/files.lua index 7bd96611..bd533c35 100644 --- a/script/files.lua +++ b/script/files.lua @@ -80,8 +80,10 @@ function m.close(uri) file.trusted = false end m.onWatch('close', uri) - if (file._ref or 0) <= 0 and not m.isOpen(uri) then - m.remove(uri) + if file then + if (file._ref or 0) <= 0 and not m.isOpen(uri) then + m.remove(uri) + end end end -- cgit v1.2.3 From 1b704bced8031bf5280e62570d678fe49a727f44 Mon Sep 17 00:00:00 2001 From: wongxy Date: Sat, 12 Mar 2022 13:04:08 +0800 Subject: fixed #976 --- locale/en-us/script.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua index f5a3ec30..df5cdae0 100644 --- a/locale/en-us/script.lua +++ b/locale/en-us/script.lua @@ -34,7 +34,7 @@ DIAG_PREFIELD_CALL = 'Will be interpreted as `{}{}`. It may be necessary to add a `,` or `;`.' DIAG_OVER_MAX_ARGS = 'The function takes only {:d} parameters, but you passed {:d}.' -DIAG_OVER_MAX_ARGS = +DIAG_OVER_MAX_VALUES = 'Only has {} variables, but you set {} values.' DIAG_AMBIGUITY_1 = 'Compute `{}` first. You may need to add brackets.' -- cgit v1.2.3 From 727e4f69beb83942ec821b9eec8d0453aa898f54 Mon Sep 17 00:00:00 2001 From: wongxy Date: Sat, 12 Mar 2022 13:05:31 +0800 Subject: tweaks align --- locale/en-us/script.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua index df5cdae0..edf76e2c 100644 --- a/locale/en-us/script.lua +++ b/locale/en-us/script.lua @@ -34,7 +34,7 @@ DIAG_PREFIELD_CALL = 'Will be interpreted as `{}{}`. It may be necessary to add a `,` or `;`.' DIAG_OVER_MAX_ARGS = 'The function takes only {:d} parameters, but you passed {:d}.' -DIAG_OVER_MAX_VALUES = +DIAG_OVER_MAX_VALUES = 'Only has {} variables, but you set {} values.' DIAG_AMBIGUITY_1 = 'Compute `{}` first. You may need to add brackets.' -- cgit v1.2.3 From 20d4be8bc74d6a78372f50112288fb6c4406b841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 15 Mar 2022 18:42:49 +0800 Subject: use real path in scanning non-Windows also check real path --- script/files.lua | 5 +---- script/workspace/workspace.lua | 15 +++++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/script/files.lua b/script/files.lua index bd533c35..9ddc5039 100644 --- a/script/files.lua +++ b/script/files.lua @@ -36,13 +36,10 @@ end m.reset() local fixedUri = {} ---- 获取文件的真实uri(真实大小写) +--- 获取文件的真实uri ---@param uri uri ---@return uri function m.getRealUri(uri) - if platform.OS ~= 'Windows' then - return uri - end local filename = furi.decode(uri) local path = fs.path(filename) local suc, res = pcall(fs.exists, path) diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 80df7d9c..934c0735 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -241,8 +241,9 @@ function m.awaitLoadFile(uri) log.info('Scan files at:', uri) ---@async native:scan(furi.decode(uri), function (path) - scp:get('cachedUris')[furi.encode(path)] = true - ld:loadFile(furi.encode(path)) + local uri = files.getRealUri(furi.encode(path)) + scp:get('cachedUris')[uri] = true + ld:loadFile(uri) end) ld:loadAll() end @@ -282,8 +283,9 @@ function m.awaitPreload(scp) log.info('Scan files at:', scp:getName()) ---@async native:scan(furi.decode(scp.uri), function (path) - scp:get('cachedUris')[furi.encode(path)] = true - ld:loadFile(furi.encode(path)) + local uri = files.getRealUri(furi.encode(path)) + scp:get('cachedUris')[uri] = true + ld:loadFile(uri) end) end @@ -292,8 +294,9 @@ function m.awaitPreload(scp) scp:addLink(libMatcher.uri) ---@async libMatcher.matcher:scan(furi.decode(libMatcher.uri), function (path) - scp:get('cachedUris')[furi.encode(path)] = true - ld:loadFile(furi.encode(path), libMatcher.uri) + local uri = files.getRealUri(furi.encode(path)) + scp:get('cachedUris')[uri] = true + ld:loadFile(uri, libMatcher.uri) end) scp:gc(fw.watch(furi.decode(libMatcher.uri))) end -- cgit v1.2.3 From f337df70ccb50b5524fe55e8034d4f601defea76 Mon Sep 17 00:00:00 2001 From: yoshi1123 Date: Sat, 19 Mar 2022 00:46:28 -0400 Subject: Ensure that a completion result has 'isIncomplete' - Any key in the table returned that has a value of 'nil' will be excluded from the response's result, and so it needs to be set to 'false'. --- script/provider/provider.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/provider/provider.lua b/script/provider/provider.lua index eef22b21..eb4a274c 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -618,6 +618,9 @@ m.register 'textDocument/completion' { end items[i] = item end + if result.incomplete == nil then + result.incomplete = false + end return { isIncomplete = result.incomplete, items = items, -- cgit v1.2.3 From 686f56f839adca75767bf2cf4623536e70f6b58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 19 Mar 2022 16:46:41 +0800 Subject: update submodules --- 3rd/lovr-api | 2 +- 3rd/luamake | 2 +- meta/3rd/lovr/library/lovr.math.lua | 42 +++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/3rd/lovr-api b/3rd/lovr-api index e1e358a9..8098fac2 160000 --- a/3rd/lovr-api +++ b/3rd/lovr-api @@ -1 +1 @@ -Subproject commit e1e358a9a5f60fb2d1ec7bd8361b36629577e451 +Subproject commit 8098fac257418887c5acc892377e5979ce0699e1 diff --git a/3rd/luamake b/3rd/luamake index 909a3bf9..81158f58 160000 --- a/3rd/luamake +++ b/3rd/luamake @@ -1 +1 @@ -Subproject commit 909a3bf9770c61efc8a3050402ecbfa4daf24ddd +Subproject commit 81158f58bcbd54c398d2b0aba4d5be67921af0ba diff --git a/meta/3rd/lovr/library/lovr.math.lua b/meta/3rd/lovr/library/lovr.math.lua index 7cf348c6..3ce62dd9 100644 --- a/meta/3rd/lovr/library/lovr.math.lua +++ b/meta/3rd/lovr/library/lovr.math.lua @@ -643,6 +643,20 @@ local Vec2 = {} ---@return lovr.Vec2 v # The original vector. function Vec2:add(u) end +--- +---Returns the angle between vectors. +--- +--- +---### NOTE: +---If any of the two vectors have a length of zero, the angle between them is not well defined. +--- +---In this case the function returns `math.pi / 2`. +--- +---@overload fun(self: lovr.Vec2, x: number, y: number):number +---@param u lovr.Vec2 # The other vector. +---@return number angle # The angle to the other vector, in radians. +function Vec2:angle(u) end + --- ---Returns the distance to another vector. --- @@ -748,6 +762,20 @@ local Vec3 = {} ---@return lovr.Vec3 v # The original vector. function Vec3:add(u) end +--- +---Returns the angle between vectors. +--- +--- +---### NOTE: +---If any of the two vectors have a length of zero, the angle between them is not well defined. +--- +---In this case the function returns `math.pi / 2`. +--- +---@overload fun(self: lovr.Vec3, x: number, y: number, z: number):number +---@param u lovr.Vec3 # The other vector. +---@return number angle # The angle to the other vector, in radians. +function Vec3:angle(u) end + --- ---Sets this vector to be equal to the cross product between this vector and another one. --- @@ -872,6 +900,20 @@ local Vec4 = {} ---@return lovr.Vec4 v # The original vector. function Vec4:add(u) end +--- +---Returns the angle between vectors. +--- +--- +---### NOTE: +---If any of the two vectors have a length of zero, the angle between them is not well defined. +--- +---In this case the function returns `math.pi / 2`. +--- +---@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):number +---@param u lovr.Vec4 # The other vector. +---@return number angle # The angle to other vector, in radians. +function Vec4:angle(u) end + --- ---Returns the distance to another vector. --- -- cgit v1.2.3 From ceeb08d99699b8518de5c92908c8ecc57e23310b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 24 Mar 2022 14:45:19 +0800 Subject: update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/bee.lua | 2 +- 3rd/lovr-api | 2 +- 3rd/luamake | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index c474ffa3..7584fe63 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit c474ffa39e2735a9ac74dfc0dd5b53bc8b6620be +Subproject commit 7584fe6367e1379c8a4faca5935fd1aa9a14207d diff --git a/3rd/bee.lua b/3rd/bee.lua index 55c9c6bf..2f044267 160000 --- a/3rd/bee.lua +++ b/3rd/bee.lua @@ -1 +1 @@ -Subproject commit 55c9c6bfd6ae4a576cd8777e232d7be48253b94e +Subproject commit 2f044267000fce0d033d46802ba538d2f8bf9d5b diff --git a/3rd/lovr-api b/3rd/lovr-api index 8098fac2..0e0f2d21 160000 --- a/3rd/lovr-api +++ b/3rd/lovr-api @@ -1 +1 @@ -Subproject commit 8098fac257418887c5acc892377e5979ce0699e1 +Subproject commit 0e0f2d21761571d3b4caefc12c1b57bffeb81667 diff --git a/3rd/luamake b/3rd/luamake index 81158f58..974d5b63 160000 --- a/3rd/luamake +++ b/3rd/luamake @@ -1 +1 @@ -Subproject commit 81158f58bcbd54c398d2b0aba4d5be67921af0ba +Subproject commit 974d5b631056086d7fa0abc8fc96873df5514c4a -- cgit v1.2.3 From 4d011025614c07447ad33018ac341917f58249ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 24 Mar 2022 14:46:30 +0800 Subject: fix icon --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 94991839..1fe9d711 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,7 +21,7 @@ ], }, { - "name": "🪡attach", + "name": "🍄attach", "type": "lua", "request": "attach", "stopOnEntry": false, -- cgit v1.2.3 From f6b9b0e94764b7f950a4a0e7c41df12a75448edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 25 Mar 2022 22:40:24 +0800 Subject: update submodules --- 3rd/love-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rd/love-api b/3rd/love-api index 6532c389..97e24dc9 160000 --- a/3rd/love-api +++ b/3rd/love-api @@ -1 +1 @@ -Subproject commit 6532c3890915ceb265afc64a33ca1b838a28acbe +Subproject commit 97e24dc98106a59fa312dd2d14f01ea5c9f2bd61 -- cgit v1.2.3