Search in sources :

Example 76 with CodeStyleSettings

use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.

the class BindFieldsFromParametersTest method tearDown.

@Override
protected void tearDown() throws Exception {
    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    settings.FIELD_NAME_PREFIX = "";
    settings.PREFER_LONGER_NAMES = myPreferLongNames;
    super.tearDown();
}
Also used : CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings)

Example 77 with CodeStyleSettings

use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.

the class CreateConstructorParameterFromFieldTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    enableInspectionTools(new UnusedDeclarationInspection(), new MissortedModifiersInspection(), new UnqualifiedFieldAccessInspection());
    final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    myPreferLongNames = settings.PREFER_LONGER_NAMES;
    if (getTestName(false).contains("SameParameter")) {
        settings.PREFER_LONGER_NAMES = false;
    }
}
Also used : CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) MissortedModifiersInspection(com.siyeh.ig.style.MissortedModifiersInspection) UnqualifiedFieldAccessInspection(com.siyeh.ig.style.UnqualifiedFieldAccessInspection) UnusedDeclarationInspection(com.intellij.codeInspection.deadCode.UnusedDeclarationInspection)

Example 78 with CodeStyleSettings

use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.

the class Lambda2MethodReferenceInspectionTest method tearDown.

@Override
protected void tearDown() throws Exception {
    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    settings.REPLACE_CAST = settings.REPLACE_INSTANCEOF = false;
    super.tearDown();
}
Also used : CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings)

Example 79 with CodeStyleSettings

use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.

the class AddSingleStaticImportActionTest method testSingleImportWhenConflictingWithOnDemand.

public void testSingleImportWhenConflictingWithOnDemand() throws Exception {
    myFixture.addClass("package foo; class Foo {public static void foo(int i){}}");
    myFixture.addClass("package foo; class Bar {public static void foo(String s){}}");
    myFixture.configureByFile(getTestName(false) + ".java");
    CodeStyleSettings settings = CodeStyleSettingsManager.getInstance(getProject()).getCurrentSettings();
    int old = settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND;
    settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = 1;
    try {
        IntentionAction intention = myFixture.findSingleIntention("Add static import for 'foo.Foo.foo'");
        assertNotNull(intention);
        myFixture.launchAction(intention);
        myFixture.checkResultByFile(getTestName(false) + "_after.java");
    } finally {
        settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = old;
    }
}
Also used : CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings)

Example 80 with CodeStyleSettings

use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.

the class CopyAbstractMethodImplementationTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()).clone();
    settings.INSERT_OVERRIDE_ANNOTATION = false;
    CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(settings);
}
Also used : CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings)

Aggregations

CodeStyleSettings (com.intellij.psi.codeStyle.CodeStyleSettings)190 CommonCodeStyleSettings (com.intellij.psi.codeStyle.CommonCodeStyleSettings)84 Project (com.intellij.openapi.project.Project)12 XmlCodeStyleSettings (com.intellij.psi.formatter.xml.XmlCodeStyleSettings)12 ECMA4CodeStyleSettings (com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings)9 JSCodeStyleSettings (com.intellij.lang.javascript.formatter.JSCodeStyleSettings)9 Document (com.intellij.openapi.editor.Document)9 JavaCodeStyleSettings (com.intellij.psi.codeStyle.JavaCodeStyleSettings)9 NotNull (org.jetbrains.annotations.NotNull)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 PsiFile (com.intellij.psi.PsiFile)5 Nullable (org.jetbrains.annotations.Nullable)5 FormattingModel (com.intellij.formatting.FormattingModel)4 PsiElement (com.intellij.psi.PsiElement)4 CodeStyleSettingsManager (com.intellij.psi.codeStyle.CodeStyleSettingsManager)4 File (java.io.File)4 FormattingModelBuilder (com.intellij.formatting.FormattingModelBuilder)3 ASTNode (com.intellij.lang.ASTNode)3 Language (com.intellij.lang.Language)3 JSTestOptions (com.intellij.lang.javascript.JSTestOptions)3