| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Fixes: QTCREATORBUG-29182
Change-Id: I9b7969da694b368236246123ad0028d8e754e903
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
|
|
|
|
|
| |
Change-Id: I2b83deb0502ebf2cdca2af774fbb2ce26e947c11
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
|
|
|
|
|
|
| |
Fixes: QTCREATORBUG-27503
Change-Id: Idbff5a9b5b2e6e841e298ca6f706ef3c6aa1622b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These changes target Find Usages feature to work with shared_ptr.
Improve libs/3rdparty/cplusplus and plugins/cplusplus:
parse __declspec() attribute,
call to variadic function template without specified template arguments,
if constexpr,
c++11 attributes [[value]],
function templates with default parameters,
resolve order for function vs template with default parameter,
template operator->() with default arguments,
template specialization with numeric values,
find best partial specialization,
fix partial specialization for non-first specialized argument
Fixes: QTCREATORBUG-7866
Fixes: QTCREATORBUG-20781
Fixes: QTCREATORBUG-22857
Fixes: QTCREATORBUG-17825
Change-Id: I31a080f7729edfb2ee9650f1aff48daeba5a673b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix kewordgen to generate current Keywords.cpp with minimal diff,
but also to be compatible with old usage and kwgen files.
Add new parameters:
%no-namespace-for-tokens - not use namespace for tokens
%pre-check-argument - set type and name of additional variable to use
%function-name - name of a function ("classify" by default)
%pre-check - name of a variable to check for a keyword (i.e. cxxEnabled)
Now "%%" is also used to end and restart keywords parsing to be able to
generate additional keywords for classifyOperator()
Automatically add checks for LanguageFeatures to generated code
Pass input and output files with command line arguments, print usage
Update Keywords.kwgen to include all keywords currently used
Add missing aliases to Token.h
Change-Id: I6cc84e150e0d797277204032fc05ce9cfbd01f58
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
|
|
|
|
|
| |
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recently tons of warnings show up for presumably "problematic"
singned <-> unsigned and size conversions.
The Qt side uses 'int', and that's the biggest 'integration surface'
for us, so instead of establishing some internal boundary between
signed and unsigned areas, push that boundary out of creator core code,
and use 'int' everywhere.
Because it reduces friction further, also do it in libcplusplus.
Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
C++14 supports the use of single quotes inserted between integer digits
as a separator. Updates the built-in C++ code model to recognize such
quotes. This fixes highlighting and indentation issues.
Change-Id: Ic35ce93060b96700a11d108dce1f3cf6c4543632
Fixes: QTCREATORBUG-14939
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
|
|
|
|
|
| |
Change-Id: I87dc174be5a9c29ed4770bcb5630d935c9bc8e3f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
|
|
|
|
|
|
|
|
|
| |
Currently only operators have their own style but not
punctuation tokens. Make possible to highlight both.
Task-number: QTCREATORBUG-20666
Change-Id: I9533e0f1bef65b86c4e4f5c9756571103584124b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change limits the set of tokens that fall under
Token::isOperator(). That allows cpphighlighter.cpp to
distinguish operator tokens from punctuator tokens
(without changing any logic in cpphighlighter.cpp).
This change moves punctuators from "Operator"
to the "Text" style category where they belong.
Punctuators are not operators. Punctuators are
dumb text tokens.
Why don't we let the clang backend alone separate
these tokens for us?
1. Clang is slow on big files. Sometimes the
highlighting dictated by clang is painted _seconds_
after cpphighlighter.cpp runs. CppHighlighter is way
faster so we use it to "prepaint" code while clang is
busy in the background.
2. Secondly, clang cannot yet handle all operator types.
In particular, none if its "operator cursors"
CXCursor_UnaryOperator:
CXCursor_BinaryOperator:
CXCursor_CompoundAssignOperator:
CXCursor_ConditionalOperator:
includes the -> and . operators.
We still need CppHighlighter to paint those tokens.
However, once clang has finished processing the file some
operator tokens will be repainted. We need clang to get
all operators' semantics. In particular, we need clang to
tell us if < is a "smaller than"-operator or part of a
template parameter like set<int>.
Task-number: QTCREATORBUG-19659
Change-Id: I952cb58f7c79134b3281e2a8221425cc1d0ad263
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
|
|
|
|
|
|
|
| |
Task-number: QTCREATORBUG-2818
Task-number: QTCREATORBUG-18004
Change-Id: Ibca60a1711c827dd8b4c0486bff3d49b19a61d8b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some (legacy) C files, new and delete may be used for regular identifier.
There are some limitations:
* Header files have no 'implicit' type, and may be parsed as C++ or ObjC depending on the
other files in the project.
* QMakeProject use a single ProjectPart for C and C++ files, so there will still be the issue.
Change-Id: Iec11687b35f7ccf1e7c0d091b143ae90d950e440
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
|
|
|
|
|
|
|
| |
Kudos to cgmb and https://github.com/cgmb/guardonce
Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trigraphs must only be parsed before/during preprocessing. The preprocessor
will now replace trigraphs with their standard form, and re-lexing in
TranslationUnit will not try to parse any trigraph.
Also added a few missing trigraphs: ??=, ??', ??! and ??-.
Task-number: QTCREATORBUG-13253
Change-Id: I1723ed53b00090b878c22b83b7e963b647b65f72
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I093c2a786cf8f10de4f05c23f3763ef1300feabd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
| |
Task-number: QTCREATORBUG-13094
Change-Id: I4e6b8c202677f4c1cd4df95d59130ba8379e72fe
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
|
|
|
|
|
|
| |
Task-number: QTCREATORBUG-8007
Change-Id: Ic96aaa433442812a99bac9d16bb9124d66762e8c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Trigger completion for Qt5 signals/slots as soon as the user types '&'
in
connect(object, &
connect(object, &Foo:signal, object2, &
Change-Id: I338a26415196959e3dc413bdfd023314812f3aaa
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Extends lexer so digit or string can be followed by underscore '_' and
alphanumeric defining literal.
2. Extends parser so it accepts operator"" _abc(...) user-defined literal
definition.
3. Adds Token::Flags.userDefinedLiteral bool flag field representing if token
carries user-defined literal.
4. Adds C++11 auto tests case with: 12_km, 0.5_Pa, 'c'_X, "abd"_L, u"xyz"_M
5. All optional suffix scanning methods now return boolean if the suffix was
found.
6. Adds C++ Lexer tests for user-defined literals with C++11 feature enabled.
This change however does not make QtCreator understand user-defined literal
semantics, e.g. properly resolve type when applying custom literal operator.
Change-Id: I30e62f025ec9fb11c39261985ea4d772b1a80949
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
| |
And not have it converted to int after converting to unsigned.
Change-Id: If95caec46936c2a140c3fbd668fa2f085a9287ed
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
|
|
|
| |
The condition didn't make sense. tk.kind() can't be < T_FIRST_QT_KEYWORD
*and* tk.kind() > T_LAST_KEYWORD at the same time.
Change-Id: Id300ad84f37eeff5081b0389c00d574a9cb23f35
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
|
|
|
|
|
|
|
|
| |
Syntax highlight rules for keywords are changed to highlight control
keywords and primitive data types separately.
Change-Id: Ifb25be7a97b92589030aa190641320c233dc7f2d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case:
int a[6] = { [4] = 29, [2] = 15 };
struct point { int x, y; };
struct point p = { .y = 3, .x = 2 };
Grammar change when c99 language feature is enabled:
old grammar:
braced-init-list :: '{' initializer-list '}'
new grammar:
braced-init-list :: '{' designated-initializer-list '}'
designated-initializer-list :: designated-initializer (',' designated-initializer )*
designated-initializer :: designator* initializer-clause
designator :: '.' identifier
| '[' constant-expression ']'
Task-number: QTCREATORBUG-1902
Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will save us toLatin1() conversations in CppTools (which already
holds UTF-8 encoded QByteArrays) and thus loss of information (see
QTCREATORBUG-7356). It also gives us support for non-latin1 identifiers.
API-wise the following functions are added to Token. In follow-up
patches these will become handy in combination with QStrings.
utf16chars() - aequivalent of bytes()
utf16charsBegin() - aequivalent of bytesBegin()
utf16charsEnd() - aequivalent of bytesEnd()
Next steps:
* Adapt functions from TranslationUnit. They should work with utf16
chars in order to calculate lines and columns correctly also for
UTF-8 multi-byte code points.
* Adapt the higher level clients:
* Cpp{Tools,Editor} should expect UTF-8 encoded Literals.
* Cpp{Tools,Editor}: When dealing with identifiers on the
QString/QTextDocument layer, code points
represendet by two QChars need to be respected, too.
* Ensure Macro::offsets() and Document::MacroUse::{begin,end}() report
offsets usable in CppEditor/CppTools.
Addresses QTCREATORBUG-7356.
Change-Id: I0791b5236be8215d24fb8e38a1f7cb0d279454c0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will avoid confusion when later more length and indices methods are
added.
In Token:
length() --> bytes()
begin() --> bytesBegin()
end() --> bytesEnd()
Change-Id: I244c69b022e239ee762b4114559e707f93ff344f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
| |
Change-Id: I3be73c2a4d256a0d28e863fd2517a4d7442b34d8
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
|
|
|
|
|
|
|
| |
Task-number: QTCREATORBUG-7679
Change-Id: I794f52b2bcfb6c78ceef86ec53b6ed32b3d53d9f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
| |
Change-Id: I7f60057953787b3300aafa4d3f230f10b1e9a50f
Reviewed-by: hjk <qthjk@ovi.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although they are now supported by the lexer
and parser, it is worth to remind that we still
need to address an issue concerning the highlight
of multiline literals (which with the advent of
the new raw strings will become more common).
Task-number: QTCREATORBUG-6722
Change-Id: I137337a9ac0152a1f8b9faded0b960c6fe3dd38a
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The parser now understands emit/Q_EMIT as an expression statement.
Also, the recent fixes in the preprocessor introduced a side-effect
in the hanlding of code such as: emit signal(); Member signal started
being treated as a local use (parsed as a declaration) and possibily
being highlighted as unused variable.
Previously that worked by accident since there was an inconsistency
in the preprocessor on which only object-like macros were being
expanded even when the "no expand" flag was set. Then, the code
mentioned above was being parsed as an expression, what kind of worked.
Change-Id: I47a68ed4c1c1702872620b8ed7c7264fb0997034
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary of most relevant items:
- Preprocessor output format change. No more gen true/false. Instead
a more intuitive and natural expansion (like from a real compiler) is
performed directly corresponding to the macro invocation. Notice that
information about the generated tokens is not lost, because it's now
embedded in the expansion section header (in terms of lines and columns
as explained in the code). In addition the location on where the macro
expansion happens is also documented for future use.
- Fix line control directives and associated token line numbers.
This was not detected in tests cases because some of them were
actually wrong: Within expansions the line information was being
considered as originally computed in the macro definition, while
the desired and expected for Creator's reporting mechanism (just
like regular compilers) is the line from the expanded version
of the tokens.
- Do not allow for eager expansion. This was previously being done
inside define directives. However, it's not allowed and might
lead to incorrect results, since the argument substitution should
only happen upon the macro invocation (and following nested ones).
At least GCC and clang are consistent with that. See test case
tst_Preprocessor:dont_eagerly_expand for a detailed explanation.
- Revive the 'expanded' token flag. This is used to mark every token
that originates from a macro expansion. Notice, however, that
expanded tokens are not necessarily generated tokens (although
every generated token is a expanded token). Expanded tokens that
are not generated are those which are still considered by our
code model features, since they are visible on the editor. The
translation unit is smart enough to calculate line/column position
for such tokens based on the information from the expansion section
header.
- How expansions are tracked has also changed. Now, we simply add
two surrounding marker tokens to each "top-level" expansion
sequence. There is an enumeration that control expansion states.
Also, no "previous" token is kept around.
- Preprocessor client methods suffered a change in signature so
they now receive the line number of the action in question as
a paramater. Previously such line could be retrieved by the client
implementation by accessing the environment line. However, this
is not reliable because we try to avoid synchronization of the
output/environment lines in order to avoid unnecessary output,
while expanding macros or handling preprocessor directives.
- Although macros are not expanded during define directives (as
mentioned above) the preprocessor client is now "notified"
when it sees a macro. This is to allow usage tracking.
- Other small stuff.
This is all in one patch because the fixes are a consequence
of the change in preprocessing control.
Change-Id: I8f4c6e6366f37756ec65d0a93b79f72a3ac4ed50
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those are the types char16_t and char32_t along with the new
char/string literals u'', U'', u"", u8"", and U"".
This is particularly important for the use of QStringLiteral
since in some platforms it relies on expansion such as above.
Note: The string literals quickfixes still need some tunning.
Task-number: QTCREATORBUG-7449
Change-Id: Iebcfea15677dc8e0ebb6143def89a5477e1be7d4
Reviewed-by: hjk <qthjk@ovi.com>
|
|
|
|
|
|
|
|
| |
It will be particularly handy when introducing the new C++11
string/char literals: U"abc", u"abc", u8"abc", U'a', u'a'.
Change-Id: Ic250f5a7b999da322debb24fc0171aaef333f356
Reviewed-by: hjk <qthjk@ovi.com>
|
|
|
|
|
| |
Change-Id: I10320b01a567789585a6af111de4de3f95883bd1
Reviewed-by: hjk <qthjk@ovi.com>
|
|
|
|
|
| |
Change-Id: I49d6ff7eb1805cd07bdfcb27bb37d4c6cadc9115
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
| |
Change-Id: I82d8d60acaa9265fd25e0a3734855b19bdef9c06
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
| |
Change-Id: I7da3affea2758b2e01124105e2521e1f2c5f6678
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
| |
Change-Id: I5b7ac8f9b2137ffe9439ada4ec4aeb9cee8e249d
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
| |
Change-Id: Iac8ba58404284f0d90fd5a3640eb9ccd7e98058d
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
|
|
|
| |
they are lying. nokia has no copyright on this code. and the double
license in a single file looks weird. that's why we moved it to
3rdparty/, so it is clear it is not nokia's.
Approved-by: legal
|
|
Approved-by: legal
|