summaryrefslogtreecommitdiff
path: root/script/core/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-25 23:27:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-25 23:27:54 +0800
commitd74aba7d2372d3f151bb53b27adccd01509d88f6 (patch)
tree6bedd64c7a40deae768536e0aefd9668f3c946d0 /script/core/diagnostics
parent26732327848c0eaa8dd76abbd127d4a7a5a12121 (diff)
downloadlua-language-server-d74aba7d2372d3f151bb53b27adccd01509d88f6.zip
fix message of `newline-call` and `newfield-call`
Diffstat (limited to 'script/core/diagnostics')
-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