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

Method OnDidChange

CodeFormatServer/src/LSP/LSPHandle.cpp:113–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113std::shared_ptr<lsp::Serializable> LSPHandle::OnDidChange(
114 std::shared_ptr<lsp::DidChangeTextDocumentParams> params) {
115 if (params->contentChanges.size() == 1) {
116 auto &content = params->contentChanges.front();
117 if (content.range.has_value()) {
118 _server->GetVFS().UpdateFile(params->textDocument.uri, content.range.value(),
119 std::move(content.text));
120 } else {
121 _server->GetVFS().UpdateFile(params->textDocument.uri,
122 std::move(content.text));
123 }
124 } else {
125 _server->GetVFS().UpdateFile(params->textDocument.uri, params->contentChanges);
126 }
127
128 return nullptr;
129}
130
131std::shared_ptr<lsp::Serializable> LSPHandle::OnDidOpen(
132 std::shared_ptr<lsp::DidOpenTextDocumentParams> params) {

Callers

nothing calls this directly

Calls 4

frontMethod · 0.80
UpdateFileMethod · 0.80
sizeMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected