Package com.intellij.psi.codeStyle

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings


public class MathematicaFormattingModelBuilder implements FormattingModelBuilder {

  @NotNull
  @Override
  public FormattingModel createModel(PsiElement element, CodeStyleSettings settings) {
    CommonCodeStyleSettings commonSettings = settings.getCommonSettings(MathematicaLanguage.INSTANCE);
    MathematicaCodeStyleSettings mathematicaSettings = settings.getCustomSettings(MathematicaCodeStyleSettings.class);

    return FormattingModelProvider.createFormattingModelForPsiFile(
        element.getContainingFile(),
        AbstractMathematicaBlock.createMathematicaBlock(element, commonSettings, mathematicaSettings),
View Full Code Here


    return new SmartIndentOptionsEditor();
  }

  @Override
  public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(getLanguage());
    CommonCodeStyleSettings.IndentOptions indentOptions = defaultSettings.initIndentOptions();
    indentOptions.INDENT_SIZE = 2;
    indentOptions.CONTINUATION_INDENT_SIZE = 4;
    indentOptions.TAB_SIZE = 2;
    indentOptions.USE_TAB_CHARACTER = false;
View Full Code Here

    return new SmartIndentOptionsEditor();
  }

  @Override
  public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(getLanguage());
    CommonCodeStyleSettings.IndentOptions indentOptions = defaultSettings.initIndentOptions();
    indentOptions.INDENT_SIZE = 2;
    indentOptions.CONTINUATION_INDENT_SIZE = 4;
    indentOptions.TAB_SIZE = 2;
    return defaultSettings;
  }
View Full Code Here

    doTest(testName + "." + getFileExtension(), testName + "_after." + getFileExtension(), resultNumber);
  }


  private static void setTestStyleSettings() {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    CodeStyleSettings.IndentOptions indentOptions = settings.getIndentOptions();
    assertNotNull(indentOptions);
    indentOptions.INDENT_SIZE = 4;
    indentOptions.CONTINUATION_INDENT_SIZE = 4;
    indentOptions.TAB_SIZE = 4;
View Full Code Here

    settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = false;
    settings.KEEP_FIRST_COLUMN_COMMENT = false;
  }

  public void testAlignment() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.ALIGN_MULTILINE_PARAMETERS = true;
    settings.ALIGN_MULTILINE_BINARY_OPERATION = true;
    settings.ALIGN_MULTILINE_TERNARY_OPERATION = true;
    settings.ALIGN_MULTILINE_BINARY_OPERATION = true;
    settings.KEEP_LINE_BREAKS = true;
View Full Code Here

    settings.KEEP_LINE_BREAKS = true;
    doTest();
  }

  public void testBracePlacement1() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.KEEP_LINE_BREAKS = false;
    settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED2;
    settings.METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
    doTest();
  }
View Full Code Here

    settings.METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
    doTest();
  }

  public void testBracePlacement2() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.KEEP_LINE_BREAKS = false;
    settings.BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE;
    settings.METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED;
    doTest();
  }
View Full Code Here

  public void testWEB_7058() throws Exception {
    doTest();
  }

  public void testSpaceAroundOperators() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.KEEP_LINE_BREAKS = false;
    settings.SPACE_AROUND_ASSIGNMENT_OPERATORS = false;
    settings.SPACE_AROUND_LOGICAL_OPERATORS = false;
    settings.SPACE_AROUND_EQUALITY_OPERATORS = false;
    settings.SPACE_AROUND_RELATIONAL_OPERATORS = false;
View Full Code Here

    settings.SPACE_AROUND_MULTIPLICATIVE_OPERATORS = false;
    doTest();
  }

  public void testSpaceBeforeParentheses() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.KEEP_LINE_BREAKS = false;
    settings.SPACE_BEFORE_METHOD_CALL_PARENTHESES = true;
    settings.SPACE_BEFORE_METHOD_PARENTHESES = true;
    settings.SPACE_BEFORE_IF_PARENTHESES = false;
    settings.SPACE_BEFORE_FOR_PARENTHESES = false;
View Full Code Here

    settings.SPACE_BEFORE_CATCH_PARENTHESES = false;
    doTest();
  }

  public void testSpaceLeftBraces() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.KEEP_LINE_BREAKS = false;
    settings.SPACE_BEFORE_METHOD_LBRACE = false;
    settings.SPACE_BEFORE_IF_LBRACE = false;
    settings.SPACE_BEFORE_ELSE_LBRACE = false;
    settings.SPACE_BEFORE_FOR_LBRACE = false;
View Full Code Here

TOP

Related Classes of com.intellij.psi.codeStyle.CommonCodeStyleSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.