void () { myFixture.configureByText("foo.xml", "<foo xmlns=\"http://foo.bar\" \n" + " xxx=\"ba<caret>r\"/>"); assertNull(myFixture.getReferenceAtCaretPosition()); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), new FileReferenceInjector()); assertTrue(myFixture.getReferenceAtCaretPosition() instanceof FileReference); Configuration configuration = Configuration.getInstance(); Element element = configuration.getState(); configuration.loadState(element); PsiManager.getInstance(getProject()).dropPsiCaches(); assertTrue(myFixture.getReferenceAtCaretPosition() instanceof FileReference); UnInjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile()); assertNull(myFixture.getReferenceAtCaretPosition()); }