1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00
Find a file
Andrew Eidsness d046e0a25f Bug 423679: CEditor navigation actions disabled outside of CEditor
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>
2014-01-29 16:23:34 -05:00
build Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
codan Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
core Bug 423679: CEditor navigation actions disabled outside of CEditor 2014-01-29 16:23:34 -05:00
cross Bug 426586 - [launch] Rename launch delegates to be more descriptive to 2014-01-27 15:42:30 -05:00
debug Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
doc Bumped up CDT version to 8.4. 2014-01-21 17:35:29 -05:00
dsf Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
dsf-gdb Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
jtag Bug 426586 - [launch] Rename launch delegates to be more descriptive to 2014-01-27 15:42:30 -05:00
launch/org.eclipse.cdt.launch Bug 426586 - [launch] Rename launch delegates to be more descriptive to 2014-01-27 15:42:30 -05:00
llvm Bumped up CDT version to 8.4. 2014-01-21 17:35:29 -05:00
lrparser Bumped up CDT version to 8.4. 2014-01-21 17:35:29 -05:00
memory Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
p2 Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
qt Bug 426784: Qt Codan checker uses wrong type 2014-01-29 16:12:49 -05:00
releng Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
testsrunner Bug 426586 - [launch] Rename launch delegates to be more descriptive to 2014-01-27 15:42:30 -05:00
upc Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
util Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
visualizer Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
windows Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
xlc Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
.gitignore Ignore NFS-created files. 2012-11-08 13:34:54 -08:00
pom.xml Bumped up CDT version to 8.4. 2014-01-21 17:35:29 -05:00