diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-05-14 11:34:45 -0400 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-06-02 15:48:48 +0200 |
commit | e8fab22afbaabf50a6c254c5e4c63bd3ea5bc5c7 (patch) | |
tree | f8307a3d5a8b69327bb318e953e32312c3adc3fd /src/plugins/cpptools/cppcompletionassist.h | |
parent | db5f2f1411806d6b6d9984576a4fa8efa0a75b08 (diff) |
C++: Disable "Replace Dot for Arrow" auto-correction for ObjC sources
In the light of Obj-C properties this seems to annoy more than to help.
Change-Id: I48f92d505035369f48e8798d0972ef00306bdde0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletionassist.h')
-rw-r--r-- | src/plugins/cpptools/cppcompletionassist.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppcompletionassist.h b/src/plugins/cpptools/cppcompletionassist.h index 89a5c4c16e..ed56a780c8 100644 --- a/src/plugins/cpptools/cppcompletionassist.h +++ b/src/plugins/cpptools/cppcompletionassist.h @@ -94,13 +94,12 @@ class InternalCompletionAssistProvider : public CppCompletionAssistProvider public: TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE; - TextEditor::IAssistInterface *createAssistInterface( - ProjectExplorer::Project *project, + TextEditor::IAssistInterface *createAssistInterface(ProjectExplorer::Project *project, TextEditor::BaseTextEditor *editor, QTextDocument *document, + bool isObjCEnabled, int position, TextEditor::AssistReason reason) const QTC_OVERRIDE; - }; class CppCompletionAssistProcessor : public TextEditor::IAssistProcessor @@ -175,12 +174,14 @@ class CppCompletionAssistInterface : public TextEditor::DefaultAssistInterface public: CppCompletionAssistInterface(TextEditor::BaseTextEditor *editor, QTextDocument *textDocument, + bool isObjCEnabled, int position, TextEditor::AssistReason reason, const CppModelManagerInterface::WorkingCopy &workingCopy) : TextEditor::DefaultAssistInterface(textDocument, position, editor->document()->filePath(), reason) , m_editor(editor) + , m_isObjCEnabled(isObjCEnabled) , m_gotCppSpecifics(false) , m_workingCopy(workingCopy) {} @@ -194,12 +195,15 @@ public: const QStringList &frameworkPaths) : TextEditor::DefaultAssistInterface(textDocument, position, fileName, reason) , m_editor(0) + , m_isObjCEnabled(false) , m_gotCppSpecifics(true) , m_snapshot(snapshot) , m_includePaths(includePaths) , m_frameworkPaths(frameworkPaths) {} + bool isObjCEnabled() const { return m_isObjCEnabled; } + const CPlusPlus::Snapshot &snapshot() const { getCppSpecifics(); return m_snapshot; } const QStringList &includePaths() const { getCppSpecifics(); return m_includePaths; } const QStringList &frameworkPaths() const { getCppSpecifics(); return m_frameworkPaths; } @@ -208,6 +212,7 @@ private: void getCppSpecifics() const; TextEditor::BaseTextEditor *m_editor; + mutable bool m_isObjCEnabled; mutable bool m_gotCppSpecifics; CppModelManagerInterface::WorkingCopy m_workingCopy; mutable CPlusPlus::Snapshot m_snapshot; |