MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / Reformat

Method Reformat

CodeFormatServer/src/Service/CodeActionService.cpp:58–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void CodeActionService::Reformat(lsp::Diagnostic &diagnostic, std::shared_ptr<lsp::CodeActionParams> param,
59 std::shared_ptr<lsp::CodeActionResult> result) {
60 auto &action = result->actions.emplace_back();
61 std::string title = "Reformat current line";
62 action.title = title;
63 action.command.title = title;
64 action.command.command = _owner->GetService<CommandService>()->GetCommand(CommandService::Command::Reformat);
65 action.command.arguments.emplace_back(param->textDocument.uri);
66 action.command.arguments.push_back(param->range.Serialize());
67
68 action.kind = lsp::CodeActionKind::QuickFix;
69}
70
71void CodeActionService::Spell(lsp::Diagnostic &diagnostic, std::shared_ptr<lsp::CodeActionParams> param,
72 std::shared_ptr<lsp::CodeActionResult> result) {

Callers

nothing calls this directly

Calls 3

GetCommandMethod · 0.80
push_backMethod · 0.45
SerializeMethod · 0.45

Tested by

no test coverage detected