AS3 error highligter - show multiple errors

This commit is contained in:
Jindra Petřík
2025-05-29 21:22:40 +02:00
parent e06756b32a
commit e9db3273e8
5 changed files with 461 additions and 557 deletions
@@ -16,11 +16,9 @@
*/
package com.jpexs.decompiler.flash.gui.action;
import com.jpexs.decompiler.flash.gui.editor.VariableMarker;
import com.jpexs.decompiler.flash.DisassemblyListener;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.ValueTooLargeException;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScript3SimpleParser;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraph;
import com.jpexs.decompiler.flash.action.ActionList;
@@ -60,6 +58,7 @@ import com.jpexs.decompiler.flash.gui.ViewMessages;
import com.jpexs.decompiler.flash.gui.controls.JPersistentSplitPane;
import com.jpexs.decompiler.flash.gui.controls.NoneSelectedButtonGroup;
import com.jpexs.decompiler.flash.gui.editor.DebuggableEditorPane;
import com.jpexs.decompiler.flash.gui.editor.VariableMarker;
import com.jpexs.decompiler.flash.gui.tagtree.AbstractTagTreeModel;
import com.jpexs.decompiler.flash.helpers.HighlightedText;
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
@@ -162,6 +162,14 @@ public class VariableMarker implements SyntaxComponent, CaretListener, PropertyC
private Token getNearestTokenAt(SyntaxDocument sDoc, int pos) {
Token thisToken = sDoc.getTokenAt(pos);
if (thisToken != null) {
if (thisToken.length == 1) {
Token nextToken = sDoc.getTokenAt(pos + 1);
if (nextToken != null && nextToken.start == pos && nextToken.length > 1) {
return nextToken;
}
}
return thisToken;
}
@@ -385,6 +393,7 @@ public class VariableMarker implements SyntaxComponent, CaretListener, PropertyC
definitionPosToReferences.clear();
referenceToDefinition.clear();
errors.put((int) ex.position, ex.getMessage());
ex.printStackTrace();
}
Timer tim = errorsTimer;
if (tim != null) {