Commit Graph

15 Commits

Author SHA1 Message Date
hjk
f0628cca29 ClangCodeModel: Replace nested ClangCodeModel::Utils namespace
... by the customary ::Internal.

It adds only noise on the user side and conflicts regularly with
the top-level ::Utils namespace.

Remove a (now) duplicated definition of setLastSentDocumentRevision().

Plus minor namespace related fixes.

There are still minor conflicts between Utils::Text and
ClangCodeModel::Text

Change-Id: I2e8df6b3c6c3599192774032822ee7e778355bba
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 15:12:28 +00:00
Nikolai Kosjar
f6dcc90a6f ClangCodeModel: Modernize
Change-Id: Ie001a2d8ed9c82ac5fedf8e59bd56d7bbdddf919
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-11 11:12:16 +00:00
Alessandro Portale
62abfd7b50 ClangCodeModel: Modernize
modernize-use-nullptr
modernize-use-auto
modernize-use-override
modernize-use-equals-default
modernize-use-using

Change-Id: I386f885860c01574035c69226240fe3b8e38392c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-14 08:09:15 +00:00
David Schulz
141f19a652 Utils: move code model icons to utils
In preperation for the language server protocol support.

Change-Id: Iee4ccd53a86d9afdb357972ea62b75ace2edcb1d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-08-06 13:22:47 +00:00
Ivan Donchevskii
534aa02163 Clang: For definitions show their parent class qualification
Append methods and class members with the scope they belong to
extracting the parent name. It was like that in old code model.

Example:
namespace Foo {
void Bar::function() {}
}

Old result:
Foo
  function() -> void

New result:
Foo
  Bar::function() -> void

Change-Id: I9dad86a6738baafb1a210c5e1146d8de33828c44
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-07-09 09:24:35 +00:00
Christian Stenger
cab82a94c7 Clang: Fix accessing nullptr
Change-Id: I204ff9263520dee70a89adf99182d198e4dd1036
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-06-11 09:55:33 +00:00
Ivan Donchevskii
4f51b89d65 Clang: Do not duplicate operator entries
Do not show the same operator twice in symbol outline and
current document filter.

Extract common checks to TokenInfoContainer class.

Change-Id: I3b48aa949d678564c952a71f650b7ba601570fa2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-06-06 13:16:05 +00:00
Ivan Donchevskii
bb0c681ff8 Clang: Do not show any function internals in symbol outline
Treat everything inside function scope the same way
as local variables.

Change-Id: I038d84e5e90057d65a08afc742ebcdf2de55ff85
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-06-06 13:15:57 +00:00
Ivan Donchevskii
52bd5173fb Clang: Remove extern and static declarations from symbol outline...
... in case they appear within the function body.

Task-number: QTCREATORBUG-20434
Change-Id: I6d12ab857cca5fe8479ac3fb426329ae7d732567
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-06-04 08:46:25 +00:00
Ivan Donchevskii
b0c0119345 CppTools: Use cursor range for better outline navigation
Clang provides cursor range for each declaration in
symbol outline. Use that information to search for
more accurate correspondence between a cursor position
in editor and an entry in symbol outline.

For example skip indexes with not matching ranges to
prevent pure declarations from automatically become
parents of everything coming after them.

Change-Id: I0ef95c26772050cd6655e830288c46118aba38bb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-06-04 08:43:44 +00:00
Ivan Donchevskii
ef660d8bd0 Clang: Simplify name and type in FullTokenInfo for functions
Take Cursor displayName instead of token name.
From now on type spelling can serve the return type
role for functions because together with 'token' member
they form the full type.

Change-Id: Ic8eec533f4a11458f99f070b6a6aa80714097b4d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-23 07:59:40 +00:00
Ivan Donchevskii
f9d95c9205 Clang: Optimize clang overview model
Build the tree in only one loop.

clangbackend generates tokens almost as fast as it
did before (about 10% slower in general).
Broken documents are more affected and take much more
time (about 300%) but it's better to have this time spent
on backend side then in QtC itself.

Task-number: QTCREATORBUG-20205
Change-Id: I34c58bca30c4494005a029abd82c7e612ecd6fb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-12 09:15:12 +00:00
hjk
cf4dbb4bb6 ClangSupport: Use simpler structures in some cases
The patch is mostly mechanical, but contains also a few spurious changes
from values references for some local variables, foreach -> ranged for
etc that I coulnd't resist.

Change-Id: I58f0bd972546895eb318607cbfbd7ac35caf3f23
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-06 12:55:23 +00:00
Ivan Donchevskii
99bd0ed2a4 Clang: Rebuild overview model tree when token data is updated
In release builds overview model tree is built earlier
then the job with token information is completed.

Change-Id: I1a563551e813996001fb97924ac441e2b7d599b9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-23 14:15:45 +00:00
Ivan Donchevskii
5e872c0fcd Clang: Introduce OverviewModel for clang
Change-Id: I1473e3f679f4345a04c55f1ee80cfe35e21a4347
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-02-21 06:55:59 +00:00