![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
QQmlLSCompletion provides completions for all kinds of QML and JS constructs. More...
#include <qqmllscompletion_p.h>
Public Types | |
| enum class | ImportCompletionType { None , Module , Version } |
| enum | AppendOption { AppendSemicolon , AppendNothing } |
| using | CompletionItem = QLspSpecification::CompletionItem |
| using | BackInsertIterator = std::back_insert_iterator<QList<CompletionItem>> |
Public Member Functions | |
| QQmlLSCompletion (const QFactoryLoader &pluginLoader) | |
| void | exploreImportPaths (const QStringList &importPaths) |
| QQmlLSModuleExplorer * | moduleExplorer () const |
| QList< CompletionItem > | completions (const DomItem ¤tItem, const CompletionContextStrings &ctx) const |
Static Public Member Functions | |
| static CompletionItem | makeSnippet (QUtf8StringView qualifier, QUtf8StringView labellabel, QUtf8StringView insertText) |
| static CompletionItem | makeSnippet (QUtf8StringView labellabel, QUtf8StringView insertText) |
QQmlLSCompletion provides completions for all kinds of QML and JS constructs.
Use the \l{completions} method to obtain completions at a certain DomItem.
All the other methods in this class are helper methods: some compute completions for specific QML and JS constructs and some are shared between multiple QML or JS constructs to avoid code duplication. Most of the helper methods add their completion items via a BackInsertIterator.
Some helper methods are called "suggest*" and will try to suggest code that does not exist yet. For example, any JS statement can be expected inside a Blockstatement so suggestJSStatementCompletion() is used to suggest JS statements inside of BlockStatements. Another example might be suggestReachableTypes() that will suggest Types for type annotations, attached types or Qml Object hierarchies, or suggestCaseAndDefaultStatementCompletion() that will only suggest "case" and "default" clauses for switch statements.
Some helper methods are called "inside*" and will try to suggest code inside an existing structure. For example, insideForStatementCompletion() will try to suggest completion for the different code pieces initializer, condition, increment and statement that exist inside of: \badcode for(initializer; condition; increment) statement
Definition at line 38 of file qqmllscompletion_p.h.
| using QQmlLSCompletion::BackInsertIterator = std::back_insert_iterator<QList<CompletionItem>> |
Definition at line 51 of file qqmllscompletion_p.h.
| using QQmlLSCompletion::CompletionItem = QLspSpecification::CompletionItem |
Definition at line 50 of file qqmllscompletion_p.h.
| Enumerator | |
|---|---|
| AppendSemicolon | |
| AppendNothing | |
Definition at line 43 of file qqmllscompletion_p.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Module | |
| Version | |
Definition at line 42 of file qqmllscompletion_p.h.
| QQmlLSCompletion::QQmlLSCompletion | ( | const QFactoryLoader & | pluginLoader | ) |
Definition at line 1980 of file qqmllscompletion.cpp.
| QList< CompletionItem > QQmlLSCompletion::completions | ( | const DomItem & | currentItem, |
| const CompletionContextStrings & | contextStrings ) const |
Decide which completions can be used at currentItem and compute them.
Definition at line 1753 of file qqmllscompletion.cpp.
| void QQmlLSCompletion::exploreImportPaths | ( | const QStringList & | importPaths | ) |
Definition at line 936 of file qqmllscompletion.cpp.
|
static |
Definition at line 67 of file qqmllscompletion.cpp.
|
static |
Definition at line 45 of file qqmllscompletion.cpp.
|
inline |
Definition at line 48 of file qqmllscompletion_p.h.