summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-23 19:49:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-23 19:49:19 +0800
commit01b87570e6d8f2655ebc0e5a33258735b857f228 (patch)
tree93d31ab492f402fc255e095d15ea2c34217ee0b0
parent4fbcb7b75aa0ea18fac6c4b77fcdee97921f36bc (diff)
downloadlua-language-server-01b87570e6d8f2655ebc0e5a33258735b857f228.zip
should use origin uri in diagnostic relative
-rw-r--r--changelog.md1
-rw-r--r--script/provider/diagnostic.lua3
2 files changed, 3 insertions, 1 deletions
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