| 908 | } |
| 909 | |
| 910 | QJsonObject 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 | |
| 935 | bool isRequestResult(const QJsonObject &object) |
| 936 | { |
no test coverage detected