diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-10-28 20:32:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 20:32:11 +0800 |
commit | 20199bfca5d85f4798310f3219ff7b56e207ba5f (patch) | |
tree | 5e46f4564ac926ff7fa294a58f474a750dc50331 | |
parent | 9fe03a17808d7ee0e055a7cdeb0b52b1d8ce690f (diff) | |
download | lua-language-server-20199bfca5d85f4798310f3219ff7b56e207ba5f.zip |
Revert "格式化"
-rw-r--r-- | .gitmodules | 3 | ||||
m--------- | 3rd/EmmyLuaCodeStyle | 0 | ||||
-rw-r--r-- | make.lua | 3 | ||||
-rw-r--r-- | make/code_style.lua | 36 | ||||
-rw-r--r-- | make/modules.cpp | 3 | ||||
-rw-r--r-- | script/core/formatting.lua | 18 | ||||
-rw-r--r-- | script/provider/capability.lua | 1 | ||||
-rw-r--r-- | script/provider/provider.lua | 23 |
8 files changed, 1 insertions, 86 deletions
diff --git a/.gitmodules b/.gitmodules index 51090623..92e225d5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,6 +13,3 @@ [submodule "3rd/love-api"] path = 3rd/love-api url = https://github.com/love2d-community/love-api -[submodule "3rd/EmmyLuaCodeStyle"] - path = 3rd/EmmyLuaCodeStyle - url = https://github.com/CppCXY/EmmyLuaCodeStyle diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle deleted file mode 160000 -Subproject fb3341b13df2cfcda9d232f88c44c69c01f7d8a @@ -6,7 +6,6 @@ lm.bindir = "bin/"..platform.OS lm.EXE_DIR = "" lm:import "3rd/bee.lua/make.lua" -lm:import "make/code_style.lua" lm:source_set 'lpeglabel' { rootdir = '3rd', @@ -18,7 +17,7 @@ lm:source_set 'lpeglabel' { } lm:executable "lua-language-server" { - deps = {"lpeglabel", "source_bootstrap", "codeFormatLib"}, + deps = {"lpeglabel", "source_bootstrap"}, includes = { "3rd/bee.lua", "3rd/bee.lua/3rd/lua", diff --git a/make/code_style.lua b/make/code_style.lua deleted file mode 100644 index a97bc930..00000000 --- a/make/code_style.lua +++ /dev/null @@ -1,36 +0,0 @@ -local lm = require "luamake" - -lm:static_library 'luaParser' { - rootdir = '../3rd/EmmyLuaCodeStyle', - includes = "include", - sources = "LuaParser/src/*.cpp", - defines = { - 'MAXRECLEVEL=1000', - }, -} - -lm:static_library 'codeService' { - deps = {"luaParser"}, - rootdir = '../3rd/EmmyLuaCodeStyle', - includes = "include", - sources = { - "CodeService/src/*.cpp", - "CodeService/src/FormatElement/*.cpp" - }, - defines = { - 'MAXRECLEVEL=1000', - }, -} - -lm:static_library 'codeFormatLib' { - deps = {"codeService"}, - rootdir = '../3rd/EmmyLuaCodeStyle', - includes = { - "include", - "../bee.lua/3rd/lua" - }, - sources = "CodeFormatLib/src/*.cpp", - defines = { - 'MAXRECLEVEL=1000', - }, -} diff --git a/make/modules.cpp b/make/modules.cpp index b10ae798..f72fc058 100644 --- a/make/modules.cpp +++ b/make/modules.cpp @@ -2,6 +2,3 @@ extern "C" int luaopen_lpeglabel (lua_State *L); static ::bee::lua::callfunc _init(::bee::lua::register_module, "lpeglabel", luaopen_lpeglabel); - -extern "C" int luaopen_code_format(lua_State *L); -static ::bee::lua::callfunc _init_code_format(::bee::lua::register_module, "code_format", luaopen_code_format); diff --git a/script/core/formatting.lua b/script/core/formatting.lua deleted file mode 100644 index 3b460849..00000000 --- a/script/core/formatting.lua +++ /dev/null @@ -1,18 +0,0 @@ -local files = require 'files' -local guide = require 'parser.guide' -local code_format = require "code_format" - -return function(uri) - local text = files.getText(uri) - local state = files.getState(uri) - - local status, formatedText = code_format.format(text) - local startPosition = guide.offsetToPosition(state, 0) - local endPosition = guide.offsetToPosition(state, string.len(text)) - - return status, { - formatedText = formatedText, - start = startPosition, - finish = endPosition - } -end diff --git a/script/provider/capability.lua b/script/provider/capability.lua index 43464483..76cadc0d 100644 --- a/script/provider/capability.lua +++ b/script/provider/capability.lua @@ -92,7 +92,6 @@ function m.getIniter() firstTriggerCharacter = '\n', moreTriggerCharacter = nil, -- string[] }, - documentFormattingProvider = true --documentOnTypeFormattingProvider = { -- firstTriggerCharacter = '}', --}, diff --git a/script/provider/provider.lua b/script/provider/provider.lua index c005747a..ac16c4e3 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -801,29 +801,6 @@ proto.on('textDocument/onTypeFormatting', function (params) return results end) -proto.on('textDocument/formatting', function (params) - workspace.awaitReady() - local _ <close> = progress.create(lang.script.WINDOW_PROCESSING_TYPE_FORMATTING, 0.5) - local uri = params.textDocument.uri - if not files.exists(uri) then - return nil - end - local core = require 'core.formatting' - - local status, result = core(uri) - if status then - local results = { - { - range = converter.packRange(uri, result.start, result.finish), - newText = result.formatedText, - } - } - return results - end - - return nil -end) - proto.on('$/cancelRequest', function (params) proto.close(params.id, define.ErrorCodes.RequestCancelled) end) |