📦 更新lsp对tree-sitter的依赖
🚀 优化部分无关代码 🐛 修复`ast`的测试代码
This commit is contained in:
@@ -136,7 +136,7 @@ int main(int argc, char* argv[])
|
||||
bool test_incremental = false;
|
||||
|
||||
// 默认打印选项
|
||||
PrintOptions opts = PrintOptions::Default();
|
||||
debug::PrintOptions opts = debug::PrintOptions::Default();
|
||||
|
||||
// 解析命令行参数
|
||||
for (int i = 1; i < argc; ++i)
|
||||
@@ -149,11 +149,11 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
else if (arg == "-v" || arg == "--verbose")
|
||||
{
|
||||
opts = PrintOptions::Verbose();
|
||||
opts = debug::PrintOptions::Verbose();
|
||||
}
|
||||
else if (arg == "-c" || arg == "--compact")
|
||||
{
|
||||
opts = PrintOptions::Compact();
|
||||
opts = debug::PrintOptions::Compact();
|
||||
}
|
||||
else if (arg == "-s" || arg == "--show-source")
|
||||
{
|
||||
@@ -228,10 +228,10 @@ int main(int argc, char* argv[])
|
||||
|
||||
// 打印摘要
|
||||
std::cout << "\n";
|
||||
std::cout << Color::BrightBlue << "========================================\n"
|
||||
<< Color::Reset;
|
||||
std::cout << Color::BrightCyan << "Summary:\n"
|
||||
<< Color::Reset;
|
||||
std::cout << debug::Color::BrightBlue << "========================================\n"
|
||||
<< debug::Color::Reset;
|
||||
std::cout << debug::Color::BrightCyan << "Summary:\n"
|
||||
<< debug::Color::Reset;
|
||||
std::cout << " File: " << filepath << "\n";
|
||||
std::cout << " Size: " << source.length() << " bytes\n";
|
||||
|
||||
@@ -243,20 +243,20 @@ int main(int argc, char* argv[])
|
||||
std::cout << " Errors: ";
|
||||
if (result.HasErrors())
|
||||
{
|
||||
std::cout << Color::BrightRed << result.errors.size() << " ✗" << Color::Reset << "\n";
|
||||
std::cout << " Status: " << Color::BrightRed << "FAILED" << Color::Reset << "\n";
|
||||
std::cout << debug::Color::BrightRed << result.errors.size() << " ✗" << debug::Color::Reset << "\n";
|
||||
std::cout << " Status: " << debug::Color::BrightRed << "FAILED" << debug::Color::Reset << "\n";
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << Color::BrightGreen << "0 ✓" << Color::Reset << "\n";
|
||||
std::cout << " Status: " << Color::BrightGreen << "SUCCESS" << Color::Reset << "\n";
|
||||
std::cout << debug::Color::BrightGreen << "0 ✓" << debug::Color::Reset << "\n";
|
||||
std::cout << " Status: " << debug::Color::BrightGreen << "SUCCESS" << debug::Color::Reset << "\n";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << Color::BrightRed << "Error: " << e.what() << Color::Reset << "\n";
|
||||
std::cerr << debug::Color::BrightRed << "Error: " << e.what() << debug::Color::Reset << "\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user