1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Commit graph

1694 commits

Author SHA1 Message Date
Marc-Andre Laperle
41b741f358 Bug 567261 - Revert "541239: [C++17] Implement parser support for deduction guides"
This reverts commit bcb955a321.

Change-Id: Iaf6ba398e439e3d1da1e3a3b0247c7b24bbfb057
2020-10-05 21:40:00 -04:00
Marc-Andre Laperle
cb0797481f Bug 566918 - [C++17] Support for __has_include (standard) and
__has_include_next (extension)

__has_include evaluates whether of the header name passed as parameter
exists. This can only be evaluated as part of a #if directive.
Interestingly, it also has to be reported as defined, i.e. #if
defined(__has_include) or #ifdef. In order to report this as defined,
this implementation adds it as a macro but during macro expansion, it's
actually converted as a dedicated token type. Then this token gets
evaluated during normal preprocessor expression evaluation.

In order to parse header names, there were several options. The main
problem is that header tokens (tQUOTE_HEADER_NAME, tSYSTEM_HEADER_NAME)
are actually produced by the Lexer as part of a special mode
(setInsideIncludeDirective) set during the handling of #include. For
expression evaluation, the tokens are already generated without
setInsideIncludeDirective therefore we only have plain string
and < > tokens.

One approach would be to generate header tokens "earlier" than executing
we need to track a new state while fetching token to configure the Lexer
(setInsideIncludeDirective) when in the context of an __has_include.
There are also complications due to macro expansion within the
__has_include where after one expansion, we don't have a lexer in the
context anymore, introducing more changes.

Another approach would be to remove the Header token creation from the
Lexer itself and let the preprocessor assemble the tokens into an header
string, in both cases of #include and __has_include. This mostly works
and is the approach used in Clang, but the problem is that whereas Clang
keeps track of leading spaces of tokens, CDT doesn't. This means with
such change that CDT would now allow #include <  iostream  > (notice the
white space). I think this is too big of a downside and also too big of
a change to introduce this handling of whitespace at the token level.

The approach used here is more conservative and isolated but also shares
less common logic with #include processing. The non-header token
(string, <, etc) are assembled into a header string only in the case of
a __has_include. So a downside will be that #include and __has_include
will be inconsistent in regards of leading/trailing space parsing but I
feel like this is better than making #include more permissive.

Change-Id: I5b9f5c616c8d999e0c916a85b41f96e20037b651
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-09-27 15:12:52 -04:00
Jonah Graham
7818f6e494 Bug 558809: Handle cases where Oomph corrupts \0 char in preference
Some CDT preferences use \0 as a separator in preferences. Somewhere
in the Oomph preference synchronizer stack there is, or was, a place
that failed to escape/unescape preferences with encoded \0 properly.

CDT would then fail to parse the preference and an exception would
be raised, causing code completions and the editor to be broken.

This patch hardens the CDT code to:
(1) Allow an escaped \0 to be used as a separator on
    read (Oomph uses ${0x0})
(2) Handle NumberFormatExceptions gracefully. In this case that means
    showing user a pop-up that their completion preferences
    are empty and offering to reset them, or edit them in preference
    page. This UI logic already existed, so all the new code
    has to do on failed parse is return a list of all disabled
    completions.

Change-Id: Ibf3b05c0855bb96c195ca43139a50c27a2a90c7e
2020-08-31 20:06:10 -04:00
Jonah Graham
0cb1f7482a Bug 566511: [releng] Add missing UTF-8 encoding for all CDT projects
Includes updates to code cleanliness script

Change-Id: Ic495124285e3e002993f34dc12be5ad7337fe13b
2020-08-30 20:02:41 -04:00
Torbjörn Svensson
f6016c5e0b Fixed "The value for X attribute is not externalized" warning
Change-Id: Ib2f0d85a0428a1f59cc7ccab6ebb8fd91ffa2a41
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-28 21:32:18 +02:00
Jonah Graham
fd9382d8a9 Bug 562494: Update BREE to Java 11
Change-Id: I0c91aafc0cb1b179936acbd4c9df2d961899e3fa
2020-08-24 17:50:56 -04:00
Martin Weber
9e303185f9 Bug 564002: Restore the default pattern of the surefire-plugin
Sets the pattern to the default of upcoming tycho 2.0 in advance.

Signed-off-by: Martin Weber <fifteenknots505@gmail.com>
Change-Id: I31b3fc733d0cb888fbf6f566995ce2043f6cd621
2020-08-13 14:18:47 -04:00
Marco Stornelli
f4bed34dd0 Bug 564273 - Fix format lambda expressions without parenthesis
Change-Id: I918ca05d75ca4e8cba7501e232d4e6b05e434f06
2020-06-15 00:58:12 -04:00
Jonah Graham
c0ffeb6474 Bug 563864: By default fail build on test failures when building CDT with maven
Change-Id: I9bd3db3850cc45abb0ea53f8885a331c7f327887
2020-06-02 15:26:57 -04:00
Marco Stornelli
0f1940afc5 Bug 487990 - Fix format of variadic functions
Change-Id: I802d032f733247178db46c8fe43fdb9350555509
2020-06-01 04:37:13 -04:00
Alexander Fedorov
73982472ee Bug 562997 - Switch CDT doxygen to use new Equinox preferences API
Switched from "org.eclipse.cdt.core.options" to
"org.eclipse.core.runtime.preferences"

Change-Id: Ie01d955079a7a54875270bb2d259c9232d30e7ea
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-05-09 11:42:57 -04:00
Marco Stornelli
1d38d997dc Bug 562896 - Fix qualified name in return type for implement method
Change-Id: Ie1ff2e401091655c6ecc2a7393dac19cea872a0e
2020-05-09 02:43:18 -04:00
Marco Stornelli
e730b264c5 Bug 562722 - Fix noexcept using implement method
Change-Id: I3ac99f916883fa4be55af29e51b63bc8aa40a63f
2020-05-04 19:26:16 +02:00
Marco Stornelli
0124c964b5 Bug 562723 - Added support for noexcept in the formatter
Change-Id: I021934657842868c196320f4e126217ab799c07c
2020-05-04 13:21:48 -04:00
Marco Stornelli
d36ed7cfd5 Bug 562292 - Fix method definition position for override method
The position of namespaces didn't take into account because the
declaration doesn't exist yet when we use this kind of refactoring,
so the find method of MethodDefinitionInsertLocationFinder didn't
look for namespaces.

Change-Id: I839194879c41f86653c837ca83a306ea1840c1d0
2020-04-22 01:00:48 -04:00
Marco Stornelli
8fa9f63e13 Bug 562368 - Fix doxygen template documentation
Change-Id: If0763d66fab13bc1cc7445363368df4c53546c24
2020-04-21 14:06:43 -04:00
Andrey Mozzhuhin
f4f9785b87 Bug 562181: Fix auto indent after constructor with access specifiers
Some heuristics in skipToStatementStart require knowledge of previous
token. It is initialized with value from a fToken, but it current value
may be invalid because looksLikeMethodDecl changes fPossition value
without adjusting a fToken. Using invalid value may lead to false
triggering of heuristics. Restore fToken value when change fPossition in
looksLikeMethodDecl to prevent this.

Change-Id: If0c2c0577c89a983e1479587409f293c3d0db7be
Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
2020-04-16 09:28:55 -04:00
Andrey Mozzhuhin
45afe49b9c Bug 562125: Fix auto indent of function call with scope qualifiers
A function call may be mistakenly interpreted in looksLikeMethodDecl()
as a method declaration. This was due to simplified processing of
functions with a scope qualifiers in the name.

Now methods with a scope qualifier are handled similarly to methods
without them.

Change-Id: Id3075d3387fdf9c4ae2d0dffa6cdf923fd1ef9d5
Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
2020-04-15 02:04:16 -04:00
Andrey Mozzhuhin
a145e695c0 Bug 516393: Fix scan of double char tokens in CHeuristicScanner
Scanning of double char tokens (::, >>, >=, <<, <=, ->) is broken in
nextToken(). In each case, peekNextChar() was used to get second
character, but scanner position was already on second char and
peekPreviousChar() need to be used.

Change-Id: Ibd447c7cde8783e8ffe547d5f9bc09d11c1c60a7
Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
2020-04-13 21:32:45 +03:00
Alexander Fedorov
2a075e3ec8 Bug 561993 - Remove dependency to com.ibm.icu from CDT UI
Use JVM classes
Rework WorkingSetProxy#getSearchKey

Change-Id: Icda4b5b791259150dbf436546c2096ea728e0da0
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-04-12 13:34:26 +03:00
Jonah Graham
d66d3e8e85 [releng] Bump version to 10.0.0
Change-Id: I32f6f61835bdbad3cffd713965045c5097c8619f
2020-04-11 17:46:58 -04:00
Marco Stornelli
4a4c5fca4d Bug 561559 - Fix formatting def capture lambda expressions
We missed a space before the closing brackets if the proper option
was selected.

Change-Id: Ibbb09c3c961dc1b5e22aaa65ffb5d9878c2bb08b
2020-03-30 01:17:03 -04:00
Marco Stornelli
c2f51a8d23 [releng] Bump CDT version to 9.12.0
org.eclipse.cdt.debug.gdbjtag is bumped because of Bug 561343

Change-Id: I6dac283b7e9093662f57ac5c804021c4201ad6f1
2020-03-22 14:05:17 -04:00
Felix Morgner
bcb955a321 541239: [C++17] Implement parser support for deduction guides
Change-Id: I1683583af981d276b346ba8470a9044cfd8921cd
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=541239
Signed-off-by: Felix Morgner <fmorgner@hsr.ch>
Also-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-03-13 03:35:34 -04:00
Jonah Graham
5a6b9b4bf4 Revert "Bug 560614 - Drop dependency on ICU4J"
This reverts commit 87b627bf02.

Change-Id: I54ea1ac766437deb174eeba571a7a5094c180828
2020-03-02 06:49:24 -05:00
Alexander Kurtakov
87b627bf02 Bug 560614 - Drop dependency on ICU4J
Straightforward conversion. Still usages left that need deeper
investigation how to be done proper.
Some long time commented code removed as java formatter breaks trailing
whitespaces on save.


Change-Id: If74259bed5735b0d4cc98fc2cfa609c9c53c80c9
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
2020-03-02 06:46:15 -05:00
Marco Stornelli
15479e9095 Bug 559669 - Fix formatter on/off tags
Change-Id: Ia481703a0360ec5741d2fb079a75aa13a33bff39
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-02-01 15:23:59 +01:00
Marco Stornelli
c775a210e1 Bug 559545 - Fix formatter with enums with standard attributes
Change-Id: I993e773792105e22b9c2f703488e7ff211ed4068
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-30 13:57:23 -05:00
Marco Stornelli
c0402d5d06 Bug 434677 - Fix implement method insert position with namespaces
If the correct namespace existed before the refactoring in the
translation unit, refactoring process just ignored it.

Change-Id: I9d6bd301807bb2d3f83f74ef772395d3470cf8bd
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-30 13:55:38 -05:00
Marco Stornelli
86f2ad3301 Bug 452809 - Implement method fully qualified decl specifier
If an enum, a struct or a class is defined inside a class, the
implementation must qualify the declaration specifier.

Change-Id: I1e9450c7b165a25c4a745c50fe2e0c06e28775d0
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-25 01:47:42 -05:00
Alexander Fedorov
5e423d21a9 Bug 559193 - Rework DoxygenPreferences to encapsulate constants
Part 2 (please refer to the Bug 559193 regarding the reasons to rework):
 - Doxygen option read-only API for clients
 - Doxygen option storage API for configuration UI
 - OSGi component for Doxygen API implementation

Change-Id: Ia97ade397f1040087898aeb3b50872473d3c0631
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-01-22 11:47:43 -05:00
Marco Stornelli
c309923d71 Bug 384793 - Fix implement function refactoring with var args
Change-Id: I420a6a8197ff343a5719d8cc3d85eeb9ea889dfa
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-20 12:27:18 -05:00
Marco Stornelli
6647808d0e Bug 510289 - Fix implementation refactoring with template parameters
The implementation of methods with parameter declaration or with
template template parameters didn't work.

Change-Id: I783dedc5ffecd6721293d52f13548fd9e73999bc
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-19 05:48:44 -05:00
Marco Stornelli
0c5b5771b9 Bug 552334 - Generate enum doxygen comments according to comment style
Change-Id: I49f8188cc9c5421c90a48fb96a5b476de10ef251
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-16 18:45:35 +01:00
Alexander Fedorov
830bf8074c Bug 333134 - Add options to configure doxygen behavior
Reworked UI code to its natural contract.
Switched java 8 to compact the code
Encapsulated scope inside the DoxygenPreferences

Change-Id: I534b8d4f7c2d6e7674b132a10ef3514e61f2c1ed
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-01-15 08:28:48 -05:00
Marco Stornelli
e4d5441385 Bug 333134 - Add options to configure doxygen behavior
Change-Id: Idf083d6e0fdf80a848412d610cb41da1d379aeaa
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-14 11:57:34 -05:00
Jonah Graham
e770ac2b7b Bug 551817: Write Kichwa Coders consistently in Copyright line
Choice is one of:
Kichwa Coders Ltd
Kichwa Coders Canada Inc.
depending if contributed by UK or Canadian company

Change-Id: I5c9fb96ea6abf97858a6896911a71fa68b8400b1
2020-01-09 09:16:43 -05:00
Andrey Mozzhuhin
69a1589726 Bug 558923: Syntax coloring for binary integer literals from C++14
Change-Id: Ib3b260b6638e689884a28037d1a814b737846867
Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
2020-01-08 10:38:54 -05:00
Andrey Mozzhuhin
bea8343e01 Bug 537568: Apply correct indentation with template return types
Support optional template type specification of return type in method
declaration deduction.

Change-Id: Ibaa5d5128faefb0b95534918ba9980bd8449b851
Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
2020-01-06 12:04:22 -05:00
Andrey Mozzhuhin
fecd602c1b Bug 534070: Fix syntax highlight for numbers with C++14 separators
Change-Id: I1e1f335dadb3fa30e035c5a61ccef1f3eed43358
Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
2020-01-06 01:05:53 +03:00
Hannes Vogt
a4b27b3638 Bug 551761 - GetterSetterRefactoring single char prefix
Instead of dropping single character prefixes in getter/setter name
generation,
we just drop the class field prefix as defined in the coding style.

Change-Id: I3c3853b1b0f675ad1802b1ebbddd68dc8c0c5b33
Signed-off-by: Hannes Vogt <hannes@havogt.de>
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-02 17:39:54 +01:00
Jonah Graham
bd814fdaf9 [releng] Bump to CDT version 9.11.0
Change-Id: If729509efbddc71adb565e224437b76089d6e099
2019-12-07 15:24:34 -05:00
Jonah Graham
a5a2be90e7 Bug 552745: Disable intro screen (webkit use) in tests
Change-Id: Ib97fb00cb96af34a14d89a07d88de15c276537aa
2019-11-06 17:26:04 -05:00
Jonah Graham
2f5f4d50a2 [releng] Bump to CDT version 9.10.0
Change-Id: I027e7e5542fda3e599ee476814593fc4b464adca
2019-10-16 10:55:28 -04:00
Marco Stornelli
5c77776dcd Bug 550096 - Fix format function parameters in macro expansion
Change-Id: I509e434032a49a853e1794ab2d4b5a6a864eb5da
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-10-13 10:16:08 +02:00
Thomas Corbat
acbceb04ee Bug 522200: [C++17] Add support for structured binding declarations
Adds support for structured bindings:
- Parser updated
- Semantics updated
- Tests for parser and bindings added

Change-Id: I1de7b760041ac4ce4601f1b5032fdb0a197212a1
Signed-off-by: Hansruedi Patzen <hansruedi.patzen@hsr.ch>
Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
2019-08-05 09:00:35 +02:00
Marco Stornelli
cd97ba6ced Bug 549653 - Fix wrapping for lambda expression
Change-Id: I5b879edbcda9c5c1fb0087891391612af2c47d09
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-07-30 13:53:07 +02:00
Marco Stornelli
04350fec0e Bug 376395 - Fix const methods with never join wrapped lines
When at the same time never join wrapped lines and next line
for opening function brace were selected, two tabs were added.

Change-Id: I90f606bf7f8b7bb7e83f3ae85d7cbb9cd0146b97
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-07-20 10:18:08 +02:00
Marco Stornelli
cd627b0a49 Bug 540001 - Added option to control comments formatting
Change-Id: I97b1813113f2c53a549b5be7d91ff834fce86bd5
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-07-07 09:37:23 +02:00
Marco Stornelli
35a1923321 Bug 467346 - Fix format structs/unions with attributes
Change-Id: I516c53978c7dea0191fc66d2820e1dbe5a664b48
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-07-01 17:57:48 +02:00