summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-15 14:12:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-15 14:12:44 +0800
commit6efd53aed4ab9eb413df1ba3f6cc8ae65c7aaca5 (patch)
tree76427352fca5f7bf4b8b9e5760caffc68a59647f /server
parenta4bff71503fcf5d5a1bff8dc3ce209050afea86c (diff)
downloadlua-language-server-6efd53aed4ab9eb413df1ba3f6cc8ae65c7aaca5.zip
在字符串内部不提示参数
Diffstat (limited to 'server')
-rw-r--r--server/src/core/signature.lua5
-rw-r--r--server/test/signature/init.lua8
2 files changed, 13 insertions, 0 deletions
diff --git a/server/src/core/signature.lua b/server/src/core/signature.lua
index 6cb3bca5..cafe2799 100644
--- a/server/src/core/signature.lua
+++ b/server/src/core/signature.lua
@@ -2,6 +2,7 @@ local getFunctionHover = require 'core.hover.function'
local getFunctionHoverAsLib = require 'core.hover.lib_function'
local findLib = require 'core.find_lib'
local buildValueName = require 'core.hover.name'
+local findSource = require 'core.find_source'
local function findCall(vm, pos)
local results = {}
@@ -64,6 +65,10 @@ local function getHover(call, pos)
end
return function (vm, pos)
+ local source = findSource(vm, pos)
+ if source.type == 'string' then
+ return
+ end
local calls = findCall(vm, pos)
if not calls or #calls == 0 then
return nil
diff --git a/server/test/signature/init.lua b/server/test/signature/init.lua
index acca3260..cf335f05 100644
--- a/server/test/signature/init.lua
+++ b/server/test/signature/init.lua
@@ -98,3 +98,11 @@ TEST [[
(''):sub(1)@
]]
(nil)
+
+TEST [[
+local function f(a, b, c)
+end
+
+f(1, 'string@')
+]]
+(nil)