forked from qt-creator/qt-creator
TextEditor: Make text snippets available in all editors
... that do not define their own completion assist provider Change-Id: I8edb65647a55178d4388b26c95cdeb301ff9f3fa Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
#include <texteditor/codeassist/codeassistant.h>
|
||||
#include <texteditor/codeassist/completionassistprovider.h>
|
||||
#include <texteditor/codeassist/keywordscompletionassist.h>
|
||||
#include <texteditor/generichighlighter/context.h>
|
||||
#include <texteditor/generichighlighter/highlightdefinition.h>
|
||||
#include <texteditor/generichighlighter/highlighter.h>
|
||||
@@ -8263,6 +8264,7 @@ void TextEditorFactory::setParenthesesMatchingEnabled(bool on)
|
||||
|
||||
IEditor *TextEditorFactory::createEditor()
|
||||
{
|
||||
static KeywordsCompletionAssistProvider basicSnippetProvider;
|
||||
TextDocumentPtr doc(d->m_documentCreator());
|
||||
|
||||
if (d->m_indenterCreator)
|
||||
@@ -8271,7 +8273,8 @@ IEditor *TextEditorFactory::createEditor()
|
||||
if (d->m_syntaxHighlighterCreator)
|
||||
doc->setSyntaxHighlighter(d->m_syntaxHighlighterCreator());
|
||||
|
||||
doc->setCompletionAssistProvider(d->m_completionAssistProvider);
|
||||
doc->setCompletionAssistProvider(d->m_completionAssistProvider ? d->m_completionAssistProvider
|
||||
: &basicSnippetProvider);
|
||||
|
||||
return d->createEditorHelper(doc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user