Package com.intellij.psi.codeStyle

Examples of com.intellij.psi.codeStyle.CodeStyleSettings


    );
  }

  public void testFormattingInsideDoNotIndentElems2() {

    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    settings.HTML_DO_NOT_INDENT_CHILDREN_OF = "body";

    doStringBasedTest(

      "<body>\n" +
View Full Code Here


    );
  }

  public void testFormattingInsideNestedDoNotIndentElems() {

    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    settings.HTML_DO_NOT_INDENT_CHILDREN_OF = "span";

    doStringBasedTest(

      "<span>\n" +
View Full Code Here

  }


  private void setTestStyleSettings() {
    Project project = getProject();
    CodeStyleSettings currSettings = CodeStyleSettingsManager.getSettings(project);
    Assert.assertNotNull(currSettings);
    CodeStyleSettings tempSettings = currSettings.clone();
    CodeStyleSettings.IndentOptions indentOptions = tempSettings.getIndentOptions(CfmlFileType.INSTANCE);
    Assert.assertNotNull(indentOptions);
    defineStyleSettings(tempSettings);
    CodeStyleSettingsManager.getInstance(project).setTemporarySettings(tempSettings);
  }
View Full Code Here

    private String processFile(String fileText, boolean addCaretMarker) throws IOException {
        addPackageBuiltin();
        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();
View Full Code Here

    inspectionProfileManager.setRootProfile(profile.getName());
    InspectionProjectProfileManager.getInstance(getProject()).updateProfile(profile);

    assertFalse(getPsiManager().isDisposed());

    CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(new CodeStyleSettings());
  }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        Assert.assertNull(myTempSettings);
        CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
        myTempSettings = settings.clone();
        CodeStyleSettings.IndentOptions indentOptions = myTempSettings.getIndentOptions(PbFileType.PROTOBUF_FILE_TYPE);
        Assert.assertNotSame(indentOptions, settings.OTHER_INDENT_OPTIONS);
        indentOptions.INDENT_SIZE = 4;
        indentOptions.TAB_SIZE = 4;
        indentOptions.CONTINUATION_INDENT_SIZE = 8;
View Full Code Here

    super.tearDown();
  }

  private void setTestStyleSettings() {
    CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(getProject());
    CodeStyleSettings currSettings = settingsManager.getCurrentSettings();
    Assert.assertNotNull(currSettings);
    myTemporarySettings = currSettings.clone();
    CodeStyleSettings.IndentOptions indentOptions = myTemporarySettings.getIndentOptions(ErlangFileType.MODULE);
    Assert.assertNotNull(indentOptions);
    settingsManager.setTemporarySettings(myTemporarySettings);
  }
View Full Code Here

      KW_AS, KW_BREAK, KW_CRATE, KW_ELSE, KW_ENUM, KW_EXTERN, KW_FALSE, KW_FN, KW_FOR, KW_IF, KW_IMPL,
      KW_IN, KW_LET, KW_LOOP, KW_MATCH, KW_MOD, KW_PRIV, KW_PROC, KW_PUB, KW_RETURN, KW_CONTINUE, KW_MACRO_RULES,
      KW_SELF, KW_STATIC, KW_STRUCT, KW_SUPER, KW_TRUE, KW_TRAIT, KW_TYPE, KW_UNSAFE, KW_USE, KW_WHILE
    );

    CodeStyleSettings codeStyleSettings = new CodeStyleSettings();

    return new SpacingBuilder(codeStyleSettings, RustLanguage.INSTANCE)
      .before(COMMA).spaceIf(settings.SPACE_BEFORE_COMMA)
      .after(COMMA).spaceIf(settings.SPACE_AFTER_COMMA)
      .before(SEMICOLON).none()
View Full Code Here

            // Always drop any current temporary settings so that the defaults will be applied if
            // this is a non-editorconfig-managed file
            codeStyleSettingsManager.dropTemporarySettings();
            // Prepare a new settings object, which will maintain the standard settings if no
            // editorconfig settings apply
            final CodeStyleSettings currentSettings = codeStyleSettingsManager.getCurrentSettings();
            final CodeStyleSettings newSettings = new CodeStyleSettings();
            newSettings.copyFrom(currentSettings);
            // Get editorconfig settings
            final String filePath = file.getCanonicalPath();
            final SettingsProviderComponent settingsProvider = SettingsProviderComponent.getInstance();
            final List<OutPair> outPairs = settingsProvider.getOutPairs(filePath);
            // Apply editorconfig settings for the current editor
View Full Code Here

    }

    private void writeContentsToFile(final PsiFile psiFile,
                                     final File outFile)
            throws IOException {
        final CodeStyleSettings codeStyleSettings
                = CodeStyleSettingsManager.getSettings(psiFile.getProject());

        final BufferedWriter tempFileOut = new BufferedWriter(
                new FileWriter(outFile));
        for (final char character : psiFile.getText().toCharArray()) {
            if (character == '\n') { // IDEA uses \n internally
                tempFileOut.write(codeStyleSettings.getLineSeparator());
            } else {
                tempFileOut.write(character);
            }
        }
        tempFileOut.flush();
View Full Code Here

TOP

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

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.