summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-23 17:56:26 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-23 17:56:26 +0800
commit3de3402c82c4ea46f69d0a96bea7faf1ad68ea06 (patch)
tree32827d7d1e7c0b1ecd5386cd638498176d9aa866 /script/core
parentf8e2955268708728a1f83743d0b2000d2e089539 (diff)
parentb37ebceffe695defd7e7976e653ce127618614c0 (diff)
downloadlua-language-server-3de3402c82c4ea46f69d0a96bea7faf1ad68ea06.zip
Merge commit 'b37ebceffe695defd7e7976e653ce127618614c0' into 3.0
Diffstat (limited to 'script/core')
-rw-r--r--script/core/formatting.lua8
-rw-r--r--script/core/rangeformatting.lua4
2 files changed, 6 insertions, 6 deletions
diff --git a/script/core/formatting.lua b/script/core/formatting.lua
index 6c57b8c2..49da6861 100644
--- a/script/core/formatting.lua
+++ b/script/core/formatting.lua
@@ -1,11 +1,11 @@
local codeFormat = require("code_format")
-local files = require("files")
-local log = require("log")
+local files = require("files")
+local log = require("log")
-return function(uri)
+return function(uri, options)
local text = files.getText(uri)
local ast = files.getState(uri)
- local status, formattedText = codeFormat.format(uri, text)
+ local status, formattedText = codeFormat.format(uri, text, options)
if not status then
if formattedText ~= nil then
diff --git a/script/core/rangeformatting.lua b/script/core/rangeformatting.lua
index de9516c1..ccf2d21f 100644
--- a/script/core/rangeformatting.lua
+++ b/script/core/rangeformatting.lua
@@ -3,10 +3,10 @@ local files = require("files")
local log = require("log")
local converter = require("proto.converter")
-return function(uri, range)
+return function(uri, range, options)
local text = files.getText(uri)
local status, formattedText, startLine, endLine = codeFormat.range_format(
- uri, text, range.start.line, range["end"].line)
+ uri, text, range.start.line, range["end"].line, options)
if not status then
if formattedText ~= nil then