From 664b740fa40b22180f5055a543c465cb504290cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 2 Jun 2021 20:44:33 +0800 Subject: update --- script/core/diagnostics/undefined-global.lua | 1 - script/core/infer.lua | 5 ++++- script/core/searcher.lua | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'script/core') diff --git a/script/core/diagnostics/undefined-global.lua b/script/core/diagnostics/undefined-global.lua index 439a1854..faf5f150 100644 --- a/script/core/diagnostics/undefined-global.lua +++ b/script/core/diagnostics/undefined-global.lua @@ -3,7 +3,6 @@ local vm = require 'vm' local lang = require 'language' local config = require 'config' local guide = require 'parser.guide' -local linker = require 'core.linker' local requireLike = { ['include'] = true, diff --git a/script/core/infer.lua b/script/core/infer.lua index c3e507cc..77236811 100644 --- a/script/core/infer.lua +++ b/script/core/infer.lua @@ -216,6 +216,7 @@ end local function cleanInfers(infers) local version = config.config.runtime.version local enableInteger = version == 'Lua 5.3' or version == 'Lua 5.4' + infers['unknown'] = nil if infers['any'] and infers['nil'] then infers['nil'] = nil end @@ -403,7 +404,9 @@ local function searchInfer(source, infers) local docName = m.getDocName(source) if docName then infers[docName] = true - infers[CLASS] = true + if docName ~= 'unknown' then + infers[CLASS] = true + end if docName == 'table' then infers[TABLE] = true end diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 121e90c6..2b8eed41 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -9,6 +9,7 @@ local NONE = {'NONE'} local LAST = {'LAST'} local ignoredIDs = { + ['dn:unknown'] = true, ['dn:nil'] = true, ['dn:any'] = true, ['dn:boolean'] = true, -- cgit v1.2.3