use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class YAMLCodeStyleSettingsProvider method createSettingsPage.
@NotNull
@Override
public Configurable createSettingsPage(final CodeStyleSettings settings, final CodeStyleSettings originalSettings) {
return new CodeStyleAbstractConfigurable(settings, originalSettings, YAMLLanguage.INSTANCE.getDisplayName()) {
@Override
protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
final CodeStyleSettings currentSettings = getCurrentSettings();
final CodeStyleSettings settings1 = settings;
return new TabbedLanguageCodeStylePanel(YAMLLanguage.INSTANCE, currentSettings, settings1) {
@Override
protected void initTabs(final CodeStyleSettings settings) {
addIndentOptionsTab(settings);
}
};
}
@Override
public String getHelpTopic() {
return "reference.settingsdialog.codestyle.yaml";
}
};
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class PyInlineLocalTest method testResultExceedsRightMargin.
// PY-12409
public void testResultExceedsRightMargin() {
final CodeStyleSettings settings = getCodeStyleSettings();
final CommonCodeStyleSettings commonSettings = settings.getCommonSettings(PythonLanguage.getInstance());
final int oldRightMargin = settings.getRightMargin(PythonLanguage.getInstance());
final boolean oldWrapLongLines = commonSettings.WRAP_LONG_LINES;
settings.setRightMargin(PythonLanguage.getInstance(), 80);
commonSettings.WRAP_LONG_LINES = true;
try {
doTest();
} finally {
commonSettings.WRAP_LONG_LINES = oldWrapLongLines;
settings.setRightMargin(PythonLanguage.getInstance(), oldRightMargin);
}
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class XmlTypedHandlersTest method testSingleQuotes.
public void testSingleQuotes() {
final CodeStyleSettings settings = getCurrentCodeStyleSettings();
final CodeStyleSettings.QuoteStyle quote = settings.HTML_QUOTE_STYLE;
try {
settings.HTML_QUOTE_STYLE = CodeStyleSettings.QuoteStyle.Single;
myFixture.configureByText(HtmlFileType.INSTANCE, "<foo bar<caret>");
myFixture.type('=');
myFixture.checkResult("<foo bar='<caret>'");
} finally {
CodeStyleSchemes.getInstance().getCurrentScheme().getCodeStyleSettings().HTML_QUOTE_STYLE = quote;
}
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class XmlFormatterTestCase method testDontKeepLineBreaksInText.
public void testDontKeepLineBreaksInText() throws Throwable {
final CodeStyleSettings settings = getSettings();
final XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
settings.setDefaultRightMargin(15);
settings.HTML_KEEP_LINE_BREAKS_IN_TEXT = false;
xmlSettings.XML_KEEP_LINE_BREAKS_IN_TEXT = false;
doTextTest("<tag>aaa\nbbb\nccc\nddd\n</tag>", "<tag>aaa bbb\n ccc ddd\n</tag>");
settings.HTML_TEXT_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP;
xmlSettings.XML_TEXT_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP;
doTextTest("<tag>aaa\nbbb\nccc\nddd\n</tag>", "<tag>aaa bbb ccc ddd\n</tag>");
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class XmlEditorTest method testHardWrap.
public void testHardWrap() throws Exception {
configureFromFileText("a.xml", "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" + "<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\">\n" + "<g>\n" + " <path clip-path=\"url(#SVGID_2_)\" fill=\"#ffffff\" stroke=\"<selection>#000000</selection>\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" d=\"M19.333,8.333V12c0,1.519-7.333,4-7.333,4s-7.333-2.481-7.333-4V8.333\"/>\n" + "</g>\n" + "</svg>");
CodeStyleSettings clone = CodeStyleSettingsManager.getInstance(getProject()).getCurrentSettings().clone();
clone.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = true;
try {
CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(clone);
EditorTestUtil.performTypingAction(getEditor(), 'x');
} finally {
CodeStyleSettingsManager.getInstance(getProject()).dropTemporarySettings();
}
checkResultByText("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" + "<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\">\n" + "<g>\n" + " <path clip-path=\"url(#SVGID_2_)\" fill=\"#ffffff\" stroke=\"x\" stroke-width=\"2\" stroke-linecap=\"round\" \n" + " stroke-linejoin=\"round\" stroke-miterlimit=\"10\" d=\"M19.333,8.333V12c0,1.519-7.333,4-7.333,4s-7.333-2.481-7.333-4V8.333\"/>\n" + "</g>\n" + "</svg>");
}
Aggregations