C# 클래스 Microsoft.R.Core.Formatting.RFormatter

Formats R code based on tokenization
파일 보기 프로젝트 열기: Microsoft/RTVS 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AppendComma void
AppendCondition void
AppendControlBlock void
AppendKeyword void
AppendNextToken void
AppendOperator void
AppendScopeContent void
AppendStatementsInScope void
AppendTextBeforeToken void
AppendToken void
CloseFormattingScope void
GetSingleLineScopeEnd int
HasSameLineElse bool
IsClosingToken bool
IsConditionalBlock bool
IsControlBlock bool
IsKeywordWithoutSpaces bool
IsOpenBraceToken bool
IsOperatorWithoutSpaces bool
KeepCurlyAndElseTogether bool
LeadingSpaceNeeded bool
OpenFormattingScope void
ShouldAppendTextBeforeToken bool
SoftLineBreak void
Tokenize void

공개 메소드들

메소드 설명
Format ( string text ) : string

Format string containing R code

RFormatter ( ) : System.Collections.Generic
RFormatter ( Microsoft.R.Core.Formatting.RFormatOptions options ) : System.Collections.Generic

비공개 메소드들

메소드 설명
AppendComma ( ) : void
AppendCondition ( ) : void

Formats conditional statement after 'if' or 'while'

AppendControlBlock ( string keyword ) : void
AppendKeyword ( ) : void

Appends keyword and its constructs such as condition that follows 'if' And the following scope controlling indentation as appropriate.

AppendNextToken ( ) : void
AppendOperator ( ) : void
AppendScopeContent ( bool stopAtLineBreak, bool stopAtElse = false ) : void

Iterates over tokens in the current scope and constructs formatted text

AppendStatementsInScope ( string keyword ) : void

Appends statements inside scope that follows control block such as if() { } or a single statement that follows scope-less as in 'if() stmt' conditional.

AppendTextBeforeToken ( bool preserveUserIndent = false ) : void
AppendToken ( bool leadingSpace, bool trailingSpace ) : void
CloseFormattingScope ( ) : void
GetSingleLineScopeEnd ( ) : int

Calculates position of a end of a single-line scope. The simple scope ends at a line break or at opening or closing curly brace.

HasSameLineElse ( ) : bool
IsClosingToken ( RToken token, AstRoot ast = null ) : bool
IsConditionalBlock ( string text ) : bool
IsControlBlock ( string text ) : bool
IsKeywordWithoutSpaces ( string text ) : bool
IsOpenBraceToken ( RTokenType tokenType ) : bool
IsOperatorWithoutSpaces ( string text ) : bool
KeepCurlyAndElseTogether ( ) : bool
LeadingSpaceNeeded ( ) : bool
OpenFormattingScope ( ) : void

Opens new formatting scope. Scope is opened when either code discovers open curly brace or when line break suppression is on.

ShouldAppendTextBeforeToken ( ) : bool
SoftLineBreak ( ) : void
Tokenize ( string text ) : void

Tokenizes provided string that contains R code

메소드 상세

Format() 공개 메소드

Format string containing R code
public Format ( string text ) : string
text string
리턴 string

RFormatter() 공개 메소드

public RFormatter ( ) : System.Collections.Generic
리턴 System.Collections.Generic

RFormatter() 공개 메소드

public RFormatter ( Microsoft.R.Core.Formatting.RFormatOptions options ) : System.Collections.Generic
options Microsoft.R.Core.Formatting.RFormatOptions
리턴 System.Collections.Generic