🐛 fix(symbol): index all system tsf files

Do not drop system-library .tsf units when the file stem differs from top-level symbols.

Add test_provider support for --interpreter=... and an interpreter integration test that validates full indexing plus completion+resolve snippet.
This commit is contained in:
csh
2025-12-24 12:02:30 +08:00
parent 02864dda89
commit adec86a3aa
5 changed files with 244 additions and 7 deletions
+12 -1
View File
@@ -7,6 +7,7 @@ import std;
import lsp.test.framework;
import lsp.test.provider.completion;
import lsp.test.provider.definitions;
import lsp.test.provider.interpreter;
import lsp.test.provider.json_flow;
import lsp.test.provider.json_provider_coverage;
import lsp.test.provider.misc;
@@ -22,10 +23,18 @@ export int Run(int argc, char** argv)
for (int i = 1; i < argc; ++i)
{
if (std::string_view(argv[i]) == "--exit-provider")
std::string_view arg(argv[i]);
if (arg == "--exit-provider")
{
return lsp::test::provider::RunExitProviderChild();
}
constexpr std::string_view kInterpreterPrefix = "--interpreter=";
if (arg.starts_with(kInterpreterPrefix))
{
lsp::test::provider::SetInterpreterPath(std::string(arg.substr(kInterpreterPrefix.size())));
}
}
lsp::test::TestRunner runner;
@@ -40,6 +49,8 @@ export int Run(int argc, char** argv)
lsp::test::provider::CompletionTests::Register(runner);
std::cout << " - Definition tests" << std::endl;
lsp::test::provider::DefinitionTests::Register(runner);
std::cout << " - Interpreter tests" << std::endl;
lsp::test::provider::InterpreterTests::Register(runner);
std::cout << " - JSON flow tests" << std::endl;
lsp::test::provider::JsonFlowTests::Register(runner);
std::cout << " - JSON provider coverage tests" << std::endl;