接口 LineIndentProvider

所有已知实现类:
JavaLikeLangLineIndentProvider

public interface LineIndentProvider
An interface for fast indentation calculation as an alternative to formatter-based logic. Used in editor actions like Enter handling. Assumes that indent string is constructed using the editor document editor.getDocument() and the current offset without any document commits and PSI tree rebuilding which can be a time consuming operation. If there is no LineIndentProvider for the current editor and language context OR if a line indent provider can't calculate the indent (returns null), the document is committed and a formatter-based line indent calculation is performed.
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final String
    Marker object to indicate that no further formatter-based indent adjustment must be made.
  • 方法概要

    修饰符和类型
    方法
    说明
    @Nullable String
    getLineIndent(int offset)
    Calculates the indent that should be used for the line at specified offset in the specified document.
    boolean
    isSuitableFor(@Nullable Language language)
     
  • 字段详细资料

    • DO_NOT_ADJUST

      static final String DO_NOT_ADJUST
      Marker object to indicate that no further formatter-based indent adjustment must be made.
  • 方法详细资料

    • getLineIndent

      @Nullable @Nullable String getLineIndent(int offset)
      Calculates the indent that should be used for the line at specified offset in the specified document.
      参数:
      offset - The caret offset in the editor.
      返回:
      The indent string (possibly consisting of tabs and/or white spaces), null if LineIndentProvider can't calculate the indent (in this case indent calculation is delegated to formatter if smart indent mode is used) or DO_NOT_ADJUST constant to leave the current caret position as is without any further formatter-based adjustment.
    • isSuitableFor

      boolean isSuitableFor(@Nullable @Nullable Language language)