From 01b87570e6d8f2655ebc0e5a33258735b857f228 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, 23 Feb 2021 19:49:19 +0800 Subject: should use origin uri in diagnostic relative --- changelog.md | 1 + script/provider/diagnostic.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 46916979..180323a7 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## 1.16.2 * `NEW` diagnostic: `duplicate-set-field` * `NEW` diagnostic: `no-implicit-any`, disabled by default +* `FIX` diagnositc: may open file with wrong uri case * `FIX` [#406](https://github.com/sumneko/lua-language-server/issues/406) ## 1.16.1 diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 52ba3f87..6f67d92c 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -44,9 +44,10 @@ local function buildSyntaxError(uri, err) else rmessage = text:sub(rel.start, rel.finish) end + local relUri = files.getOriginUri(rel.uri) relatedInformation[#relatedInformation+1] = { message = rmessage, - location = define.location(uri, files.range(uri, rel.start, rel.finish)), + location = define.location(relUri, files.range(relUri, rel.start, rel.finish)), } end end -- cgit v1.2.3