🎨 style(core): normalize lifecycle implementation
This commit is contained in:
@@ -45,8 +45,7 @@ export namespace lsp::core
|
||||
public:
|
||||
ExecutionContext(scheduler::async_executor::AsyncExecutor& scheduler,
|
||||
manager::ManagerHub& manager_hub,
|
||||
std::stop_token stop_token = {})
|
||||
: async_executor_(scheduler),
|
||||
std::stop_token stop_token = {}) : async_executor_(scheduler),
|
||||
manager_hub_(manager_hub),
|
||||
stop_token_(stop_token)
|
||||
{
|
||||
@@ -120,8 +119,8 @@ namespace lsp::core
|
||||
{
|
||||
RequestDispatcher::RequestDispatcher(
|
||||
scheduler::async_executor::AsyncExecutor& scheduler,
|
||||
manager::ManagerHub& manager_hub)
|
||||
: async_executor_(scheduler), manager_hub_(manager_hub)
|
||||
manager::ManagerHub& manager_hub) : async_executor_(scheduler),
|
||||
manager_hub_(manager_hub)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -171,8 +171,7 @@ namespace lsp::test::provider
|
||||
manager::ManagerHub hub{};
|
||||
core::ExecutionContext context;
|
||||
|
||||
ProviderEnv()
|
||||
: context(scheduler, hub)
|
||||
ProviderEnv() : context(scheduler, hub)
|
||||
{
|
||||
hub.Initialize();
|
||||
}
|
||||
@@ -1411,8 +1410,7 @@ namespace lsp::test::provider
|
||||
auto tooltip_it = resolved.find("tooltip");
|
||||
assertTrue(tooltip_it != resolved.end(), "InlayHint resolve should set tooltip");
|
||||
assertTrue(tooltip_it->second.Is<protocol::string>(), "InlayHint tooltip should be string");
|
||||
assertEqual(std::string("param: int"), tooltip_it->second.Get<protocol::string>(),
|
||||
"InlayHint tooltip should use detail");
|
||||
assertEqual(std::string("param: int"), tooltip_it->second.Get<protocol::string>(), "InlayHint tooltip should use detail");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2891,10 +2889,8 @@ namespace lsp::test::provider
|
||||
{
|
||||
protocol::LSPObject diagnostic;
|
||||
diagnostic["range"] = protocol::LSPObject{
|
||||
{ "start", protocol::LSPObject{ { "line", static_cast<protocol::integer>(error.location.start_line) },
|
||||
{ "character", static_cast<protocol::integer>(error.location.start_column) } } },
|
||||
{ "end", protocol::LSPObject{ { "line", static_cast<protocol::integer>(error.location.end_line) },
|
||||
{ "character", static_cast<protocol::integer>(error.location.end_column) } } },
|
||||
{ "start", protocol::LSPObject{ { "line", static_cast<protocol::integer>(error.location.start_line) }, { "character", static_cast<protocol::integer>(error.location.start_column) } } },
|
||||
{ "end", protocol::LSPObject{ { "line", static_cast<protocol::integer>(error.location.end_line) }, { "character", static_cast<protocol::integer>(error.location.end_column) } } },
|
||||
};
|
||||
diagnostic["message"] = error.message;
|
||||
diagnostics.emplace_back(std::move(diagnostic));
|
||||
|
||||
@@ -114,8 +114,7 @@ namespace lsp::test::provider
|
||||
manager::ManagerHub hub{};
|
||||
core::ExecutionContext context;
|
||||
|
||||
ProviderEnv()
|
||||
: context(scheduler, hub)
|
||||
ProviderEnv() : context(scheduler, hub)
|
||||
{
|
||||
hub.Initialize();
|
||||
}
|
||||
@@ -126,10 +125,8 @@ namespace lsp::test::provider
|
||||
const std::string& expected_name)
|
||||
{
|
||||
Provider provider;
|
||||
assertEqual(expected_method, provider.GetMethod(),
|
||||
"GetMethod mismatch for " + expected_name);
|
||||
assertEqual(expected_name, provider.GetProviderName(),
|
||||
"GetProviderName mismatch for " + expected_name);
|
||||
assertEqual(expected_method, provider.GetMethod(), "GetMethod mismatch for " + expected_name);
|
||||
assertEqual(expected_name, provider.GetProviderName(), "GetProviderName mismatch for " + expected_name);
|
||||
}
|
||||
|
||||
template<typename Provider>
|
||||
|
||||
Reference in New Issue
Block a user