diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-28 21:35:12 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-28 21:35:12 +0800 |
commit | 31adc884dbe7de245d7cd0d19f901d2490be77f7 (patch) | |
tree | d2db1e048bcc51f8619dbc319c0eb3d83a8ab920 /script | |
parent | 29458b6a44674ad2b4b28cb6f81b5d6b0f4a4875 (diff) | |
download | lua-language-server-31adc884dbe7de245d7cd0d19f901d2490be77f7.zip |
#587
Diffstat (limited to 'script')
-rw-r--r-- | script/core/diagnostics/duplicate-doc-field.lua | 5 | ||||
-rw-r--r-- | script/core/noder.lua | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/script/core/diagnostics/duplicate-doc-field.lua b/script/core/diagnostics/duplicate-doc-field.lua index 1ee27ff2..ab3084c9 100644 --- a/script/core/diagnostics/duplicate-doc-field.lua +++ b/script/core/diagnostics/duplicate-doc-field.lua @@ -1,5 +1,6 @@ local files = require 'files' local lang = require 'language' +local noder = require 'core.noder' return function (uri, callback) local state = files.getState(uri) @@ -19,6 +20,10 @@ return function (uri, callback) elseif doc.type == 'doc.field' then if mark then local name = doc.field[1] + local eventName = noder.getFieldEventName(doc) + if eventName then + name = name .. '|' .. eventName + end if mark[name] then callback { start = doc.field.start, diff --git a/script/core/noder.lua b/script/core/noder.lua index 030c69cf..66f88e34 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -1638,6 +1638,8 @@ function m.eachID(noders) return next, noders.source end +m.getFieldEventName = getFieldEventName + ---获取对象的noders ---@param source parser.guide.object ---@return noders |