From 5afdba06003c575d2dd41a155f7ea3f2d25308f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 26 Feb 2021 19:59:11 +0100 Subject: [PATCH] AS3 goto definition on imports --- CHANGELOG.md | 4 ++++ .../jpexs/decompiler/flash/abc/types/traits/Trait.java | 9 ++++++++- src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java | 9 +++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0ee4429b..3c2bfa498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added +- AS3 goto definition on imports + ### Fixed - #1336 AS3 direct editation - Regexp / character escaping - #1615 Turning off Checking for modifications disables SWF loading @@ -13,6 +16,7 @@ All notable changes to this project will be documented in this file. - AS3 decompilation - do not show setslot on activation when has same name as method parameter - #1450 AS3 direct editation - handling types from same package - AS3 goto definition for types in another ABC tag +- AS3 goto definition for obfuscated names ### Changed - #1616 Close SWF menuitem is last in the context menu diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java index 1eb7fb9ba..0f3b97720 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java @@ -256,7 +256,14 @@ public abstract class Trait implements Cloneable, Serializable { Collections.sort(imports); for (DottedChain imp : imports) { if (imp.size() > 1) { //No imports from root package - writer.appendNoHilight("import " + imp.toPrintableString(true) + ";").newLine(); + writer.appendNoHilight("import "); + + if (!imp.isTopLevel()) { + writer.appendNoHilight(imp.getWithoutLast().toPrintableString(true)); + writer.appendNoHilight("."); + } + writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(true, imp.getLast()), HighlightSpecialType.TYPE_NAME, imp.toRawString()); + writer.appendNoHilight(";").newLine(); hasImport = true; } } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 7843cf9fc..dae7f6a79 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -869,7 +869,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener abcIndex = new Reference<>(0); Reference classIndex = new Reference<>(0); Reference traitIndex = new Reference<>(0);