From 82190ca9d352030ba86081f58517d9e6afe43b00 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, 18 May 2021 20:39:31 +0800 Subject: 1.21.2 --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 55564c01..213f776a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 1.21.2 +`2021-5-18` * `FIX` loaded new file with ignored filename * `FIX` [#536](https://github.com/sumneko/lua-language-server/issues/536) * `FIX` [#537](https://github.com/sumneko/lua-language-server/issues/537) -- cgit v1.2.3 From 4f1f6d4dbc7940b5f117e25b3528712ff4b221ef 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, 18 May 2021 20:59:16 +0800 Subject: fix --- script/workspace/workspace.lua | 10 +++------- test/crossfile/definition.lua | 12 ++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 72a689c1..5350369e 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -329,11 +329,7 @@ function m.findUrisByFilePath(path) if type(path) ~= 'string' then return {} end - local lpath = path:gsub('[/\\]+', '/') - if lpath:match('^[/\\]') - or lpath:match('^%a+%:') then - lpath = furi.encode(lpath) - end + local lpath = furi.encode(path):gsub('^file:///', '') if platform.OS == 'Windows' then lpath = lpath:lower() end @@ -349,11 +345,11 @@ function m.findUrisByFilePath(path) if platform.OS ~= 'Windows' then uri = files.getOriginUri(uri) end - local curPath = furi.decode(files.getOriginUri(uri)) - if not curPath:find(lpath, 1, true) then + if not uri:find(lpath, 1, true) then goto CONTINUE end local pathLen = #path + local curPath = furi.decode(files.getOriginUri(uri)) local curLen = #curPath local seg = curPath:sub(curLen - pathLen, curLen - pathLen) if seg == '/' or seg == '\\' or seg == '' then diff --git a/test/crossfile/definition.lua b/test/crossfile/definition.lua index fb0e872d..467e6af5 100644 --- a/test/crossfile/definition.lua +++ b/test/crossfile/definition.lua @@ -119,6 +119,18 @@ TEST { }, } +TEST { + { + path = '@bbb.lua', + content = '', + target = {0, 0}, + }, + { + path = 'b.lua', + content = 'require ""', + }, +} + TEST { { path = 'aaa/bbb.lua', -- cgit v1.2.3 From 4647fad6816cc78d7fb9970077d33763afd710df 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, 24 May 2021 14:26:26 +0800 Subject: update submodules --- 3rd/bee.lua | 2 +- 3rd/luamake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3rd/bee.lua b/3rd/bee.lua index dedd14fe..cc6cc948 160000 --- a/3rd/bee.lua +++ b/3rd/bee.lua @@ -1 +1 @@ -Subproject commit dedd14fe9f01ed91b739e4e42f19be0825254b5b +Subproject commit cc6cc948e333aa04f6731a211d388b26dbd2b3b3 diff --git a/3rd/luamake b/3rd/luamake index 5eb318e4..8af19413 160000 --- a/3rd/luamake +++ b/3rd/luamake @@ -1 +1 @@ -Subproject commit 5eb318e46b41592803bb04294d873980f96feafe +Subproject commit 8af194139b1b07a9c54c11db9751058856a1286d -- cgit v1.2.3