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

Method SpellCorrect

CodeFormatServer/src/Service/CommandService.cpp:101–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void CommandService::SpellCorrect(std::shared_ptr<lsp::ExecuteCommandParams> params) {
102 if (params->arguments.size() < 3) {
103 return;
104 }
105
106 std::string uri = params->arguments[0];
107 lsp::Range range;
108
109 range.Deserialize(params->arguments[1]);
110
111 std::string newText = params->arguments[2];
112
113 auto applyParams = std::make_shared<lsp::ApplyWorkspaceEditParams>();
114 auto it = applyParams->edit.changes.emplace(uri, std::vector<lsp::TextEdit>());
115 auto &change = it.first->second;
116
117 auto &edit = change.emplace_back();
118
119 edit.newText = newText;
120
121 edit.range = range;
122
123 _owner->SendRequest("workspace/applyEdit", applyParams);
124}

Callers

nothing calls this directly

Calls 4

SendRequestMethod · 0.80
sizeMethod · 0.45
DeserializeMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected