package _VisualDVM.Passes.All;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Sapfor.SapforFilesModification;
import _VisualDVM.ProjectData.SapforData.Functions.FuncCall;
public class SPF_InlineProcedure extends SapforFilesModification {
    FuncCall call = null;
    //  @Override
    //  protected PassCode_2021 necessary() {
    //      return null;
    //  }
    //  SPF_InlineProcedure (addOpt1_c -> name | file, addOpt2_c-> line)
    @Override
    protected boolean canStart(Object... args) throws Exception {
        if (super.canStart(args) && (call = (args.length > 0) ? (FuncCall) args[0] : null) != null) {
            addOpt1 = call.funcName + "|" + Global.mainModule.getFile().name;
            addOpt2 = String.valueOf(call.parentLineOffset);
            target.sapforProperties.PARSE_FOR_INLINE = true;
            target.sapforProperties.Update();
            SPF_ParseFilesWithOrder.silent = true;
            return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();
        }
        return false;
    }
    @Override
    protected void performFinish() throws Exception {
        SPF_ParseFilesWithOrder.silent = false;
        super.performFinish();
    }
    @Override
    protected void showDone() throws Exception {
        super.showDone();
        Global.mainModule.getFile().form.getEditor().gotoLine(call.line);
    }
}
