congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CodeStyleSettings.getIndentSize
Code IndexAdd Tabnine to your IDE (free)

How to use
getIndentSize
method
in
com.intellij.psi.codeStyle.CodeStyleSettings

Best Java code snippets using com.intellij.psi.codeStyle.CodeStyleSettings.getIndentSize (Showing top 2 results out of 315)

origin: JetBrains/ideavim

CodeStyleSettings settings = proj == null ? CodeStyle.getDefaultSettings() : CodeStyle.getSettings(proj);
tabSize = settings.getTabSize(type);
indentSize = settings.getIndentSize(type);
useTabs = settings.useTabCharacter(type);
origin: JetBrains/Grammar-Kit

 private static LookupElement createKeywordLookupItem(String keyword) {
  LookupElementBuilder builder = LookupElementBuilder.create(keyword.toLowerCase()).withCaseSensitivity(false).bold();
  boolean braces = keyword.endsWith("{") || keyword.endsWith("}");
  if (!braces) {
   return keyword.startsWith("%") ? TailTypeDecorator.withTail(builder, TailType.SPACE) : builder;
  }
  else {
   final String closing = keyword.endsWith("{") ? keyword.substring(0, keyword.length()-1) + "}" : null;
   return PrioritizedLookupElement.withPriority(builder.withInsertHandler((context, item) -> {
    int caret = context.getTailOffset();
    Document document = context.getDocument();
    StringBuilder sb = new StringBuilder("\n");
    caret += sb.length();
    if (closing != null) {
     int indentSize = CodeStyleSettingsManager.getInstance(context.getProject()).
      getCurrentSettings().getIndentSize(JFlexFileType.INSTANCE);
     sb.append(StringUtil.repeat(" ", indentSize));
     caret += indentSize;
     sb.append("\n").append(closing).append("\n");
    }
    document.insertString(context.getTailOffset(), sb);
    context.getEditor().getCaretModel().moveToOffset(caret);
   }), 1.d / keyword.length());
  }
 }
}
com.intellij.psi.codeStyleCodeStyleSettingsgetIndentSize

Popular methods of CodeStyleSettings

  • getCommonSettings
  • getCustomSettings
  • getIndentOptions
  • clone
  • setRightMargin
  • <init>
  • getIndentOptionsByFile
  • getLineSeparator
  • getTabSize
  • setDefaultRightMargin
  • useTabCharacter
  • useTabCharacter

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Kernel (java.awt.image)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Permission (java.security)
    Legacy security code; do not use.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now