summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-15 17:14:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-15 17:14:52 +0800
commit92b00f4e0bb805f2a9076cc89f3cedd37cc4b150 (patch)
tree9b6869390ecb4b7446320931bf3b46b1c9f05070 /script/core
parent8521ec04253fb6367260bfa74ad17e8d5a5e77fb (diff)
downloadlua-language-server-92b00f4e0bb805f2a9076cc89f3cedd37cc4b150.zip
fix #950
Diffstat (limited to 'script/core')
-rw-r--r--script/core/diagnostics/codestyle-check.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/script/core/diagnostics/codestyle-check.lua b/script/core/diagnostics/codestyle-check.lua
index 16623eca..34d55ee2 100644
--- a/script/core/diagnostics/codestyle-check.lua
+++ b/script/core/diagnostics/codestyle-check.lua
@@ -1,8 +1,8 @@
-local files = require("files")
-local codeFormat = require "code_format"
-local converter = require("proto.converter")
-local log = require("log")
-local config = require("config")
+local files = require 'files'
+local codeFormat = require 'code_format'
+local converter = require 'proto.converter'
+local log = require 'log'
+local pformatting = require 'provider.formatting'
---@async
@@ -12,6 +12,8 @@ return function(uri, callback)
return
end
+ pformatting.updateConfig(uri)
+
local status, diagnosticInfos = codeFormat.diagnose_file(uri, text)
if not status then
@@ -21,12 +23,12 @@ return function(uri, callback)
return
end
-
+
if diagnosticInfos then
- for _, diagnosticInfo in pairs(diagnosticInfos) do
+ for _, diagnosticInfo in ipairs(diagnosticInfos) do
callback {
- start = converter.unpackPosition(uri, diagnosticInfo.range.start),
- finish = converter.unpackPosition(uri, diagnosticInfo.range["end"]),
+ start = converter.unpackPosition(uri, diagnosticInfo.range.start),
+ finish = converter.unpackPosition(uri, diagnosticInfo.range["end"]),
message = diagnosticInfo.message
}
end