com.intellij.psi.codeStyle.CommonCodeStyleSettings# initIndentOptions ( ) 源码实例Demo

下面列出了com.intellij.psi.codeStyle.CommonCodeStyleSettings# initIndentOptions ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。


@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;
}
 

@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;
}
 

@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;
}
 

@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;
}
 

@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;
}
 

@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;
}
 

@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;
    }
 

@Override
public CommonCodeStyleSettings getDefaultCommonSettings()
{
	CommonCodeStyleSettings settings = new CommonCodeStyleSettings(CSharpLanguage.INSTANCE);
	settings.initIndentOptions();
	return settings;
}
 

@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;
}
 

@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;
}
 

public CommonCodeStyleSettings getDefaultCommonSettings() {
    CommonCodeStyleSettings styleSettings = new CommonCodeStyleSettings(this.getLanguage());
    styleSettings.initIndentOptions();

    return styleSettings;
}