♻️ refactor(lsp_server): move entrypoints out of named modules
- export Run() from launcher module and add non-module main TU - apply same pattern to module-based test executables - migrate utils/string implementation fully into string.cppm and drop string.cpp - point clangd to linux build compilation database
This commit is contained in:
@@ -18,10 +18,10 @@ endif()
|
||||
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
|
||||
|
||||
set(SOURCES
|
||||
main.cc
|
||||
test.cppm
|
||||
debug_printer.cppm
|
||||
../../src/utils/string.cppm
|
||||
../../src/utils/string.cpp
|
||||
../../src/tree-sitter/scanner.c
|
||||
../../src/tree-sitter/parser.c)
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import lsp.test.ast.main;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
return Run(argc, argv);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ void PrintUsage(const char* program_name)
|
||||
std::cout << " " << program_name << " test.tsf -s -n # Show source without colors\n";
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
export int Run(int argc, char* argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
set(SOURCES
|
||||
main.cc
|
||||
test_main.cppm)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import lsp.test.lsp_any.main;
|
||||
|
||||
int main()
|
||||
{
|
||||
return Run();
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import lsp.test.lsp_any.transformer;
|
||||
import lsp.test.lsp_any.facade;
|
||||
import lsp.test.lsp_any.common;
|
||||
|
||||
int main()
|
||||
export int Run()
|
||||
{
|
||||
lsp::test::TestRunner runner;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ endif()
|
||||
|
||||
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
|
||||
|
||||
add_executable(test_module main.cppm)
|
||||
add_executable(test_module main.cppm main.cc)
|
||||
target_sources(
|
||||
test_module
|
||||
PRIVATE
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import lsp.test.module_demo.main;
|
||||
|
||||
int main()
|
||||
{
|
||||
return Run();
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import std;
|
||||
import math;
|
||||
import math2;
|
||||
|
||||
int main()
|
||||
export int Run()
|
||||
{
|
||||
std::cout << "hello std module\n";
|
||||
std::vector<int> v{ 1, 2, 3 };
|
||||
|
||||
@@ -15,6 +15,7 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
set(SOURCES
|
||||
main.cc
|
||||
test_async_executor.cppm)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import lsp.test.scheduler.async_executor;
|
||||
|
||||
int main()
|
||||
{
|
||||
return Run();
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
int main()
|
||||
export int Run()
|
||||
{
|
||||
SchedulerTestSuite suite;
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ endif()
|
||||
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
|
||||
|
||||
set(SOURCES
|
||||
main.cc
|
||||
test_semantic.cppm
|
||||
../../src/utils/string.cppm
|
||||
../../src/utils/string.cpp
|
||||
../../src/language/symbol/internal/builder.cppm
|
||||
../../src/language/symbol/internal/store.cppm
|
||||
../../src/language/symbol/internal/table.cppm
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import lsp.test.semantic.main;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return Run(argc, argv);
|
||||
}
|
||||
@@ -436,7 +436,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
export int Run(int argc, char** argv)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -18,9 +18,9 @@ endif()
|
||||
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
|
||||
|
||||
set(SOURCES
|
||||
main.cc
|
||||
test.cppm
|
||||
../../src/utils/string.cppm
|
||||
../../src/utils/string.cpp
|
||||
../../src/language/symbol/internal/builder.cppm
|
||||
../../src/language/symbol/internal/store.cppm
|
||||
../../src/language/symbol/internal/table.cppm
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import lsp.test.symbol.main;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
return Run(argc, argv);
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@ void AnalyzeFile(const Options& options)
|
||||
|
||||
// ==================== 主程序 ====================
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
export int Run(int argc, char* argv[])
|
||||
{
|
||||
Options options;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user