Skip to content

Commit 1dbc362

Browse files
committed
feat: 完善代码填充相关内容更新;
1 parent 5de6143 commit 1dbc362

41 files changed

Lines changed: 2573 additions & 806 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3rdparty/WingCodeEdit

3rdparty/angel-lsp

Submodule angel-lsp updated 57 files

3rdparty/as-debugger/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## as-debugger
22

3-
提供支持 DAP 的 AngelScript 调试器,开源协议为 MIT,来源于 https://github.com/Paril/quake2-angelscript ,依赖`cppdap``fmt`,感谢[Paril](https://github.com/Paril)的贡献。
3+
提供 AngelScript 调试器,开源协议为 MIT,来源于 https://github.com/Paril/quake2-angelscript ,依赖`fmt`,感谢[Paril](https://github.com/Paril)的贡献。
44

5-
Provides AngelScript debugger with DAP support, from https://github.com/Paril/quake2-angelscript. The license is MIT and its dependencies are `cppdap` and `fmt`. Thanks to [Paril](https://github.com/Paril) for his contribution.
5+
Provides AngelScript debugger, from https://github.com/Paril/quake2-angelscript. The license is MIT and its dependency is `fmt`. Thanks to [Paril](https://github.com/Paril) for his contribution.

CMakeLists.txt

Lines changed: 55 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.18)
1+
cmake_minimum_required(VERSION 3.20)
22

33
project(WingHexExplorer2 LANGUAGES CXX)
44

@@ -27,6 +27,22 @@ option(ANGEL_LSP ON)
2727

2828
add_definitions(-DAS_NO_THREADS)
2929
add_definitions(-DWING_SYSTEM_NAME="${CMAKE_SYSTEM_NAME}")
30+
31+
if(DEFINED CMAKE_CXX_BYTE_ORDER AND CMAKE_CXX_BYTE_ORDER)
32+
if(CMAKE_CXX_BYTE_ORDER STREQUAL "BIG_ENDIAN")
33+
add_definitions(-DWING_LITTLE_ENDIAN=0)
34+
elseif(CMAKE_CXX_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
35+
add_definitions(-DWING_LITTLE_ENDIAN=1)
36+
else()
37+
message(
38+
FATAL_ERROR
39+
"CMAKE_CXX_BYTE_ORDER defined but unknown value: ${CMAKE_CXX_BYTE_ORDER}"
40+
)
41+
endif()
42+
else()
43+
message(FATAL_ERROR "CMAKE_CXX_BYTE_ORDER not set or empty")
44+
endif()
45+
3046
if(BUILD_TEST_PLUGIN)
3147
add_subdirectory(TestPlugin)
3248
add_subdirectory(TestBadPlugin)
@@ -119,7 +135,18 @@ set(ASCONSOLE_GRAMMAR
119135
src/grammar/ASConsole/AngelscriptConsoleParserBaseVisitor.h
120136
src/grammar/ASConsole/AngelscriptConsoleParserVisitor.h)
121137

122-
set(ANTLR4_GRAMMAR ${NUMCAL_GRAMMAR} ${CSTRUCT_GRAMMAR} ${ASCONSOLE_GRAMMAR})
138+
set(SNIPPET_GRAMMAR
139+
src/grammar/Snippet/SnippetVisitor.h
140+
src/grammar/Snippet/SnippetVisitor.cpp
141+
src/grammar/Snippet/SnippetParser.h
142+
src/grammar/Snippet/SnippetParser.cpp
143+
src/grammar/Snippet/SnippetLexer.h
144+
src/grammar/Snippet/SnippetLexer.cpp
145+
src/grammar/Snippet/SnippetBaseVisitor.h
146+
src/grammar/Snippet/SnippetBaseVisitor.cpp)
147+
148+
set(ANTLR4_GRAMMAR ${NUMCAL_GRAMMAR} ${CSTRUCT_GRAMMAR} ${ASCONSOLE_GRAMMAR}
149+
${SNIPPET_GRAMMAR})
123150

124151
set(ANGEL_SCRIPT_ADDON_ROOT
125152
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/AngelScript/sdk/add_on")
@@ -353,7 +380,9 @@ set(CLASS_SRC
353380
src/class/angelscriptconsolevisitor.h
354381
src/class/angelscriptconsolevisitor.cpp
355382
src/class/aswingcache.h
356-
src/class/aswingcache.cpp)
383+
src/class/aswingcache.cpp
384+
src/class/snippetprocessor.h
385+
src/class/snippetprocessor.cpp)
357386

358387
set(INTERNAL_PLG_SRC src/class/wingangelapi.h src/class/wingangelapi.cpp
359388
src/class/wingcstruct.h src/class/wingcstruct.cpp)
@@ -666,34 +695,25 @@ if(ANGEL_LSP)
666695
endif()
667696

668697
set(SRC_JS "${NODE_SUBDIR}/src/server.ts")
669-
set(DIST_JS "${BUILD_BIN_BUILD_DIR}/dist/server.ts")
698+
set(DIST_JS "${BUILD_BIN_BUILD_DIR}/dist/angelscript-language-server.js")
670699
set(OUT_BIN "${BUILD_BIN_DIR}/${OUT_NAME}")
671700

672701
find_program(NODE_EXE NAMES node)
673702
find_program(NPM_EXE NAMES npm)
674703
find_program(NPX_EXE NAMES npx)
675-
find_program(PKG_EXE NAMES pkg)
676704

677705
if(NOT NODE_EXE)
678706
message(FATAL_ERROR "Node.js not found. Install Node >= 18.")
679707
endif()
680708
if(NOT NPM_EXE)
681709
message(FATAL_ERROR "npm not found. Install npm.")
682710
endif()
711+
if(NOT NPX_EXE)
712+
message(FATAL_ERROR "npx not found. Install npx.")
713+
endif()
683714

684715
message(STATUS "Found node: ${NODE_EXE}")
685716
message(STATUS "Found npm: ${NPM_EXE}")
686-
if(PKG_EXE)
687-
message(STATUS "Found global pkg: ${PKG_EXE}")
688-
elseif(NPX_EXE)
689-
message(
690-
STATUS "Found npx: ${NPX_EXE} (will use npx pkg if pkg not global)")
691-
else()
692-
message(
693-
STATUS
694-
"No global pkg or npx found; will call 'npm exec pkg' as fallback"
695-
)
696-
endif()
697717

698718
if(WIN32)
699719
set(PKG_TARGET "node18-win-x64")
@@ -703,63 +723,32 @@ if(ANGEL_LSP)
703723
set(PKG_TARGET "node18-linux-x64")
704724
endif()
705725

706-
if(NPX_EXE)
707-
set(ESBUILD_CMD
708-
${NPX_EXE}
709-
esbuild
710-
"${SRC_JS}"
711-
--bundle
712-
--platform=node
713-
--target=node18
714-
"--outfile=${BUILD_BIN_BUILD_DIR}/dist/server.ts"
715-
--minify)
716-
else()
717-
set(ESBUILD_CMD
718-
${NPM_EXE}
719-
exec
720-
--yes
721-
esbuild
722-
--
723-
"${SRC_JS}"
724-
--bundle
725-
--platform=node
726-
--target=node18
727-
"--outfile=${BUILD_BIN_BUILD_DIR}/dist/server.ts"
728-
--minify)
729-
endif()
730-
731-
if(PKG_EXE)
732-
set(PKG_CMD ${PKG_EXE} "${DIST_JS}" --targets ${PKG_TARGET} --output
733-
"${OUT_BIN}")
734-
elseif(NPX_EXE)
735-
set(PKG_CMD
736-
${NPX_EXE}
737-
pkg
738-
"${DIST_JS}"
739-
--targets
740-
${PKG_TARGET}
741-
--output
742-
"${OUT_BIN}")
743-
else()
744-
set(PKG_CMD
745-
${NPM_EXE}
746-
exec
747-
--yes
748-
pkg
749-
--
750-
"${DIST_JS}"
751-
--targets
752-
${PKG_TARGET}
753-
--output
754-
"${OUT_BIN}")
755-
endif()
726+
set(ESBUILD_CMD
727+
${NPX_EXE}
728+
esbuild
729+
"${SRC_JS}"
730+
--bundle
731+
--platform=node
732+
--target=node18
733+
"--outfile=${DIST_JS}"
734+
--minify)
735+
736+
set(PKG_CMD
737+
${NPX_EXE}
738+
pkg
739+
"${DIST_JS}"
740+
--targets
741+
${PKG_TARGET}
742+
--output
743+
"${OUT_BIN}")
756744

757745
add_custom_command(
758746
OUTPUT ${DIST_JS}
759747
WORKING_DIRECTORY ${NODE_SUBDIR}
760748
COMMAND ${CMAKE_COMMAND} -E echo "[1] npm ci (local deps)"
761749
COMMAND ${NPM_EXE} ci --silent
762750
COMMAND ${CMAKE_COMMAND} -E echo "[2] building with esbuild"
751+
COMMAND ${NPX_EXE} tsc
763752
COMMAND ${ESBUILD_CMD}
764753
COMMENT "Building JS bundle with esbuild -> ${DIST_JS}"
765754
VERBATIM)

WingPlugin

0 commit comments

Comments
 (0)