Qt allows signals and slots to be marked directly on the function, e.g.,
class T
{
Q_SIGNAL void some_signal();
Q_SLOT void some_slot();
};
This change modifies the Qt signal/slot tagger to look for these tags in
addition to the previously implemented search for the visibility label.
Change-Id: Ibf43df8d80d4ca9f8b62776e7a35a4fc067a289e
Reviewed-on: https://git.eclipse.org/r/10701
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
Addresses review comments from https://git.eclipse.org/r/#/c/10648.
Fixes the junit problems by making sure that the dummy PDOM acquires its
write lock before calling exercising the tag index.
Original commit message:
This new extension point allows contributors to put their own
information into the PDOM and to later retrieve it for their own
purposes.
There are many details in the bug. The idea is that contributors
provide an implementation of IBindingTagger, which is given a chance to
examine IBindings when they are created. The ITagWriter interface
allows the contributor to create a new tag which can then have data
written to it.
The ITagService interface (accessible from CCorePlugin.getTagService()
provides a way for the contributor to later get an instance of
ITagReader to retrieve tags from bindings.
ITags are copied to the PDOM when the associated binding is persisteed.
Contributors use a unique id (based on their plugin id), so that
multiple contributors are able to independently tag a given binding.
In-memory tags are not cached. I've done some timing tests using my
sample implementation and found no measurable difference. The full log
lines look like:
!MESSAGE Indexed 'simple-01' (2 sources, 184 headers) in <see below>
sec: 21,550 declarations; 35,394 references; 0 unresolved inclusions; 1
syntax errors; 0 unresolved names (0.00%)
I did 5 tests using the current master (no tagging-related code), the
times were:
18.86 sec
9.17 sec
5.91 sec
4.79 sec
4.83 sec
And then I ran the same sequence of tests using the code in this
commit:
18.73 sec
9.39 sec
6.50 sec
4.78 sec
5.27 sec
If performance does become a problem, then caching could be introduced
with a new implementation of ITaggableService. The two problems are
finding a key other than the identity of the IBinding (since IBindings
are re-created often) and properly evicting stale entries when the
binding is no longer valid.
The process of copying tags from an in-memory IBinding to a PDOMBinding,
is a synchronization. This means that tags that are no longer
applicable, will be removed from the persistent store.
While developing this I found that PDOMBindings are not deleted from the
Database (only the names that reference them are deleted), so there is
no provision for deleting all tags at once.
New database locks are not needed. By the time the persistent tags are
accessed, higher levels of code have already taken a read or write lock
as appropriate.
There are new unit tests covering the changes to the PDOM.
Change-Id: I6ae1afc949082f7f4484b3faa1550670be43312f
Reviewed-on: https://git.eclipse.org/r/10659
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
Tags signal and slot methods when the index is created. Uses these tags
to suggest values inside of SIGNAL and SLOT macro expansions. Enabled
only for projects with the QtNature.
Recognizes QObject::connect function calls and suggests SIGNAL(a) and
SLOT(a) for the 2nd and 4th parameters.
When expanding the SIGNAL and SLOT macros within a call to
QObject::connect, suggests signals and slots based on the type of the
previous parameter.
E.g. in
QObjectA a;
QObjectB b;
QObject::connect( &a, SIGNAL(*), &b, SLOT(**) );
The content assistant will suggest the methods of type QObjectA that
have been marked as signals at *, and the methods of QObjectB that have
been marked as slots at **.
Change-Id: Ia6aaa71724547b0977e322399a500f072004767a
Reviewed-on: https://git.eclipse.org/r/10532
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
The signals, slots, Q_SIGNALS, and Q_SLOTS macros are
used as 'keywords' when developing Qt applications. This
patch adds a semantic highlighter for these keywords in
projects with a qtnature.
Change-Id: I7a5906aa69e6d7dab4ce20a16b425ae177f9bd25
Reviewed-on: https://git.eclipse.org/r/10179
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>