Commit Graph

22 Commits

Author SHA1 Message Date
Nikolai Kosjar
c0364564a4 Clang: Fix highlighting of template function in using declaration
This completes

    commit a3a62e78f7
    Clang: Fix highlighting of function in using declaration

Change-Id: I3c163096374d7a1f45a590bb8ebfe5f5a1f8d417
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-14 12:46:43 +00:00
Marco Bubke
ebd675013f Clang: Fix highlightingmark test
Change-Id: I2c25e06e29e9024e8d3c38536e0e1f93ef65b7e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-31 12:04:05 +00:00
Marco Bubke
99af4ae8e6 Clang: Show all tokens of a getter as output argument
f(x.get()); -> x.get() should be shown as a output argument

Task-number: QTCREATORBUG-18591
Change-Id: I99f5637660bcd0a889338ebfa6737d79de226f87
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-07-24 14:31:23 +00:00
Marco Bubke
9b5d6546b8 Clang: Remove pointer arguments from output argument
Non constant pointers are used many times as non output arguments, so you
get misleading information.

Task-number: QTCREATORBUG-18591
Change-Id: Ic5f987db44ad63a0b1a38fd59cd807db5f2acc8f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-07-24 13:27:29 +00:00
Orgad Shaneh
2c55c10cac Clang: Adapt unit tests to clang-5.0
Disable the tests on clang-3.x.

Change-Id: I80a8840c25e55785034abf7b5964a14afb01d9e7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-23 14:49:18 +00:00
Nikolai Kosjar
1623af0da5 Clang: Add a disabled test for highlighting
In the example below, "var" is highlighted as a function, but it should
be highlighted as a local variable.

  struct OtherOperator { void operator()(int); };
  void g(OtherOperator o, int var)
  {
      o(var);
  }

This is due to a libclang bug.

Change-Id: I7c9fcad6f16c25191d31fc330e969ebd282d4869
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-16 06:09:19 +00:00
Nikolai Kosjar
cde8738269 Clang: Remove pointless call in tests
It was added only for debugging.

Change-Id: I7ea80d8d472f319cdcac548d3abf602e0f304fc9
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-16 06:08:58 +00:00
Nikolai Kosjar
e6bf399003 Clang: Stop highlighting keywords in preprocessor directives
Task-number: QTCREATORBUG-15516
Change-Id: I30046ae7c1a73144985639800227012bf5a4e357
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-06-14 10:00:02 +00:00
Ivan Donchevskii
78db7d7ed2 Clang: turn off delayed template parsing
Fix templates highlight and completion on Windows
Add UI to turn on/off delayed parsing (off by default)

Task-number: QTCREATORBUG-17222
Change-Id: I0cd5e0bcfff2789cd938e4096829f777ff15957a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-08 10:53:31 +00:00
Nikolai Kosjar
a3a62e78f7 Clang: Fix highlighting of function in using declaration
Change-Id: I0f646ce22cdc95e5932650a3fb2fe34b8d4a89a3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-01 13:33:07 +00:00
Nikolai Kosjar
e6c8fbfd92 Clang: Fix highlighting for partial specialization
Change-Id: I53f6a87064d45a3a68394d1b3bc0d767b91a9d11
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-01 13:33:00 +00:00
Eike Ziller
db11c01df8 Clang: Fix highlighting of primitive types
libClang categorizes these as keywords, so we need to check
if a keyword is actually a primitive type, and use that.

Task-number: QTCREATORBUG-17867
Change-Id: I354bb0422505ed7732a0799d9c86d3acfdeb0785
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-05-23 08:41:42 +00:00
Nikolai Kosjar
35c395cd13 Clang: Enable now passing tests
Looks like this was fixed in libclang in the meanwhile.

Change-Id: I51200ef7c72a01f5075d2e5d6ca6db4690dfcdd0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-23 11:13:39 +00:00
Nikolai Kosjar
186368c202 UnitTests: Disable known to fail tests for Windows
So we can easily verify if other changes break anything.

The disabled tests should be all related to the by default enabled delayed
template instantiation on Windows, which is necessary to parse windows headers.

The disabled tests can be run with --gtest_also_run_disabled_tests or by
setting the env variable GTEST_ALSO_RUN_DISABLED_TESTS=1.

Change-Id: I040d881ff0a3fbf5fe85c0b3d1b8e7b0959d1b9c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-20 16:29:58 +00:00
Marco Bubke
9dfa210011 Clang: Partial fix for highlighting off output arguments
We get the source range for the parameter list and not the arguments
in the initializer list back. So we have to disable the test case.

Task-number: QTCREATORBUG-17101
Change-Id: I65ec6d111766b5728a951b024576cbf777c89728
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-11-24 16:54:01 +00:00
Marco Bubke
03bbd88eb1 Clang: Fix highlighting of instance with member for writable arguments
struct X
{
  int member;
};


void f(int &argument);

void foo()
{
  X x;

  f(x.member);
}

Task-number: QTCREATORBUG-17101
Change-Id: I6746122dbe86d032b3797a01b5f2257846007f94
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-11-23 15:22:50 +00:00
Marco Bubke
b196368785 Clang: Add disabled test case for HighlightingMarks
Constructors are not recognized by libClang as callable expressions.

Task-number: QTCREATORBUG-17101
Change-Id: I40eb46c07475e3b2e48bc8117de073732005f8b9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-11-23 14:47:33 +00:00
Marco Bubke
d6858b2f9f Clang: Fix unused warning
Change-Id: I1ed0698eb9ea2d73e4ccc6540121610b30d5f646
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-12 11:25:36 +00:00
Marco Bubke
63ae993bf2 Clang: Add output argument highlighting
This adds a mix-in for writable functions arguments.

Change-Id: I758f7fef77d992ea25395db550571ccb081fd5fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-10-12 08:01:48 +00:00
Marco Bubke
eb55c1a4e4 Clang: Fix highlightingmarks include test
Change-Id: I3e3f34a7155149a4a12fb8cea3102aba10bb5fc7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-10-11 10:55:01 +00:00
Nikolai Kosjar
1a426d9f01 Clang: Support second translation unit
A TranslationUnit is owned by TranslationUnits now. TranslationUnits
allows to add another TranslationUnit and to update/query the recently
and previously parsed translation unit.

This does not change any behavior yet.

Change-Id: I8a2f0cc05d3e51bf739dd5d7c4da14b54147f3ab
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 12:35:48 +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