diff options
author | Jeff Johnston | 2019-04-26 15:46:41 +0000 |
---|---|---|
committer | Jeff Johnston | 2019-04-26 17:45:44 +0000 |
commit | 5edac6e20c69845546fe873268989f53b5f55a48 (patch) | |
tree | 56eff637bfc361476c9fcaad24cdb8704ba2c3a4 /core/org.eclipse.cdt.ui | |
parent | 225ee8550a5eae96fc71b408de5eed19a6ae2984 (diff) | |
download | org.eclipse.cdt-5edac6e20c69845546fe873268989f53b5f55a48.tar.gz org.eclipse.cdt-5edac6e20c69845546fe873268989f53b5f55a48.tar.xz org.eclipse.cdt-5edac6e20c69845546fe873268989f53b5f55a48.zip |
Bug 546395 - Added "copy qualified name" feature
- fix isValidSelection() to not bog down performance
Change-Id: I8d3b595c988f09c731d76b8174f5175b31115460
Diffstat (limited to 'core/org.eclipse.cdt.ui')
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CopyQualifiedNameAction.java | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CopyQualifiedNameAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CopyQualifiedNameAction.java index 1e6444cc1a7..222ebce1f3d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CopyQualifiedNameAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CopyQualifiedNameAction.java @@ -82,23 +82,7 @@ public class CopyQualifiedNameAction extends TextEditorAction { private boolean isValidSelection(ITextSelection selection) { if (selection == null || selection.isEmpty() || selection.getLength() <= 0) return false; - final int offset = selection.getOffset(); - final int length = selection.getLength(); - ITranslationUnit translationUnit = (ITranslationUnit) CDTUITools - .getEditorInputCElement(fEditor.getEditorInput()); - String qualName = null; - try { - IASTTranslationUnit ast = translationUnit.getAST(null, 0); - if (ast != null) { - IASTNode enclosingNode = ast.getNodeSelector(null).findEnclosingNode(offset, length); - NameVisitor n = new NameVisitor(); - enclosingNode.accept(n); - qualName = n.getQualifiedName(); - } - } catch (CoreException e) { - return false; - } - return qualName != null; + return true; } @Override |