diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-07-30 17:22:02 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-07-30 17:22:02 +0800 |
commit | e760b69c8104d0bf6ef17f6f033265908557743d (patch) | |
tree | 3d4779c43fedbd5eb57f44996f18729283790c68 /script/core | |
parent | 2a48dee3f216992150f05e288fa6a439c864f0b8 (diff) | |
download | lua-language-server-e760b69c8104d0bf6ef17f6f033265908557743d.zip |
拆分成选项
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/diagnostics/unused-function.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/script/core/diagnostics/unused-function.lua b/script/core/diagnostics/unused-function.lua index a873375f..1145036d 100644 --- a/script/core/diagnostics/unused-function.lua +++ b/script/core/diagnostics/unused-function.lua @@ -5,6 +5,7 @@ local define = require 'proto.define' local lang = require 'language' local await = require 'await' local client = require 'client' +local util = require 'utility' local function isToBeClosed(source) if not source.attrs then @@ -105,8 +106,11 @@ return function (uri, callback) turnBlack(source, black, white, links) end + local tagSupports = client.getAbility('textDocument.completion.completionItem.tagSupport.valueSet') + local supportUnnecessary = tagSupports and util.arrayHas(tagSupports, define.DiagnosticTag.Unnecessary) + for source in pairs(white) do - if client.isVSCode() then + if supportUnnecessary then callback { start = source.start, finish = source.finish, |