summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-01-30 20:43:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-01-30 20:43:19 +0800
commit36d1ee596527e2133c8681c3e4bf493a85357862 (patch)
tree790848087d8661ff348ff5d457eac7f7b63a8eb7 /script/core
parent4b842d088b38aea475b4bbdc411bed654c9e8228 (diff)
downloadlua-language-server-36d1ee596527e2133c8681c3e4bf493a85357862.zip
update hint
Diffstat (limited to 'script/core')
-rw-r--r--script/core/hint.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/script/core/hint.lua b/script/core/hint.lua
index 90182c39..e58758a3 100644
--- a/script/core/hint.lua
+++ b/script/core/hint.lua
@@ -1,6 +1,7 @@
-local files = require 'files'
-local guide = require 'parser.guide'
-local vm = require 'vm'
+local files = require 'files'
+local guide = require 'parser.guide'
+local vm = require 'vm'
+local config = require 'config'
local function typeHint(uri, start, finish)
local ast = files.getAst(uri)
@@ -24,6 +25,15 @@ local function typeHint(uri, start, finish)
if source.value and (source.value.type == 'function' or source.value.type == 'table') then
return
end
+ if source.parent.type == 'funcargs' then
+ if not config.config.hint.paramType then
+ return
+ end
+ else
+ if not config.config.hint.setType then
+ return
+ end
+ end
local infer = vm.getInferType(source, 0)
local src = source
if source.type == 'tablefield' then