Commit Graph

18 Commits

Author SHA1 Message Date
Marco Bubke
5ab057746c CppTools: Add pre system include search path per project
Sometimes you want add a pre system include search path per project to
overload some system header for indexing. This can then even be checked in
the repository.

Change-Id: Ib103e5935d0553aa94522ed736f8c4eb2405a093
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:33 +00:00
Nikolai Kosjar
0c38e3aea7 Clang: Clean up CompilerOptionsBuilder
No behavior change.

* Remove virtual from methods that are not overridden
* Move constant member functions that do no access any members into
  source file as static functions
* Remove QLatin1String where possible
* Make variable names a bit more consistent
* Other minor stuff

Change-Id: I34a582d5a468489e11365507b283e9aee157664f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-03 12:58:31 +00:00
Ivan Donchevskii
62e776aa8e Clang: Provide include directory only for libclang
Only libclang has issues with the include directory
search therefore undefining include folders makes sense
only for libclang options builder.

Change-Id: Ie3f62f5f3a89503e6e0ab59e18889e92425c3abc
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-08 14:07:13 +00:00
Ivan Donchevskii
7fb80595b9 ClangRefactoring: use sourceUsagesAt instead of locationsAt
Change-Id: I085b243b6e0ea4b786ce5c5f5a6894345f9d87eb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-23 07:17:57 +00:00
Orgad Shaneh
1c5d4d9f3b Fix tests compilation
Change-Id: I58cfe84b950e15ad9600aa25fc5e3cacd99626ee
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-26 06:15:24 +00:00
Ivan Donchevskii
81f5c1c8ec Clang: implement globalRename based on clang Index
Has the same limitations as findUsages.

Change-Id: I8de4df2ecbfd8a4f3073666994398dc43af0d73c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-10-25 13:35:48 +00:00
Ivan Donchevskii
050b4dd2f5 Clang: implement findUsages with existing index
Functionality is limited to the abilities of
current index which is not updated and is
generated only at project open.
Search box temporarily doesn't allow to "Search again".

Change-Id: Id1047f27ad0aafc901f06aa51ad38ceab95eaebb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-24 10:46:52 +00:00
Ivan Donchevskii
b10f8484c7 CppTools: merge CompilerOptionsBuilder with Clang one
Since it's never used for other compilers.

Change-Id: I9512692d1dc9f9a701ea2453b7d50005478bed5d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-23 12:46:34 +00:00
Ivan Donchevskii
5c554c0de9 CppTools: add multiple refactoring engines support
Make model manager able to select the most functional
refactoring engine from the available ones.

Change-Id: I74031c910706fd694a0a7def022531501f1ea005
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-17 13:32:51 +00:00
Marco Bubke
d2e15e5f1e Clang: Add file cache
The database is using file path integer ids to handle file paths because
otherwise we would save many redundant data. This patch is improving it
further with the introduction of a database based file path cache. The
entries are now divided in a directory path and file name. This is quite
handy for directory based file watching.

Change-Id: I03f2e388e43f3d521d6bf8e39dfb95eb2309dc73
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-05 17:36:37 +00:00
Ivan Donchevskii
68a49c79da Clang: Unify compiler options builders
Make build command the same for all builders.
Minimize differences.

Change-Id: I1cfe5071b3afb4944ed178fff1e57d3aee45d8a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 15:00:48 +00:00
Ivan Donchevskii
76d12dc2d5 CppEditor: add default RefactoringEngine
..and use it when we don't have refactoring plug-in

Change-Id: Ibe317a9728d439b9c5e05271d92a330d22eaacb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-15 14:13:48 +00:00
Marco Bubke
a31eae4d0a Clang: Add clang query pane
We now support highlighting for an example text and for the query.

Change-Id: I88c415ff871cf3e4c2d4fc83d60a8555bf0ce08a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-20 13:32:39 +00:00
Marco Bubke
1e3f2eec8d Clang: Consolidate all ClangCompilerOptionsBuilder into one implementation
We used the same code in different but don't shared it. From a bug fixing
perspective it's actually not that smart.

Change-Id: Iaaffc883229e259ff77f95b5cf0a8f0d8b5117df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-12-15 10:18:15 +00:00
Orgad Shaneh
6d1d1a4416 Merge remote-tracking branch 'origin/4.2'
Change-Id: I957c22020fbacb2f631220b0cdc7fa16a782798b
2016-11-21 10:25:45 +02:00
Nikolai Kosjar
da54b1e6a9 Clang: Tests: Fix compilation
refactoringclient-test.cpp:126:76: error: no matching function for call to
'ClangRefactoring::RefactoringCompilerOptionsBuilder::build(CppTools::ProjectPart*,
CppTools::ProjectFile::Kind&)'

Broke with:

    commit 36d4d01cd3
    Clang: Take precompiled headers into account when parsing source files

Change-Id: I7c5a2edec0859584ea2b33e144178060788cd4d9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-11-17 15:35:22 +00:00
Tim Jenssen
9c7ff5199f Clang: Add clang query
Clang query is mechanism to use AST matcher to search for code. Think
about regular expression but in the context of AST. So you get a semantic
search tool for C++.

Change-Id: I72e882c5b53a0c52f352a3664847c4c3e4f6fc2e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-15 15:30:33 +00:00
Marco Bubke
47c01daeb2 UnitTest: Cleanup
Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:17:54 +00:00