C++: add code-model settings to choose one by mime-type.

The model-manager now supports multiple code models for semantic
highlighting and code completion, and will choose one based on the
mime-type of the editor.

The settings page is currently disabled. It will get enabled when a
second plug-in lands that has a ModelManagerSupport class.

Change-Id: I10023f52322ed6860397da15dba1c231e80e6517
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-09-06 13:14:15 +02:00
parent f33d145e64
commit c9f5a14bdd
12 changed files with 524 additions and 12 deletions

View File

@@ -105,7 +105,7 @@ public:
void finishedRefreshingSourceFiles(const QStringList &files);
virtual void addModelManagerSupport(ModelManagerSupport *codeModelSupport);
virtual void addModelManagerSupport(ModelManagerSupport *modelManagerSupport);
virtual ModelManagerSupport *modelManagerSupportForMimeType(const QString &mimeType) const;
virtual CppCompletionAssistProvider *completionAssistProvider(Core::IEditor *editor) const;
virtual CppHighlightingSupport *highlightingSupport(Core::IEditor *editor) const;
@@ -202,9 +202,8 @@ private:
QSet<AbstractEditorSupport *> m_extraEditorSupports;
// Completion & highlighting
QList<ModelManagerSupport *> m_codeModelSupporters;
QHash<QString, ModelManagerSupport *> m_idTocodeModelSupporter;
QScopedPointer<ModelManagerSupport> m_modelManagerSupportFallback;
QHash<QString, ModelManagerSupport *> m_mimeTypeToCodeModelSupport;
// Indexing
CppIndexingSupport *m_indexingSupporter;