Skip to content

Commit 47ec2b9

Browse files
committed
集成code_format
1 parent 661b380 commit 47ec2b9

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "3rd/love-api"]
1414
path = 3rd/love-api
1515
url = https://github.com/love2d-community/love-api
16+
[submodule "3rd/EmmyLuaCodeStyle"]
17+
path = 3rd/EmmyLuaCodeStyle
18+
url = https://github.com/CppCXY/EmmyLuaCodeStyle

3rd/EmmyLuaCodeStyle

Submodule EmmyLuaCodeStyle added at fb3341b

make.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ lm.bindir = "bin/"..platform.OS
66

77
lm.EXE_DIR = ""
88
lm:import "3rd/bee.lua/make.lua"
9+
lm:import "make/code_style.lua"
910

1011
lm:source_set 'lpeglabel' {
1112
rootdir = '3rd',
@@ -17,7 +18,7 @@ lm:source_set 'lpeglabel' {
1718
}
1819

1920
lm:executable "lua-language-server" {
20-
deps = {"lpeglabel", "source_bootstrap"},
21+
deps = {"lpeglabel", "source_bootstrap", "codeFormatLib"},
2122
includes = {
2223
"3rd/bee.lua",
2324
"3rd/bee.lua/3rd/lua",

make/code_style.lua

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
local lm = require "luamake"
2+
3+
lm:static_library 'luaParser' {
4+
rootdir = '../3rd/EmmyLuaCodeStyle',
5+
includes = "include",
6+
sources = "LuaParser/src/*.cpp",
7+
defines = {
8+
'MAXRECLEVEL=1000',
9+
},
10+
}
11+
12+
lm:static_library 'codeService' {
13+
deps = {"luaParser"},
14+
rootdir = '../3rd/EmmyLuaCodeStyle',
15+
includes = "include",
16+
sources = {
17+
"CodeService/src/*.cpp",
18+
"CodeService/src/FormatElement/*.cpp"
19+
},
20+
defines = {
21+
'MAXRECLEVEL=1000',
22+
},
23+
}
24+
25+
lm:static_library 'codeFormatLib' {
26+
deps = {"codeService"},
27+
rootdir = '../3rd/EmmyLuaCodeStyle',
28+
includes = {
29+
"include",
30+
"../bee.lua/3rd/lua"
31+
},
32+
sources = "CodeFormatLib/src/*.cpp",
33+
defines = {
34+
'MAXRECLEVEL=1000',
35+
},
36+
}

make/modules.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
extern "C" int luaopen_lpeglabel (lua_State *L);
44
static ::bee::lua::callfunc _init(::bee::lua::register_module, "lpeglabel", luaopen_lpeglabel);
5+
6+
extern "C" int luaopen_code_format(lua_State *L);
7+
static ::bee::lua::callfunc _init_code_format(::bee::lua::register_module, "code_format", luaopen_code_format);

0 commit comments

Comments
 (0)