From 6efd53aed4ab9eb413df1ba3f6cc8ae65c7aaca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 15 Mar 2019 14:12:44 +0800 Subject: =?UTF-8?q?=E5=9C=A8=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=86=85=E9=83=A8?= =?UTF-8?q?=E4=B8=8D=E6=8F=90=E7=A4=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/signature.lua | 5 +++++ server/test/signature/init.lua | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'server') 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) -- cgit v1.2.3