use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class LightIdeaTestFixtureImpl method tearDown.
@Override
public void tearDown() throws Exception {
Project project = getProject();
CodeStyleSettingsManager.getInstance(project).dropTemporarySettings();
CodeStyleSettings oldCodeStyleSettings = myOldCodeStyleSettings;
myOldCodeStyleSettings = null;
new RunAll().append(() -> UsefulTestCase.doCheckForSettingsDamage(oldCodeStyleSettings, getCurrentCodeStyleSettings())).append(() -> LightPlatformTestCase.doTearDown(project, LightPlatformTestCase.getApplication())).append(() -> LightPlatformTestCase.checkEditorsReleased()).append(super::tearDown).append(() -> InjectedLanguageManagerImpl.checkInjectorsAreDisposed(project)).append(() -> PersistentFS.getInstance().clearIdCache()).append(() -> PlatformTestCase.cleanupApplicationCaches(project)).run();
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-plugins by JetBrains.
the class FlexAutoImportsTest method testWrapImportStatement.
@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testWrapImportStatement() throws Throwable {
CodeStyleSettings currentSettings = CodeStyleSettingsManager.getSettings(myFixture.getProject());
int m = currentSettings.getDefaultRightMargin();
currentSettings.setDefaultRightMargin(20);
try {
JSTestUtils.addClassesToProject(myFixture, true, "wwwwww.wwwwwwwwwwwww.wwwwwwwww.Wwwwwwwwwwwwwwwwwwww");
launchImportIntention(AS_FILE_EXTENSION, "wwwwww.wwwwwwwwwwwww.wwwwwwwww.Wwwwwwwwwwwwwwwwwwww");
} finally {
currentSettings.setDefaultRightMargin(m);
}
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-plugins by JetBrains.
the class FlexOptimizeImportsTest method testAmbiguous3.
@JSTestOptions({ JSTestOption.WithJsSupportLoader, JSTestOption.WithFlexSdk })
public void testAmbiguous3() throws Throwable {
final CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject());
XmlCodeStyleSettings xmlSettings = styleSettings.getCustomSettings(XmlCodeStyleSettings.class);
int aroundCDataBefore = xmlSettings.XML_WHITE_SPACE_AROUND_CDATA;
xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = XmlCodeStyleSettings.WS_AROUND_CDATA_NEW_LINES;
JSTestUtils.addClassesToProject(myFixture, true, "com.a.ClassB", "com.b.ClassB");
runOptimizeAction(MXML_FILE_EXTENSION);
xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = aroundCDataBefore;
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class CodeStyleSettingsUtilImpl method showCodeStyleSettings.
/**
* Shows code style settings suitable for the project passed. I.e. it shows project code style page if one
* is configured to use own code style scheme or global one in other case.
* @param project
* @return Returns true if settings were modified during editing session.
*/
@Override
public boolean showCodeStyleSettings(Project project, final Class pageToSelect) {
CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(project);
CodeStyleSettings savedSettings = settingsManager.getCurrentSettings().clone();
final CodeStyleSchemesConfigurable configurable = new CodeStyleSchemesConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable, () -> {
if (pageToSelect != null) {
configurable.selectPage(pageToSelect);
}
});
return !savedSettings.equals(settingsManager.getCurrentSettings());
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class CodeStyleSchemesModel method reset.
public void reset() {
myUsePerProjectSettings = getProjectSettings().USE_PER_PROJECT_SETTINGS;
mySettingsToClone.clear();
mySchemes.clear();
ContainerUtil.addAll(mySchemes, CodeStyleSchemesImpl.getSchemeManager().getAllSchemes());
myGlobalSelected = CodeStyleSchemes.getInstance().findPreferredScheme(getProjectSettings().PREFERRED_PROJECT_CODE_STYLE);
CodeStyleSettings perProjectSettings = getProjectSettings().PER_PROJECT_SETTINGS;
if (perProjectSettings != null) {
myProjectScheme.setCodeStyleSettings(perProjectSettings);
}
myDispatcher.getMulticaster().schemeListChanged();
myDispatcher.getMulticaster().currentSchemeChanged(this);
}
Aggregations