summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-19 15:45:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-19 15:45:55 +0800
commit22f29e50a340c6f8ab8bcafe983d2af07d123429 (patch)
tree202f20524e2241fa8929a38de98231789a826e69 /script
parente36ca2b3e0629a8f67b4b2af34e938f66661e788 (diff)
downloadlua-language-server-22f29e50a340c6f8ab8bcafe983d2af07d123429.zip
fix #1072
Diffstat (limited to 'script')
-rw-r--r--script/core/formatting.lua2
-rw-r--r--script/core/rangeformatting.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/script/core/formatting.lua b/script/core/formatting.lua
index 49da6861..b52854a4 100644
--- a/script/core/formatting.lua
+++ b/script/core/formatting.lua
@@ -3,7 +3,7 @@ local files = require("files")
local log = require("log")
return function(uri, options)
- local text = files.getText(uri)
+ local text = files.getOriginText(uri)
local ast = files.getState(uri)
local status, formattedText = codeFormat.format(uri, text, options)
diff --git a/script/core/rangeformatting.lua b/script/core/rangeformatting.lua
index ccf2d21f..f64e9cda 100644
--- a/script/core/rangeformatting.lua
+++ b/script/core/rangeformatting.lua
@@ -4,7 +4,7 @@ local log = require("log")
local converter = require("proto.converter")
return function(uri, range, options)
- local text = files.getText(uri)
+ local text = files.getOriginText(uri)
local status, formattedText, startLine, endLine = codeFormat.range_format(
uri, text, range.start.line, range["end"].line, options)