diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-08-23 17:29:51 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-08-23 17:29:51 +0800 |
commit | cbf148c1f7985afcc5ff03cc675e1ea7657714a4 (patch) | |
tree | a86255c1991b60a76c18ce47441467f824042cc4 | |
parent | 66b68f8453d98dbb3197926e0ad96764a4513ca2 (diff) | |
download | lua-language-server-cbf148c1f7985afcc5ff03cc675e1ea7657714a4.zip |
back to provate hint
-rw-r--r-- | script/provider/provider.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 774e6c88..b238a9b7 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -801,8 +801,6 @@ end) proto.on('$/requestHint', function (params) local core = require 'core.hint' - await.setID 'hint' - await.close 'hint' if not config.get 'Lua.hint.enable' then return end @@ -842,9 +840,10 @@ do local piece = hint(uri, visible.start, visible.finish) if piece then for _, edit in ipairs(piece) do + local offset = edit.where == 'left' and edit.offset - 1 or edit.offset edits[#edits+1] = { newText = edit.text, - range = files.range(uri, edit.offset, edit.offset) + range = files.range(uri, offset, offset) } end end |