Java Code Examples for com.intellij.psi.codeStyle.CommonCodeStyleSettings#initIndentOptions()

The following examples show how to use com.intellij.psi.codeStyle.CommonCodeStyleSettings#initIndentOptions() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CsvLanguageCodeStyleSettingsProvider.java    From intellij-csv-validator with Apache License 2.0 5 votes vote down vote up
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings commonSettings = new CommonCodeStyleSettings(getLanguage());
    commonSettings.initIndentOptions();
    commonSettings.getIndentOptions().TAB_SIZE = 1;
    commonSettings.getIndentOptions().INDENT_SIZE = 1;
    commonSettings.getIndentOptions().USE_TAB_CHARACTER = true;
    commonSettings.getIndentOptions().SMART_TABS = false;
    commonSettings.getIndentOptions().KEEP_INDENTS_ON_EMPTY_LINES = true;
    commonSettings.WRAP_ON_TYPING = CommonCodeStyleSettings.WrapOnTyping.NO_WRAP.intValue;
    commonSettings.WRAP_LONG_LINES = false;
    commonSettings.RIGHT_MARGIN = Integer.MAX_VALUE;
    return commonSettings;
}
 
Example 2
Source File: CypherLanguageCodeStyleSettingsProvider.java    From jetbrains-plugin-graph-database-support with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings settings = new CommonCodeStyleSettings(getLanguage());
    CommonCodeStyleSettings.IndentOptions indentOptions = settings.initIndentOptions();
    indentOptions.INDENT_SIZE = 2;
    indentOptions.CONTINUATION_INDENT_SIZE = 2;
    indentOptions.TAB_SIZE = 2;
    indentOptions.USE_TAB_CHARACTER = false;

    return settings;
}
 
Example 3
Source File: ProjectViewCodeStyleSettingsProvider.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
  CommonCodeStyleSettings defaultSettings =
      new CommonCodeStyleSettings(ProjectViewLanguage.INSTANCE);
  defaultSettings.LINE_COMMENT_AT_FIRST_COLUMN = false;
  defaultSettings.LINE_COMMENT_ADD_SPACE = true;
  CommonCodeStyleSettings.IndentOptions indentOptions = defaultSettings.initIndentOptions();
  indentOptions.TAB_SIZE = 2;
  indentOptions.INDENT_SIZE = 2;
  indentOptions.CONTINUATION_INDENT_SIZE = 2;
  return defaultSettings;
}
 
Example 4
Source File: BuildLanguageCodeStyleSettingsProvider.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
  CommonCodeStyleSettings defaultSettings =
      new CommonCodeStyleSettings(BuildFileLanguage.INSTANCE);
  CommonCodeStyleSettings.IndentOptions indentOptions = defaultSettings.initIndentOptions();
  indentOptions.TAB_SIZE = 4;
  indentOptions.INDENT_SIZE = 4;
  indentOptions.CONTINUATION_INDENT_SIZE = 4;
  // TODO(brendandouglas): use upstream API directly, once it's implemented
  // indentOptions.DECLARATION_PARAMETER_INDENT = 8;
  return defaultSettings;
}
 
Example 5
Source File: BuckLanguageCodeStyleSettingsProvider.java    From Buck-IntelliJ-Plugin with Apache License 2.0 5 votes vote down vote up
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
  CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(BuckLanguage.INSTANCE);
  CommonCodeStyleSettings.IndentOptions indentOptions = defaultSettings.initIndentOptions();

  indentOptions.INDENT_SIZE = 2;
  indentOptions.TAB_SIZE = 2;
  indentOptions.CONTINUATION_INDENT_SIZE = 2;

  defaultSettings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
  defaultSettings.KEEP_BLANK_LINES_IN_DECLARATIONS = 1;
  defaultSettings.KEEP_BLANK_LINES_IN_CODE = 1;
  defaultSettings.RIGHT_MARGIN = 100;
  return defaultSettings;
}
 
Example 6
Source File: HaskellLanguageCodeStyleSettingsProvider.java    From intellij-haskforce with Apache License 2.0 5 votes vote down vote up
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings commonCodeStyleSettings = new CommonCodeStyleSettings(HaskellLanguage.INSTANCE);
    CommonCodeStyleSettings.IndentOptions indentOptions = commonCodeStyleSettings.initIndentOptions();
    indentOptions.INDENT_SIZE = 4;
    indentOptions.TAB_SIZE = 8;
    return commonCodeStyleSettings;
}
 
Example 7
Source File: LatexLanguageCodeStyleSettingsProvider.java    From idea-latex with MIT License 5 votes vote down vote up
@Override
    public CommonCodeStyleSettings getDefaultCommonSettings() {
        CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(LatexLanguage.INSTANCE);
        defaultSettings.initIndentOptions();
//        defaultSettings.SPACE_WITHIN_BRACES = true;
//        defaultSettings.KEEP_SIMPLE_CLASSES_IN_ONE_LINE = true;
//        defaultSettings.KEEP_SIMPLE_METHODS_IN_ONE_LINE = true;
        return defaultSettings;
    }
 
Example 8
Source File: CSharpLanguageCodeStyleSettingsProvider.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Override
public CommonCodeStyleSettings getDefaultCommonSettings()
{
	CommonCodeStyleSettings settings = new CommonCodeStyleSettings(CSharpLanguage.INSTANCE);
	settings.initIndentOptions();
	return settings;
}
 
Example 9
Source File: XQueryLanguageCodeStyleSettingsProvider.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(getLanguage());
    CommonCodeStyleSettings.IndentOptions indentOptions = defaultSettings.initIndentOptions();
    indentOptions.INDENT_SIZE = 4;
    indentOptions.CONTINUATION_INDENT_SIZE = 8;
    indentOptions.TAB_SIZE = 4;

    return defaultSettings;
}
 
Example 10
Source File: BuckLanguageCodeStyleSettingsProvider.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public CommonCodeStyleSettings getDefaultCommonSettings() {
  CommonCodeStyleSettings defaultSettings = new CommonCodeStyleSettings(BuckLanguage.INSTANCE);
  CommonCodeStyleSettings.IndentOptions indentOptions = defaultSettings.initIndentOptions();

  indentOptions.INDENT_SIZE = 4;
  indentOptions.TAB_SIZE = 4;
  indentOptions.CONTINUATION_INDENT_SIZE = 4;

  defaultSettings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
  defaultSettings.KEEP_BLANK_LINES_IN_DECLARATIONS = 1;
  defaultSettings.KEEP_BLANK_LINES_IN_CODE = 1;
  defaultSettings.RIGHT_MARGIN = 100;
  return defaultSettings;
}
 
Example 11
Source File: FluidLanguageCodeStyleSettingsProvider.java    From idea-php-typo3-plugin with MIT License 4 votes vote down vote up
public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings styleSettings = new CommonCodeStyleSettings(this.getLanguage());
    styleSettings.initIndentOptions();

    return styleSettings;
}