Examples of CommonCodeStyleSettings


Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

    settings.SPACE_BEFORE_CATCH_LBRACE = false;
    doTest();
  }

  public void testSpaceOthers() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.KEEP_LINE_BREAKS = false;
    settings.SPACE_BEFORE_WHILE_KEYWORD = false;
    settings.SPACE_BEFORE_CATCH_KEYWORD = false;
    settings.SPACE_BEFORE_ELSE_KEYWORD = false;
    settings.SPACE_BEFORE_QUEST = false;
View Full Code Here

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

    settings.SPACE_AFTER_SEMICOLON = false;
    doTest();
  }

  public void testSpaceWithin() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.KEEP_LINE_BREAKS = false;
    settings.SPACE_WITHIN_METHOD_CALL_PARENTHESES = true;
    settings.SPACE_WITHIN_METHOD_PARENTHESES = true;
    settings.SPACE_WITHIN_IF_PARENTHESES = true;
    settings.SPACE_WITHIN_FOR_PARENTHESES = true;
View Full Code Here

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

    settings.SPACE_WITHIN_CATCH_PARENTHESES = true;
    doTest();
  }

  public void testWrappingMeth() throws Exception {
    final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
    settings.METHOD_ANNOTATION_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
    settings.METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE = true;
    settings.METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE = true;
    settings.CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
    settings.CALL_PARAMETERS_LPAREN_ON_NEXT_LINE = true;
View Full Code Here

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

    String testName = getTestName(false);
    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 = 2;
    indentOptions.CONTINUATION_INDENT_SIZE = 2;
    indentOptions.TAB_SIZE = 2;
View Full Code Here

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

    return GherkinLanguage.INSTANCE;
  }

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

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

        final GoFile goFile = createGoFile(fileText);

        final Editor myEditor = myFixture.getEditor();
        CodeStyleSettings settings =
                CodeStyleSettingsManager.getInstance(getProject()).getCurrentSettings();
        CommonCodeStyleSettings commonSettings =
                settings.getCommonSettings(GoLanguage.INSTANCE);

        if (commonSettings != null) {
            CommonCodeStyleSettings.IndentOptions indentOptions =
                    commonSettings.getIndentOptions();

            if (indentOptions != null)
                indentOptions.USE_TAB_CHARACTER = true;
        }
View Full Code Here

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

                                       CodeStyleSettings settings) {

        final FileElement fileElement = TreeUtil.getFileElement(
            (TreeElement) SourceTreeToPsiMap.psiElementToTree(element));

        CommonCodeStyleSettings goSettings =
            settings.getCommonSettings(GoLanguage.INSTANCE);

        Block block = GoBlockGenerator.generateBlock(fileElement, goSettings);

        return FormattingModelProvider
View Full Code Here

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

        return GoLanguage.INSTANCE;
    }

    @Override
    public CommonCodeStyleSettings getDefaultCommonSettings() {
        CommonCodeStyleSettings defaultSettings =
            new CommonCodeStyleSettings(GoLanguage.INSTANCE);

        CommonCodeStyleSettings.IndentOptions indentOptions =
            defaultSettings.initIndentOptions();

        indentOptions.USE_TAB_CHARACTER = true;
        indentOptions.INDENT_SIZE = 4;
        indentOptions.TAB_SIZE = 4;
        indentOptions.CONTINUATION_INDENT_SIZE = 8;
View Full Code Here

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

    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

Examples of com.intellij.psi.codeStyle.CommonCodeStyleSettings

public class ErlangFormattingModelBuilder implements FormattingModelBuilder {
  @NotNull
  @Override
  public FormattingModel createModel(PsiElement element, CodeStyleSettings settings) {
    CommonCodeStyleSettings commonSettings = settings.getCommonSettings(ErlangLanguage.INSTANCE);
    ErlangCodeStyleSettings erlangSettings = settings.getCustomSettings(ErlangCodeStyleSettings.class);
    SpacingBuilder spacingBuilder = createSpacingBuilder(commonSettings, erlangSettings);
    ErlangFormattingBlock block = new ErlangFormattingBlock(element.getNode(), null, null, null, commonSettings, erlangSettings, spacingBuilder, -1);
    return FormattingModelProvider.createFormattingModelForPsiFile(element.getContainingFile(), block, settings);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.