mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-30 21:55:31 +02:00
![]() 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> |
||
---|---|---|
.. | ||
.settings | ||
about_files | ||
browser | ||
dictionaries | ||
icons | ||
META-INF | ||
schema | ||
src/org/eclipse/cdt | ||
templateengine/org/eclipse/cdt/ui | ||
templates | ||
utils.ui/org/eclipse/cdt/utils/ui/controls | ||
.classpath | ||
.cvsignore | ||
.options | ||
.project | ||
about.html | ||
build.properties | ||
ChangeLog | ||
ChangeLog-2003 | ||
doxygenTags.csv | ||
NEWS | ||
plugin.properties | ||
plugin.xml | ||
pom.xml |