TextEditor: add document content completer

Add completion based on words of the document. This provides basic
assistance for programming languages without a code model.

Task-number: QTCREATORBUG-13869
Change-Id: I3a9c59c741dfd6895442fc0524cfd1bd3b2b0111
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2018-02-09 14:02:11 +01:00
parent 24520b9159
commit b4a1798618
6 changed files with 192 additions and 3 deletions

View File

@@ -56,7 +56,7 @@
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/codeassistant.h>
#include <texteditor/codeassist/completionassistprovider.h>
#include <texteditor/codeassist/keywordscompletionassist.h>
#include <texteditor/codeassist/documentcontentcompletion.h>
#include <texteditor/generichighlighter/context.h>
#include <texteditor/generichighlighter/highlightdefinition.h>
#include <texteditor/generichighlighter/highlighter.h>
@@ -8608,7 +8608,7 @@ void TextEditorFactory::setParenthesesMatchingEnabled(bool on)
IEditor *TextEditorFactory::createEditor()
{
static KeywordsCompletionAssistProvider basicSnippetProvider;
static DocumentContentCompletionProvider basicSnippetProvider;
TextDocumentPtr doc(d->m_documentCreator());
if (d->m_indenterCreator)