summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
Diffstat (limited to 'script/core')
-rw-r--r--script/core/diagnostics/duplicate-doc-field.lua5
-rw-r--r--script/core/noder.lua2
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