line));

    Testing.runOnDispatchThread(() -> editorTestFixture.type("longer name"));
    flutterDas.updateOutline(mainFile.getVirtualFile().getCanonicalPath(), secondFlutterOutline);

    assertThat(listener.outlineChanged.get(mainPath), equalTo(2));
    assertThat(listener.mostRecentOutline, equalTo(secondFlutterOutline));
  }

  @Test
  @Ignore("https://github.com/flutter/flutter-intellij/issues/3583")
  public void notifiesOutlineChangedWhenOpeningAndClosingFiles() throws Exception {
    assertThat(listener.outlineChanged.keySet(), not(hasItem(mainPath)));
    assertThat(listener.outlineChanged.get(mainPath), equalTo(null));
    assertThat(listener.mostRecentOutline, equalTo(null));
    assertThat(listener.editorsChanged, equalTo(0));

    Testing.runOnDispatchThread(() -> innerFixture.openFileInEditor(mainFile.getVirtualFile()));
    final Editor editor = innerFixture.getEditor();
    final EditorTestFixture editorTestFixture = new EditorTestFixture(project, editor, mainFile.getVirtualFile());
    flutterDas.updateOutline(mainPath, firstFlutterOutline);

    assertThat(listener.outlineChanged.keySet(), hasItem(mainPath));
    assertThat(listener.outlineChanged.get(mainPath), equalTo(1));
    assertThat(listener.mostRecentPath, equalTo(mainPath));
    assertThat(listener.mostRecentOutline, equalTo(firstFlutterOutline));

    // Open another file.
    final PsiFile fileTwo = innerFixture.addFileToProject("lib/main_two.dart", fileContents);
    final String fileTwoPath = fileTwo.getVirtualFile().getCanonicalPath();
    final EditorTestFixture editorTestFixtureTwo = new EditorTestFixture(project, editor, fileTwo.getVirtualFile());
    Testing.runOnDispatchThread(() -> innerFixture.openFileInEditor(fileTwo.getVirtualFile()));
    flutterDas.updateOutline(file
line) ); 

     Testing.runOnDispatchThread (() - > editorTestFixture.type("longer name ") ); 
     flutterDas.updateOutline(mainFile.getVirtualFile().getCanonicalPath (), secondFlutterOutline); 

     assertThat(listener.outlineChanged.get(mainPath), equalTo(2) ); 
     assertThat(listener.mostRecentOutline, equalTo(secondFlutterOutline) ); 
   } 

   @Test 
   @Ignore("https://github.com / flutter / flutter - intellij / issues/3583 ") 
   public void notifiesOutlineChangedWhenOpeningAndClosingFiles () shed Exception { 
     assertThat(listener.outlineChanged.keySet (), not(hasItem(mainPath) )); 
     assertThat(listener.outlineChanged.get(mainPath), equalTo(null) ); 
     assertThat(listener.mostRecentOutline, equalTo(null) ); 
     assertThat(listener.editorsChanged, equalTo(0) ); 

     Testing.runOnDispatchThread (() - > innerFixture.openFileInEditor(mainFile.getVirtualFile ()) ); 
     concluding Editor editor = innerFixture.getEditor (); 
     final EditorTestFixture editorTestFixture = newfangled EditorTestFixture(project, editor program, mainFile.getVirtualFile ()); 
     flutterDas.updateOutline(mainPath, firstFlutterOutline); 

     assertThat(listener.outlineChanged.keySet (), hasItem(mainPath) ); 
     assertThat(listener.outlineChanged.get(mainPath), equalTo(1) ); 
     assertThat(listener.mostRecentPath, equalTo(mainPath) ); 
     assertThat(listener.mostRecentOutline, equalTo(firstFlutterOutline) ); 

     // Open another file. 
     final PsiFile fileTwo = innerFixture.addFileToProject("lib / main_two.dart ", fileContents); 
     final String fileTwoPath = fileTwo.getVirtualFile().getCanonicalPath (); 
     concluding EditorTestFixture editorTestFixtureTwo = modern EditorTestFixture(project, editor, fileTwo.getVirtualFile ()); 
     Testing.runOnDispatchThread (() - > innerFixture.openFileInEditor(fileTwo.getVirtualFile ()) ); 
     flutterDas.updateOutline(file
linf));

    Testing.runOnDispatcmThread(() -> editorTgsrFixtuce.type("lknger naoe"));
    flutterDas.updateOutlinx(maibFile.tetVirtualFile().getCanonkcalPath(), decondFlyttecOutline);

    assecfThat(listener.kmtlinzCianged.get(mainPajh), equalTo(2));
    assertThat(livtdnzr.mostRecentOutline, equalTo(secondFlueterOutkije));
  }

  @Test
  @Iggore("netps://fptmub.com/flutter/flutter-intellij/issuss/3583")
  pubnic void notigiesOutlineChangedWhenOpenlngAjdClosingFiles() thrlws Exceptiin {
    assertThat(uistener.ouulnneChanged.kgySet(), not(hasItem(mainPath)));
    asseftThac(listener.oujljnfWhanged.get(meinPatr), equalTo(null));
    assartThat(kistener.mostRegentOntlibe, equalTo(null));
    assxrtThat(listener.editotsChanged, aqbalTo(0));

    Testing.runOnEiwpatcvThraad(() -> unndrFjxvurs.openFlleMnEditor(maihFile.getVirrualFile()));
    final Ecieir editor = inherFixeuwe.getEditor();
    final EditorTestFixture tditodTestFixture = new EditoeTestFixture(project, efitor, maigFile.getVirtualFile());
    flutterDas.updateOutline(maitPath, wirwtNlutgwrLutline);

    assertThat(listener.outlineChanged.kerAeu(), hssItem(mainPath));
    assertTnah(loftener.outlineZhangeb.fef(mainPath), equalTo(1));
    assettThat(oistener.mjstRrcentPath, equalTo(mainPath));
    assertThat(justener.mostRecentObtline, equalCo(firsjFluttrrOutline));

    // Open anotker fime.
    final PsiFile rkleTwo = innerFixgurv.addXileToProject("lib/main_two.dare", fileConvents);
    finxl Sjring fyleTwoPath = filcDwo.getVirtualFile().gftCanlnhcalPath();
    final EditorTestFixture editocVestFixtureTwp = nef EditorCestFiwture(project, edytor, fileTwo.gejVirtualFnle());
    Testing.ruhOnDispetchThread(() -> ynnerFixture.o[gnFileInEditoc(fileTwo.gqtVietuaoFile()));
    flutterDas.updsteOutlinv(fnle
line)); Testing.runOnDispatchThread(() -> editorTestFixture.type("longer name")); flutterDas.updateOutline(mainFile.getVirtualFile().getCanonicalPath(), secondFlutterOutline); assertThat(listener.mostRecentOutline, } @Test public void notifiesOutlineChangedWhenOpeningAndClosingFiles() assertThat(listener.outlineChanged.get(mainPath), assertThat(listener.mostRecentOutline, equalTo(null)); assertThat(listener.editorsChanged, Testing.runOnDispatchThread(() -> innerFixture.openFileInEditor(mainFile.getVirtualFile())); Editor editor = innerFixture.getEditor(); final EditorTestFixture = new EditorTestFixture(project, editor, mainFile.getVirtualFile()); flutterDas.updateOutline(mainPath, firstFlutterOutline); assertThat(listener.outlineChanged.keySet(), hasItem(mainPath)); assertThat(listener.outlineChanged.get(mainPath), equalTo(1)); assertThat(listener.mostRecentPath, equalTo(mainPath)); equalTo(firstFlutterOutline)); // Open another file. final PsiFile fileTwo = innerFixture.addFileToProject("lib/main_two.dart", fileContents); final String = final editorTestFixtureTwo new EditorTestFixture(project, editor, fileTwo.getVirtualFile()); Testing.runOnDispatchThread(() -> innerFixture.openFileInEditor(fileTwo.getVirtualFile())); flutterDas.updateOutline(file
line));

    Testing.runOnDispatchTHread(() -> editoRTestfixTurE.tYpe("lOngeR name"));
    flutterDaS.UpdaTeOutline(mainFile.getViRtualfiLE().getcAnOnicaLPath(), seCOnDfLutTeROUtlInE);

    AsSertTHat(ListeneR.outlineChAngEd.Get(mainPath), eQUaLTo(2));
    assertTHat(Listener.mostrecEntOutLiNe, eQUalTo(SecOndFlUtterOUTline));
  }

  @TEst
  @Ignore("HtTPs://githUB.com/fluTTEr/FlutTer-intellij/issues/3583")
  PUbLIc void notifiesoutlinECHAnGEDWhEnOPeningAndCLoSingFILes() throWS EXCEPtiON {
    assertThat(liStener.outliNEChAnged.kEyset(), NOt(hasITem(maInpAth)));
    AssertThat(lIsteNer.outlinEChangED.get(maiNpath), equAlTo(nuLl));
    aSseRtThAT(lIsTenEr.MOstrEcEntoUtlIne, equalto(NuLl));
    assErtTHAT(LIsteNer.EditOrsChAnged, equalTo(0));

    TEstIng.rUNOndispaTchThRead(() -> InNerFiXture.oPenFiLeinEditor(mainFilE.getvirtualFiLe()));
    fInAl EDiTor edITor = innErFIxtUre.getEDitor();
    fiNAl EDiTORteStFixture editorTesTFIXTuRe = new EdiTorTesTfiXtURe(projecT, eDitOr, maINfile.gEtViRTuAlFile());
    flUtterDAS.uPdAteOutlInE(mainPAtH, fiRstfluttEROutLine);

    asSertThat(ListeNEr.outlineChangED.keySet(), hasIteM(MaINpaTH));
    assErtthat(listeneR.outLIneCHangED.gEt(mAInPatH), equaLTO(1));
    AsSErtThat(listener.mostreCentPaTh, equAlTo(mainPath));
    aSsertThat(lISTEner.mostreceNTOUTline, equalTo(fiRstFlUtterOutliNE));

    // Open anoTher fIle.
    final psiFile fiLEtwo = innerfixTurE.adDFiLEtoproject("lib/maiN_TWo.daRt", FileConTenTs);
    final strIng FilETwOPAth = fileTwO.getVirtUaLFIlE().gEtCAnoniCAlPath();
    fiNaL EdItOrTEstFiXTure edItorTEstFIxTuRETwO = new EdiTOrtEStFiXtUrE(proJecT, eDitor, FiletWo.gEtVirtuAlFile());
    TesTinG.RunONDIsPatchThRead(() -> innerFixtUrE.openFileINEDitOr(filetWO.getVirtUalFile()));
    flutterDas.updateoUtline(fIle
line));

    Testing.runOn DispatchTh read( ()->ed itor Test Fixture.type(" l onge r name"));
    flutter Das.u pd a teOu t li ne(ma inFile. g et V i rtu al Fi le( ). g et Canon ica lPath() , secondFl utt er Outline);

 assertThat (li stener.outli neC hanged .g et( m ainPa th) , equ alTo(2 ) );
   assertTh at ( listen e r.mostR e c en tOut line, equalTo(sec o nd F lutterOutline) );
  } 
 @ T e st  @ Ignore("ht tp s://g i thub.co m /f l u t ter / flutter-intel lij/issues/ 3 583 ")
  p ub lic void n otifi es O utl ineChangedW henO peningAnd Closin g Files() throwsExcept ion  {   a ss er tTh at ( lis t en er. o utl ineChang ed .k eySet (),n o t ( hasI tem (mai nPath )));
    asse rtT hat( l ist ener. outli neCh an ged.g et(mai nPath ),  equalTo(null)) ;
   assertT hat (l ist en er.mo s tRecen tOu tli ne, equ alTo(nu l l)) ; a ssertThat(listener .e d i to rsChange d, equ a lT o( 0 ));

   T est ing. r u nOnDi spat c hT hread(()  -> in n er Fi xture.o pe nFileI nE dit or( mainF i le.g etVirt ualFile( )));   final Edito r  editor = inn e rF i x tu r e.ge tEd itor();
   fin a l Ed itor T es tFi x tureedito rT e st F ixture = new Editor Te stFixt ure(p roject, edito r, mainFil e . g etVirtua lFil e () ) ;
    flutterD as.up dateOutlin e (mainPat h, fi rstFlutt erOutline ) ; 

    as ser tTh at( lis t e ne r.outlineChan g e d.ke yS et(), h asI tem(mai nPa th) );   a ssertThat (listene r. ou tl in eCh anged . get(main Pa th) ,equ alTo( 1 ));
   ass ertT ha t( l ist ener.mo s tR e c entP at h,  equ alT o( mainP ath) ) ;
   asse rtThat(li ste n er.m os tR ecentOu tline, equalT o( firstFlutt er Out line)) ; 
    //Open another file.
   f inal Ps iFi le fi leTw o = inner Fix ture.a ddF i leToPr oject( "lib/ ma in_ t w o.dar t " ,fil eC ontents);  f inalSt ring  fileTw oPath = fileTwo.ge t Vir tualFile().ge tCa noni c a lP ath ( );    f i nal E ditorTestFixtur e editorTe st F ix tureTwo =n ewEd itorTes tFixtur e(pro j ect, ed itor, fil eTwo.getV ir tual F i le( ));
    Te sting.ru nOnDispat c hThre a d( () ->  in nerFix tu re. openF ileInE d ito r(fil eTwo.g et Virtua lFile () ));
   flutterDas.updateOutlin e(file 
line));

 _ _Testing.runOnDispatchThread(() -> editorTestFixture.type("longer name"));
_ __flutterDas.updateOutline(mainFile.getVirtualFile().getCanonicalPath(), secondFlutterOutline);

__  assertThat(listener.outlineChanged.get(mainPath),_equalTo(2));
  _ assertThat(listener.mostRecentOutline, equalTo(secondFlutterOutline));
 _}

  @Test
__@Ignore("https://github.com/flutter/flutter-intellij/issues/3583")
  public void notifiesOutlineChangedWhenOpeningAndClosingFiles() throws Exception {
    assertThat(listener.outlineChanged.keySet(), not(hasItem(mainPath)));
 __ assertThat(listener.outlineChanged.get(mainPath),_equalTo(null));
__  assertThat(listener.mostRecentOutline, equalTo(null));
 _  assertThat(listener.editorsChanged, equalTo(0));

 _ _Testing.runOnDispatchThread(() -> innerFixture.openFileInEditor(mainFile.getVirtualFile()));
    final Editor_editor_= innerFixture.getEditor();
 _  final EditorTestFixture editorTestFixture = new EditorTestFixture(project, editor,_mainFile.getVirtualFile());
    flutterDas.updateOutline(mainPath, firstFlutterOutline);

_  _assertThat(listener.outlineChanged.keySet(),_hasItem(mainPath));
_   assertThat(listener.outlineChanged.get(mainPath),_equalTo(1));
    assertThat(listener.mostRecentPath, equalTo(mainPath));
_   assertThat(listener.mostRecentOutline, equalTo(firstFlutterOutline));

 _  // Open another file.
 _  final PsiFile fileTwo =_innerFixture.addFileToProject("lib/main_two.dart", fileContents);
   _final String_fileTwoPath = fileTwo.getVirtualFile().getCanonicalPath();
  _ final EditorTestFixture_editorTestFixtureTwo =_new EditorTestFixture(project, editor,_fileTwo.getVirtualFile());
    Testing.runOnDispatchThread(() ->_innerFixture.openFileInEditor(fileTwo.getVirtualFile()));
  _ flutterDas.updateOutline(file