Commit Graph

10 Commits

Author SHA1 Message Date
Nikolai Kosjar
06a99af0f6 Revert "Clang: Fix text format for completion details" from 3.6
This reverts commit c5f70a3bad1ee2457741459cafb6419c67c417ad.

We will set the rich text unconditionally in a follow-up change to
simplify things.

Change-Id: I59aad8e33011ef68aa7c32ec80bb02edfd29c6a6
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-27 16:31:10 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Eike Ziller
98257617e9 Merge remote-tracking branch 'origin/3.6'
Conflicts:
	src/plugins/clangcodemodel/clangassistproposalmodel.cpp
	src/plugins/clangcodemodel/clangassistproposalmodel.h

Change-Id: Iba30d2f4d95fa0f551afe58890d15f5835dfb715
2016-01-19 16:41:17 +01:00
Nikolai Kosjar
1a6b62a2b0 Clang: Fix text format for completion details
The tooltip text right to the completion list item is prepared for rich
text (html) interpretation, but the QLabel the text will finally be
displayed with has no explicit text format set and thus defaults to auto
detection. The auto detection works fine for e.g. "<i>int optionalArg</
i>" but fails for "const Foo&amp;".

Task-number: QTCREATORBUG-15630
Change-Id: Ia58d65ee542730e4823c69150d452cdde98112f8
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-19 13:27:30 +00:00
Nikolai Kosjar
8d6549fa74 Clang: Correct member access operator if possible
1 struct Foo { int member; };
 2 void f(Foo *foo)
 3 {
 4     foo.<REQUEST COMPLETION> // correct '.' to '->' and provide results
 5 }

The preferred approach would be to check if "foo" in line 4 is of
pointer type, but there is no suitable cursor (only CompoundStmt) at
that position since the code is usually not yet parsed and thus invalid.

Thus, just run the completion as is. If there are not any results for a
dot completion, re-run the completion with "." exchanged by "->". This
approach is inherently slower than the preferred approach implemented in
the built-in code model.

The following rare cases are not handled:

 1) Requesting completion after white space:
      Works: foo.<COMPLETE HERE>
      Fails: foo. <COMPLETE HERE>

 2) Opening a file and requesting completion (ctrl+space) without prior
    editing. No editing before triggering completion means that no
    unsaved file is generated on the backend side, which is a
    requirement for the correction.

Task-number: QTCREATORBUG-11581
Change-Id: I6bc8e8594778774ab342755fdb01a8a3e5c52ba0
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-19 13:20:35 +00:00
Nikolai Kosjar
a5a0864741 Clang: Fix warnings about unused members
Remove the unused members and remove also
ClangAssistProposalModel::[m_]replaceDotForArrow, which is a needled
indirection.

Change-Id: If6e0f65678b05fabd5fa16823a7a4c634b9fbdef
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-12-01 12:07:57 +00:00
Marco Bubke
bb549770a8 Clang: Remove unused function
Change-Id: Iee4a6a4e8197db9520ad188fa872840305bca1b1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-13 10:30:40 +00:00
Marco Bubke
eb5afed10f Clang: Add sorting by priority
The priority is adjusted too provide a better completion list.

Change-Id: I1ebed1996f660046843e0c5249a91e8c2b1eeb88
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-08 12:29:27 +00:00
Marco Bubke
5467fc25ea Clang: Make ClangAssistProposalModel members private
Change-Id: Ib8089f4afdb72840d97e5286d8be631387e4d2c5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-06 12:41:05 +00:00
Marco Bubke
ed27414f48 Clang: Split clangcompletion.[h|cpp]
First step for refactor them.

Change-Id: If9de084e39ddf31317035ccbbc1fd57d7797d193
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-06 12:41:01 +00:00