summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/diagnostics/newfield-call.lua5
-rw-r--r--script/core/diagnostics/newline-call.lua5
2 files changed, 6 insertions, 4 deletions
diff --git a/script/core/diagnostics/newfield-call.lua b/script/core/diagnostics/newfield-call.lua
index e22dcffe..bd114959 100644
--- a/script/core/diagnostics/newfield-call.lua
+++ b/script/core/diagnostics/newfield-call.lua
@@ -2,6 +2,7 @@ local files = require 'files'
local guide = require 'parser.guide'
local lang = require 'language'
local await = require 'await'
+local sub = require 'core.substring'
---@async
return function (uri, callback)
@@ -36,8 +37,8 @@ return function (uri, callback)
start = call.start,
finish = call.finish,
message = lang.script('DIAG_PREFIELD_CALL'
- , text:sub(func.start, func.finish)
- , text:sub(args.start, args.finish)
+ , sub(state)(func.start + 1, func.finish)
+ , sub(state)(args.start + 1, args.finish)
)
}
end
diff --git a/script/core/diagnostics/newline-call.lua b/script/core/diagnostics/newline-call.lua
index 6460d3a7..2ba2ce03 100644
--- a/script/core/diagnostics/newline-call.lua
+++ b/script/core/diagnostics/newline-call.lua
@@ -2,6 +2,7 @@ local files = require 'files'
local guide = require 'parser.guide'
local lang = require 'language'
local await = require 'await'
+local sub = require 'core.substring'
---@async
return function (uri, callback)
@@ -44,8 +45,8 @@ return function (uri, callback)
start = node.start,
finish = args.finish,
message = lang.script('DIAG_PREVIOUS_CALL'
- , text:sub(node.start, node.finish)
- , text:sub(args.start, args.finish)
+ , sub(state)(node.start + 1, node.finish)
+ , sub(state)(args.start + 1, args.finish)
),
}
end