- 所有已知实现类:
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 StringMarker object to indicate that no further formatter-based indent adjustment must be made. -
方法概要
修饰符和类型方法说明@Nullable StringgetLineIndent(int offset) Calculates the indent that should be used for the line at specified offset in the specified document.booleanisSuitableFor(@Nullable Language language)
-
字段详细资料
-
DO_NOT_ADJUST
Marker object to indicate that no further formatter-based indent adjustment must be made.
-
-
方法详细资料
-
getLineIndent
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),
nullif LineIndentProvider can't calculate the indent (in this case indent calculation is delegated to formatter if smart indent mode is used) orDO_NOT_ADJUSTconstant to leave the current caret position as is without any further formatter-based adjustment.
-
isSuitableFor
-