Change-Id: Idce28724b7b7b1bc8c43528036b2697386ec76b7
Signed-off-by: Marco Trudel <marco@mtsystems.ch>
Reviewed-on: https://git.eclipse.org/r/21659
Reviewed-by: Thomas Corbat <tcorbat@hsr.ch>
IP-Clean: Thomas Corbat <tcorbat@hsr.ch>
Tested-by: Thomas Corbat <tcorbat@hsr.ch>
The Open Declaration (F3), etc. actions use code in the ASTProvider. If
the provider is not able to get an AST then the actions are disabled.
The implementation of the ASTProvider has an "instanceof CEditor" check
the result being that ASTProvider can only be used when the editor is a
CEditor.
This breaks our use case where we have a CEditor embedded as a tab in a
multi-pane editor (see org.eclipse.papyrus.infra.core.sasheditor
.editor.AbstractMultiPageSashEditor).
This patch modifies the ASTProvider to use #getAdapter instead of only
the instanceof check. I've kept the common case (where the editor is a
CEditor) unchanged and added the new code as extra handling.
I've also introduced a public interface, ITranslationUnitProvider, to
avoid forcing clients to adapt to the internal CEditor class. The only
part of CEditor that ASTProvider cares about is the ITranslationUnit.
The existing implementation has an unchecked cast. The new interface
provides the required type directly.
Change-Id: Ie7e68e8909928374fa11fe2b8a857f09d042fb5c
Signed-off-by: Andrew Eidsness <andrewe@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20026
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
view.connect( view.engine(), SIGNAL( quit() ), ...
The return type of view.engine() should be checked for the quit()
signal. The implementation was actually checking the type of view.
I've fixed a copy/paste error in a utility function.
Change-Id: Id483015214f04951fb30e3271d43499f31614446
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/21189
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
In Content Assist cases like:
q->
(when the cursor is to the right of the arrow operator) the name that is
returned by the content assist context is the empty string. This was
used to check if the QObject::connect function applied. Since the empt
string matches all bindings the Qt assistant incorrectly continued.
I've added a check to stop processing when the current name is the empty
string.
Change-Id: I4e5bf52f4ca1ddc33d88a48917213adbbeb81836
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/21188
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
When a PDOMName is deleted and that name is the head of an external
references list, the list's head must be changed.
The Qt plugin is the only user of the external reference list. One case
is the link from a SIGNAL or SLOT expansion to the C++ method binding
for the corresponding function. In this case, the problem will appear
when all of the following are true:
1) The file containing the SIGNAL/SLOT expansion is changed and the
index updated
2) The corresponding function is declared in a different file
3) The the function is the first entry in the external references list
When #2 is false, the binding (and the entire list) is removed as part
of updating the file containing the name.
When #3 is false, the list is updated with existing code using the
PDOMName's {next|prev}InBinding pointers.
Change-Id: I1e27c7c2356ca1fb68f57d69c40728289288ed66
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20972
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
- Fix parsing .debug_line section in version format, part of Dwarf 4.
- Refactor in a separate method reading initial length field to
consistently handle 64-bit dwarf format
Change-Id: I9f32862ed91540c24ce33227eeb384a5d6b141da
Signed-off-by: Teodor Madan <teodor.madan@freescale.com>
Reviewed-on: https://git.eclipse.org/r/20830
The content assistant was treating all function calls in the same way.
Here is an example showing the two cases that should be handled:
qobj.connect( qobj.func(), SIGNAL( sig() ), SLOT( slot() ) );
In this case sig() applies to the return type of qobj::func() and slot()
applies to qobj (the same instance that connect is called upon).
The previous implementation of the assistant was not making a
distinction between these two cases.
I've added another test case to confirm behaviour in this area.
Change-Id: I8f76a5d5ae7384ea5162c5d36abeebb4c79c394b
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20848
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
If a project description is changed to add the Qt nature then the PDOM
needs to be rebuilt.
Since index rebuilds are potentially expensive, this first checks to
make sure the PDOM does not already contain the QtLinkage. If the
linkage already exists, then it will be updated by the normal triggers.
The reindex operation should only be needed to add the linkage the first
time the nature is added.
This does not trigger a reindex if the nature is removed. Without the
nature, the extra linkage will be safely ignored. The C++ linkage is
(proportionally) much larger than the Qt linkage, so it doesn't make
sense to spend significant time rebuilding the index just for the small
space savings.
Change-Id: I263b05e4de407775979843f5d6a9c8c172948d72
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20680
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Changes:
* QtPlugin calls QMakeProjectInfo.start/stop to start/stop listening
on resource changes
* QMakeProjectInfo listens on changes in project description
e.g. changing natures
* QMakeProjectInfo.getQMakeProjectInfoFor() returns info even for
project without QtNature - this prevents race-condition that happens
when opening legacy QML projects where QtNature is added lazily after
the project is opened and somebody already asks for QMakeProjectInfo
* Fixing QMakeProjectInfo.stop() and
QMakeProjectInfo.getQMakeProjectInfoFor() to fire notification outside
of synchronized blocks
Change-Id: Ib49238f252a249d2b5936b6d8344aae93e0ef583
Signed-off-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/20722
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
The problem is solved by allowing to ignore duplicated markers in case
there is already loaded a plugin that could handle QML files
The ProblemMarkerFilter extension point allows to filter out unneeded
problem markers. For example during building of Qt base project with QML
files tool Qt Linguist could report syntax errors in some qml file.
These errors are presented as "C/C++ Problems" in qml files because they
match format CDT expects for errors. If there is already installed plug-in
that handles QML files it is a wise to ignore such errors because they
are already reported as "QML Problems" with more meaningful descriptions.
Change-Id: I3a0a1b58e9690bed9c2774e4328760c695d54a54
Signed-off-by: Daniel Pesch <dpesch@blackberry.com>
Reviewed-on: https://git.eclipse.org/r/20581
Tested-by: Hudson CI
Reviewed-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
This adds an API method to IQObject that will return the list of QML
registrations for that type.
I've also renamed the previous "QmlRegistered" to "QmlRegistration"
because it makes more sense.
The main part of this patch is a change to the QtPDOMLinkage. It now
maintains an index of the registrations that are keyed by type. The
index is a BTree that uses the QObject name as the key and a list of QML
registration PDOMNames as the value.
The list is created in the linkage's onCreate callback. Old names are
removed in the list's onDelete callback.
This includes a test case for this scenario and also updates the
previous tests to match the new naming.
Change-Id: I4b994a51958c848b4e2a3209165e6e6866e22270
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20527
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
The Qt Codan checker for QObject::connect function calls was not
confirming that the SIGNAL and SLOT expansion parameter were Qt signals
and slots. The checker would allow the function call as long as the
expansion parameter resolved to a C++ method.
This patch changes the behaviour to required signals inside SIGNAL and
slots inside SLOT.
Change-Id: Ieec2f3a7ef4968d45ac3f6323b20c2f195fe3400
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20401
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
The QObject::connect content assistant does not work when the receiver
of the function call is an implicit this. E.g.,
class Q : public QObject { Q_OBJECT
f()
{
this->connect( ... ); // works
connect( ... ); // does not work
QObject::connect( ... ) // does not work
}
};
I've changed the Qt's ASTUtil.getReceiverType to navigate to the
ICPPClassType through the IScope's. The previous implementation was
relying on the connect function call being an IASTField
I've also added a test case for this problem.
Change-Id: I96c29a9a452280068bda39a63414c50008bfad37
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20399
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
introduced when we ported hardware debug to DSF.
Change-Id: I5232ab1e2e345edac9df640836bf8c8413ac6a36
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>