C# Class Microsoft.R.Editor.SmartIndent.SmartIndenter

Provides block and smart indentation in R code
Inheritance: ISmartIndent
Afficher le fichier Open project: Microsoft/RTVS Class Usage Examples

Méthodes publiques

Méthode Description
Attach ( ITextView textView ) : SmartIndenter
Dispose ( ) : void
GetBlockIndent ( ITextSnapshotLine line ) : int
GetDesiredIndentation ( ITextSnapshotLine line ) : int?
GetDesiredIndentation ( ITextSnapshotLine line, IndentStyle indentStyle ) : int?
GetSmartIndent ( ITextSnapshotLine line, AstRoot ast = null, int originalIndentSizeInSpaces = -1, bool formatting = false ) : int

Determines level of indentation in the line from AST and surrounding context. Called when user hits ENTER and editor needs to know level of indentation in the new line as well as when code is being auto-formatted and range formatter needs to know how to indent freshly formatted lines of code.

InnerIndentSizeFromLine ( ITextSnapshotLine line, Microsoft.R.Core.Formatting.RFormatOptions options ) : int
InnerIndentSizeFromNode ( ITextBuffer textBuffer, IAstNode node, Microsoft.R.Core.Formatting.RFormatOptions options ) : int
OuterIndentSizeFromLine ( ITextSnapshotLine line, Microsoft.R.Core.Formatting.RFormatOptions options ) : int
OuterIndentSizeFromNode ( ITextBuffer textBuffer, IAstNode node, Microsoft.R.Core.Formatting.RFormatOptions options ) : int

Private Methods

Méthode Description
GetFirstArgumentIndent ( ITextSnapshot snapshot, IFunction fc ) : int
SmartIndenter ( ITextView textView ) : System

Method Details

Attach() public static méthode

public static Attach ( ITextView textView ) : SmartIndenter
textView ITextView
Résultat SmartIndenter

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GetBlockIndent() public static méthode

public static GetBlockIndent ( ITextSnapshotLine line ) : int
line ITextSnapshotLine
Résultat int

GetDesiredIndentation() public méthode

public GetDesiredIndentation ( ITextSnapshotLine line ) : int?
line ITextSnapshotLine
Résultat int?

GetDesiredIndentation() public méthode

public GetDesiredIndentation ( ITextSnapshotLine line, IndentStyle indentStyle ) : int?
line ITextSnapshotLine
indentStyle IndentStyle
Résultat int?

GetSmartIndent() public static méthode

Determines level of indentation in the line from AST and surrounding context. Called when user hits ENTER and editor needs to know level of indentation in the new line as well as when code is being auto-formatted and range formatter needs to know how to indent freshly formatted lines of code.
public static GetSmartIndent ( ITextSnapshotLine line, AstRoot ast = null, int originalIndentSizeInSpaces = -1, bool formatting = false ) : int
line ITextSnapshotLine Line to find the indent for
ast Microsoft.R.Core.AST.AstRoot Optional AST
originalIndentSizeInSpaces int
formatting bool /// Indicates if current call is from formatter or /// from the core editor for indentation when user typed Enter. ///
Résultat int

InnerIndentSizeFromLine() public static méthode

public static InnerIndentSizeFromLine ( ITextSnapshotLine line, Microsoft.R.Core.Formatting.RFormatOptions options ) : int
line ITextSnapshotLine
options Microsoft.R.Core.Formatting.RFormatOptions
Résultat int

InnerIndentSizeFromNode() public static méthode

public static InnerIndentSizeFromNode ( ITextBuffer textBuffer, IAstNode node, Microsoft.R.Core.Formatting.RFormatOptions options ) : int
textBuffer ITextBuffer
node IAstNode
options Microsoft.R.Core.Formatting.RFormatOptions
Résultat int

OuterIndentSizeFromLine() public static méthode

public static OuterIndentSizeFromLine ( ITextSnapshotLine line, Microsoft.R.Core.Formatting.RFormatOptions options ) : int
line ITextSnapshotLine
options Microsoft.R.Core.Formatting.RFormatOptions
Résultat int

OuterIndentSizeFromNode() public static méthode

public static OuterIndentSizeFromNode ( ITextBuffer textBuffer, IAstNode node, Microsoft.R.Core.Formatting.RFormatOptions options ) : int
textBuffer ITextBuffer
node IAstNode
options Microsoft.R.Core.Formatting.RFormatOptions
Résultat int