MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / completion

Function completion

src/common/lsp/protocol/protocol.cpp:910–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908}
909
910QJsonObject completion(const QString &filePath, const Position &pos, const CompletionContext &context)
911{
912 QJsonObject textDocument {
913 { K_URI, QUrl::fromLocalFile(filePath).toString() }
914 };
915
916 QJsonObject position {
917 { K_CHARACTER, pos.character },
918 { K_LINE, pos.line }
919 };
920
921 QJsonObject completionContext {
922 { K_TRIGGERCHARACTER, context.triggerCharacter.value_or(QString()) },
923 { K_TRIGGERKIND, context.kind }
924 };
925
926 QJsonObject params {
927 { K_TEXTDOCUMENT, textDocument },
928 { K_POSITION, position },
929 { K_CONTEXT, completionContext }
930 };
931
932 return params;
933}
934
935bool isRequestResult(const QJsonObject &object)
936{

Callers 1

completionRequestMethod · 0.50

Calls 2

QStringClass · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected