C# Class Microsoft.R.Editor.TextViewExtensions

Afficher le fichier Open project: Microsoft/RTVS

Méthodes publiques

Méthode Description
GetIdentifierUnderCaret ( this textView, Span &span ) : string

Extracts identifier sequence at the caret location. Fetches parts of 'abc$def' rather than tne entire expression. If there is selection, returns complete selected item as is.

GetItemAtPosition ( ITextSnapshotLine line, int position, bool>.Func tokenTypeCheck, Span &span ) : string
GetItemBeforeCaret ( this textView, Span &span, bool>.Func tokenTypeCheck = null ) : string

Extracts identifier or a keyword before caret. Typically used when inserting expansions (aka code snippets) at the caret location.

GetVariableNameBeforeCaret ( this textView ) : string

Extracts complete variable name under the caret. In '`abc`$`def` returns the complete expression rather than its parts. Typically used to get data for completion of variable members as in when user typed 'abc$def$' Since method does not perform semantic analysis, it does not guaratee syntactically correct expression, it may return 'a$$b'.

MapDownToR ( this textView, SnapshotSpan span ) : NormalizedSnapshotSpanCollection
MapDownToR ( this textView, SnapshotPoint position ) : SnapshotPoint?

Private Methods

Méthode Description
IsVariableNameToken ( string lineText, RToken token ) : bool

Method Details

GetIdentifierUnderCaret() public static méthode

Extracts identifier sequence at the caret location. Fetches parts of 'abc$def' rather than tne entire expression. If there is selection, returns complete selected item as is.
public static GetIdentifierUnderCaret ( this textView, Span &span ) : string
textView this
span Span
Résultat string

GetItemAtPosition() public static méthode

public static GetItemAtPosition ( ITextSnapshotLine line, int position, bool>.Func tokenTypeCheck, Span &span ) : string
line ITextSnapshotLine
position int
tokenTypeCheck bool>.Func
span Span
Résultat string

GetItemBeforeCaret() public static méthode

Extracts identifier or a keyword before caret. Typically used when inserting expansions (aka code snippets) at the caret location.
public static GetItemBeforeCaret ( this textView, Span &span, bool>.Func tokenTypeCheck = null ) : string
textView this
span Span
tokenTypeCheck bool>.Func
Résultat string

GetVariableNameBeforeCaret() public static méthode

Extracts complete variable name under the caret. In '`abc`$`def` returns the complete expression rather than its parts. Typically used to get data for completion of variable members as in when user typed 'abc$def$' Since method does not perform semantic analysis, it does not guaratee syntactically correct expression, it may return 'a$$b'.
public static GetVariableNameBeforeCaret ( this textView ) : string
textView this
Résultat string

MapDownToR() public static méthode

public static MapDownToR ( this textView, SnapshotSpan span ) : NormalizedSnapshotSpanCollection
textView this
span SnapshotSpan
Résultat NormalizedSnapshotSpanCollection

MapDownToR() public static méthode

public static MapDownToR ( this textView, SnapshotPoint position ) : SnapshotPoint?
textView this
position SnapshotPoint
Résultat SnapshotPoint?