diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-02-22 14:33:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 14:33:48 +0800 |
commit | 60a3a703d5c83a6b83593d41df8c07096c26c85c (patch) | |
tree | e59992179500dc3b0bb961b4033be350cd5420a5 | |
parent | d57c21e585e7285583b7379e9e955da3b1345508 (diff) | |
parent | c920f9630e5a1aa88c993ad22e786a2f9232b21e (diff) | |
download | lua-language-server-60a3a703d5c83a6b83593d41df8c07096c26c85c.zip |
Merge pull request #962 from CppCXY/master
编辑器设置优先
m--------- | 3rd/EmmyLuaCodeStyle | 0 | ||||
-rw-r--r-- | script/core/formatting.lua | 8 | ||||
-rw-r--r-- | script/core/rangeformatting.lua | 4 | ||||
-rw-r--r-- | script/provider/provider.lua | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle -Subproject f580f0ddfcd78982882d0686f69fa18a63465b4 +Subproject da71a27a82d36c4c8b031f9d53ca6935894970b 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 diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 5672c10c..3e8fec24 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -1020,7 +1020,7 @@ m.register 'textDocument/formatting' { pformatting.updateConfig(uri) local core = require 'core.formatting' - local edits = core(uri) + local edits = core(uri, params.options) if not edits or #edits == 0 then return nil end @@ -1058,7 +1058,7 @@ m.register 'textDocument/rangeFormatting' { pformatting.updateConfig(uri) local core = require 'core.rangeformatting' - local edits = core(uri, params.range) + local edits = core(uri, params.range, params.options) if not edits or #edits == 0 then return nil end |