Commit Graph

54 Commits

Author SHA1 Message Date
Artem Sokolovskii
7e69b64b74 CppEditor: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I9915cf2c07bdcc570efc20601752d60f2ec82f34
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-06 13:35:43 +00:00
Christian Kandeler
c3a1193969 TextEditor: Add highlighting category for namespaces
... and make use of it in the built-in code model and with clangd.

Task-number: QTCREATORBUG-16580
Change-Id: I8c331f56aa1bbf91c9f768be82a779a72f40c4c7
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-29 08:36:20 +00:00
Christian Kandeler
d8d4739bc4 TextEditor: Allow special highlighting for static members
Task-number: QTCREATORBUG-9659
Change-Id: Idae529fd876ba5f555c76e4d282efc9263263d6c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-28 10:04:57 +00:00
Christian Kandeler
72d52f3ac2 CppEditor: Un-export some classes
Change-Id: I285fe7bd3ac835c4a43f0a200dd7905f577ff211
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-06 14:48:17 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Erik Verbruggen
dbc3332b8e C++: Moved completion/highlighting into the model manager.
This way the editor does not need to know all the details of
instantiating or maintaining classes for highlighting and/or completion,
it can just ask the model manager. The change also enables different
highlighting- or completion-engines without changes to the cppeditor.

Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-02-08 14:30:14 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
Leandro Melo
efe9bca20c C++: Replace non-absolute-critical asserts for soft ones
Change-Id: I021074a78d90929b4e83b8aff9db1ae7995e8c6a
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-24 09:58:59 +01:00
Leandro Melo
c287d90604 C++: Rename source/setSource to utf8Source/setUtf8Source
Continuinng a previous commit... This is in order to make
the interface clearer.

Change-Id: Ic1b05217f878578bc84a064927507b75981c47d6
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-13 11:22:28 +01:00
Leandro Melo
fd179ed951 C++: Accept UTF-8 byte arrays in type of expression
The model uses UTF-8 internally and it makes more sense to only
convert when necessary.

A following commit will rename the source/setSource methods in
document for more clarity too.

Change-Id: I960ea0754efabd1436ad4b4299a57faeb65a8bee
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-13 10:17:03 +01:00
Friedemann Kleint
9128fc2ab0 CppEditor: Compile with QT_NO_CAST_FROM_ASCII.
- Avoid unnecessary conversions
- Add missing tr().

Change-Id: I3c0dd627a3621929c9c6fc71db6924fa513e34a7
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-01-12 13:50:30 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
Christian Kamm
ed8a7fc87c C++: Clean up semantic highlighter chunking code.
Change-Id: I5398442bdb864c4bccd8c193364bed3879bbc660
Reviewed-on: http://codereview.qt.nokia.com/4042
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-01 11:27:55 +02:00
Christian Kamm
2c7a1104fa C++ semantic highlighting: Report uses sorted by line.
This moves sorting from the gui thread to the future and
allows the incremental application of the extra formats
to assume chunks are sorted.

Change-Id: I38e179e573c43cc955cce820f17ac87e3300a839
Reviewed-on: http://codereview.qt.nokia.com/3869
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-08-30 14:50:52 +02:00
Christian Kamm
c105ae47c1 QmlJS: Add semantic highlighting.
Change-Id: If9293244075cff1a52801b50cdbb77248ecd21ea
Reviewed-on: http://codereview.qt.nokia.com/3310
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-24 11:30:20 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
Friedemann Kleint
774fa49412 Fix more krazy warnings. 2011-04-19 15:43:53 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
Erik Verbruggen
86f487a296 Fixed inconsistent highlighting of virtual destructor.
Task-number: QTCREATORBUG-3404
2011-01-19 17:19:59 +01:00
Erik Verbruggen
f8db0ae7ce Prevent preleminary flushes to prevent order mess-ups.
The semantic highlighter relies on the highlight ranges to be subsequent
and non-overlapping. A method body in a class nested in a method can
result in flushes before the semantic info for the enclosing method is
calculated, resulting in overlapping ranges.

Task-number: QTCREATORBUG-3364
Reviewed-by: Roberto Raggi
2011-01-19 14:23:30 +01:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Roberto Raggi
1dfc6eb71e Search for possible types in the template arguments. 2010-09-09 16:06:27 +02:00
Roberto Raggi
05f2fd6669 Renamed Symbol::scope() to Symbol::enclosingScope(). 2010-08-26 16:16:22 +02:00
Roberto Raggi
efb600665d Remember the T_TEMPLATE token we use to force the parser to recognize a template-id. 2010-08-12 12:29:12 +02:00
Roberto Raggi
7f04af17a1 Mark the elaborated type specifiers. 2010-08-12 12:29:11 +02:00
Roberto Raggi
c82bfad2f5 Mark forward template class declarations. 2010-08-12 11:41:51 +02:00
Roberto Raggi
65a1c12923 Look only at template classes. 2010-08-11 15:39:00 +02:00
Roberto Raggi
f446363d63 Mark the templates. 2010-08-11 15:25:20 +02:00
Roberto Raggi
6618a3cd67 Removed TemplateParameters. 2010-08-11 15:25:19 +02:00
Roberto Raggi
354b9712e4 Merged ScopedSymbol and Scope. 2010-08-11 15:25:18 +02:00
Roberto Raggi
430c78f3db Renamed CollectTypes. 2010-08-10 10:54:40 +02:00
Roberto Raggi
254aff3978 Highlight the enumerators using the Static `char format'.
The new `Static' format will be used to mark all the static members, e.g. enumerators,
static functions, and static class members, but right now, it is used only for enumerators.
2010-08-09 18:07:09 +02:00
Roberto Raggi
633580d7f3 Mark the virtual destructors. 2010-08-09 17:06:12 +02:00
Roberto Raggi
52b062c43d Look only at the viable functions. 2010-08-09 15:40:14 +02:00
Roberto Raggi
463f83630f Speed up the comutation of the local members. 2010-08-06 11:35:00 +02:00
Roberto Raggi
928c68746a Set the right context when processing decl-specifiers. 2010-08-05 12:23:55 +02:00
Roberto Raggi
4d07a9bdcb Simplified CppCheckSymbols. 2010-08-05 12:19:26 +02:00
Roberto Raggi
7028b951f2 Ignore shadowed symbols. 2010-08-03 18:38:55 +02:00
Roberto Raggi
fc1006e296 Highlight only the unqualified name id. 2010-08-03 18:14:34 +02:00
Roberto Raggi
c4d4a493a9 Check for possible 0x0 access. 2010-08-03 18:08:13 +02:00
Roberto Raggi
1932ffd1c6 Highlight the virtual methods. 2010-08-03 17:35:02 +02:00
Roberto Raggi
f088ba71d5 Handle C++ mem-intitializers 2010-08-03 13:02:45 +02:00
Roberto Raggi
034798c0ef Recognize the members. 2010-08-03 12:22:40 +02:00
Roberto Raggi
014b36d3f1 It looks like there's no need to release the CPU anymore. 2010-07-21 15:31:23 +02:00
Roberto Raggi
99b6492465 Reduce the CPU usage of the semantic highlighter. 2010-07-19 11:09:41 +02:00
Erik Verbruggen
867bf3dae8 Fixes for scope range calculation. 2010-07-19 10:42:32 +02:00
Roberto Raggi
615381a5b1 Use addUsage() instead of addTypeUsage(). 2010-07-19 10:32:25 +02:00
Roberto Raggi
4ab3e05a12 Request a flush after processing a function definition. 2010-07-16 17:57:33 +02:00
Roberto Raggi
fff4203a46 Introduced helpers to rewrite types and names.
Done-with: Erik Verbruggen
2010-07-16 11:04:52 +02:00