diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-06-14 14:21:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-06-14 14:21:39 +0800 |
commit | 4259e92b65dc5091147eea593b831cf6e41ee208 (patch) | |
tree | 78f1d4be5e59b1a4f3d67660316e2017e6c20a4d | |
parent | 484f993c6a1026b7eb04d48ff4aee00e2dcafd54 (diff) | |
download | lua-language-server-4259e92b65dc5091147eea593b831cf6e41ee208.zip |
fix incorrect doc range
fix #2110
-rw-r--r-- | changelog.md | 2 | ||||
-rw-r--r-- | script/parser/luadoc.lua | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md index cf7fad9a..5fede5aa 100644 --- a/changelog.md +++ b/changelog.md @@ -6,12 +6,14 @@ * `FIX` [#2062] * `FIX` [#2083] * `FIX` [#2088] +* `FIX` [#2110] [#2038]: https://github.com/LuaLS/lua-language-server/issues/2038 [#2042]: https://github.com/LuaLS/lua-language-server/issues/2042 [#2062]: https://github.com/LuaLS/lua-language-server/issues/2062 [#2083]: https://github.com/LuaLS/lua-language-server/issues/2083 [#2088]: https://github.com/LuaLS/lua-language-server/issues/2088 +[#2110]: https://github.com/LuaLS/lua-language-server/issues/2110 ## 3.6.21 `2023-5-24` diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index c022adcb..e251aa3e 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1534,7 +1534,7 @@ local function buildLuaDoc(comment) parseTokens(doc, startOffset + startPos) local result, rests = convertTokens(doc) if result then - result.range = comment.finish + result.range = math.max(comment.finish, result.finish) local finish = result.firstFinish or result.finish if rests then for _, rest in ipairs(rests) do |