mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix PyDeprecationTest: allow to turn off the new behavior of looking for an injected fragment under the caret in CodeInsightTestFixture
This commit is contained in:
+8
@@ -493,4 +493,12 @@ public interface CodeInsightTestFixture extends IdeaProjectTestFixture {
|
||||
* @param consumer the callback in which the actual testing of the structure view is performed.
|
||||
*/
|
||||
void testStructureView(Consumer<StructureViewComponent> consumer);
|
||||
|
||||
/**
|
||||
* By default, if the caret in the text passed to {@link #configureByFile(String)} or {@link #configureByText} has an injected fragment
|
||||
* at the caret, the test fixture puts the caret into the injected editor. This method allows to turn off this behavior.
|
||||
*
|
||||
* @param caresAboutInjection true if the fixture should look for an injection at caret, false otherwise.
|
||||
*/
|
||||
void setCaresAboutInjection(boolean caresAboutInjection);
|
||||
}
|
||||
|
||||
+9
-1
@@ -153,6 +153,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
@NonNls private static final String XXX = "XXX";
|
||||
private final FileTreeAccessFilter myJavaFilesFilter = new FileTreeAccessFilter();
|
||||
private boolean myAllowDirt;
|
||||
private boolean myCaresAboutInjection = true;
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public CodeInsightTestFixtureImpl(IdeaProjectTestFixture projectFixture, TempDirTestFixture tempDirTestFixture) {
|
||||
@@ -1363,7 +1364,9 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
module.getMessageBus().syncPublisher(FacetManager.FACETS_TOPIC).facetConfigurationChanged(facet);
|
||||
}
|
||||
}
|
||||
setupEditorForInjectedLanguage();
|
||||
if (myCaresAboutInjection) {
|
||||
setupEditorForInjectedLanguage();
|
||||
}
|
||||
}
|
||||
}.execute().throwException();
|
||||
|
||||
@@ -1928,6 +1931,11 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaresAboutInjection(boolean caresAboutInjection) {
|
||||
myCaresAboutInjection = caresAboutInjection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LookupImpl getLookup() {
|
||||
return (LookupImpl)LookupManager.getActiveLookup(myEditor);
|
||||
|
||||
Reference in New Issue
Block a user