use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JavaReferenceAdjuster method process.
@Override
public ASTNode process(@NotNull ASTNode element, boolean addImports, boolean incompleteCode, Project project) {
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
return process(element, addImports, incompleteCode, javaSettings.useFqNamesInJavadocAlways(), settings.USE_FQ_CLASS_NAMES);
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JavaReferenceAdjuster method processRange.
@Override
public void processRange(@NotNull ASTNode element, int startOffset, int endOffset, Project project) {
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
processRange(element, startOffset, endOffset, javaSettings.useFqNamesInJavadocAlways(), settings.USE_FQ_CLASS_NAMES);
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class BlockJoinLinesHandler method getForceBraceSetting.
private static int getForceBraceSetting(PsiElement statement) {
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(statement.getProject());
final CommonCodeStyleSettings codeStyleSettings = settings.getCommonSettings(JavaLanguage.INSTANCE);
if (statement instanceof PsiIfStatement) {
return codeStyleSettings.IF_BRACE_FORCE;
}
if (statement instanceof PsiWhileStatement) {
return codeStyleSettings.WHILE_BRACE_FORCE;
}
if (statement instanceof PsiForStatement) {
return codeStyleSettings.FOR_BRACE_FORCE;
}
if (statement instanceof PsiDoWhileStatement) {
return codeStyleSettings.DOWHILE_BRACE_FORCE;
}
return CommonCodeStyleSettings.DO_NOT_FORCE;
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class SmartTypeCompletionTest method testInsertOverride.
public void testInsertOverride() throws Exception {
CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject());
styleSettings.INSERT_OVERRIDE_ANNOTATION = true;
doItemTest();
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class PostprocessReformattingAspect method getFormatterFacade.
@NotNull
private CodeFormatterFacade getFormatterFacade(@NotNull FileViewProvider viewProvider) {
final CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(myPsiManager.getProject());
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myPsiManager.getProject());
final Document document = viewProvider.getDocument();
assert document != null;
final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(styleSettings, viewProvider.getBaseLanguage());
documentManager.commitDocument(document);
return codeFormatter;
}
Aggregations