diff --git a/CHANGELOG.md b/CHANGELOG.md
index 75e987ebd..2339e1177 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file.
- Graph dialog proper window size
- Graph dialog scroll speed increased
- AS3: return in finally
+- AS3 docs not correctly displayed under p-code when metadata present
### Changed
- AS3 test methods separated to classes
diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/docs/As3PCodeOtherDocs.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/docs/As3PCodeOtherDocs.java
index ee7cb985d..6d0bd4864 100644
--- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/docs/As3PCodeOtherDocs.java
+++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/docs/As3PCodeOtherDocs.java
@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library.
*/
+ * License along with this library.
+ */
package com.jpexs.decompiler.flash.docs;
import com.jpexs.decompiler.flash.ApplicationInfo;
@@ -77,6 +78,9 @@ public class As3PCodeOtherDocs extends AbstractDocs {
if (curPath.startsWith("trait.method")) {
curPath = path.substring("trait.".length());
}
+ if (curPath.startsWith("method.body.trait.")) {
+ curPath = path.substring("method.body.".length());
+ }
if (prop.containsKey(curPath)) {
String docStr = prop.getString(curPath);
sb.append("
");
diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3other.properties b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3other.properties
index 26347b3b1..bd3923d7c 100644
--- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3other.properties
+++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/locales/docs/pcode/AS3other.properties
@@ -63,6 +63,9 @@ trait.dispid = Dispatch id
#slot/const/class/function
trait.slotid = Slot id
+trait.type = Type of trait
+trait.value = Default value for a trait
+
method = Method
method.name = Name of the method
method.flag = Method flag
@@ -90,3 +93,4 @@ method.body.try.target = Position to which control should jump if exception of t
method.body.try.type = Type of catched exception
method.body.try.name = Name of the exception object
method.body.code = Code of the method body
+method.body.trait = Trait of the method body
diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java
index 8d724d9c9..fb044ba77 100644
--- a/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java
+++ b/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java
@@ -464,7 +464,9 @@ public class ASMSourceEditorPane extends DebuggableEditorPane implements CaretLi
ParsedSymbol.TYPE_KEYWORD_MAXSCOPEDEPTH,
ParsedSymbol.TYPE_KEYWORD_TRY,
ParsedSymbol.TYPE_KEYWORD_DISPID,
- ParsedSymbol.TYPE_KEYWORD_SLOTID,};
+ ParsedSymbol.TYPE_KEYWORD_SLOTID,
+ ParsedSymbol.TYPE_KEYWORD_TYPE,
+ ParsedSymbol.TYPE_KEYWORD_VALUE,};
final Integer parameters[] = new Integer[]{
ParsedSymbol.TYPE_KEYWORD_FROM,
ParsedSymbol.TYPE_KEYWORD_TO,
@@ -507,6 +509,14 @@ public class ASMSourceEditorPane extends DebuggableEditorPane implements CaretLi
lastLevel = levels.peek();
}
+ if (line != lastLine && !levels.isEmpty()) {
+ while (types.peek() == TYPE_LINE_BLOCK || types.peek() == TYPE_PARAMETER) {
+ levels.pop();
+ types.pop();
+ lines.pop();
+ }
+ }
+
int type = TYPE_IGNORED;
if (symb.type == ParsedSymbol.TYPE_KEYWORD_METHOD && "trait".equals(lastLevel)) {
type = TYPE_PARAMETER;
@@ -536,13 +546,6 @@ public class ASMSourceEditorPane extends DebuggableEditorPane implements CaretLi
aboutToBreak = true;
}
- if (line != lastLine && !levels.isEmpty()) {
- while (types.peek() == TYPE_LINE_BLOCK || types.peek() == TYPE_PARAMETER) {
- levels.pop();
- types.pop();
- lines.pop();
- }
- }
if (type != TYPE_IGNORED) {
if (!levels.isEmpty()) {