C# Class Microsoft.R.Editor.Document.REditorDocument

Main editor document for the R language
Inheritance: IREditorDocument
Show file Open project: Microsoft/RTVS Class Usage Examples

Public Methods

Method Description
BeginMassiveChange ( ) : void

Tells document that massive change to text buffer is about to commence. Document will then stop tracking text buffer changes, will suspend R parser anc classifier and remove all projections. AST is no longer valid after this call.

Close ( ) : void

Closes the document

Dispose ( ) : void
EndMassiveChange ( ) : bool

Tells document that massive change to text buffer is complete. Document will perform full parse, resume tracking of text buffer changes and classification (colorization).

FindInProjectedBuffers ( ITextBuffer viewBuffer ) : IREditorDocument

Given text view locates R document in underlying text buffer graph. In REPL window there may be multiple R text buffers but usually only last one (the one active at the > prompt) has attached R document. Other R buffers represent previously typed commands. They still have colorizer attached but no active R documents.

FindRBuffer ( ITextBuffer viewBuffer ) : ITextBuffer

Locates first R buffer in the projection buffer graph. Note that in REPL this may not be the active buffer. In REPL used FindInProjectedBuffers.

FromTextBuffer ( ITextBuffer textBuffer ) : IREditorDocument

Retrieves document instance from text buffer

MapCaretPositionFromView ( ITextView textView ) : SnapshotPoint?

Maps caret position in text view to position in the projected R editor text buffer. R text buffer can be projected into view in REPL window case or in case when R is embedded in another language file such as in SQL file.

MapPointFromView ( ITextView textView, SnapshotPoint point ) : SnapshotPoint?

Maps given point from view buffer to R editor buffer

REditorDocument ( ITextBuffer textBuffer, ICoreShell shell ) : System
TryFromTextBuffer ( ITextBuffer textBuffer ) : IREditorDocument

Retrieves document instance from text buffer

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
OnTextDocumentDisposed ( object sender, TextDocumentEventArgs e ) : void

Method Details

BeginMassiveChange() public method

Tells document that massive change to text buffer is about to commence. Document will then stop tracking text buffer changes, will suspend R parser anc classifier and remove all projections. AST is no longer valid after this call.
public BeginMassiveChange ( ) : void
return void

Close() public method

Closes the document
public Close ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

EndMassiveChange() public method

Tells document that massive change to text buffer is complete. Document will perform full parse, resume tracking of text buffer changes and classification (colorization).
public EndMassiveChange ( ) : bool
return bool

FindInProjectedBuffers() public static method

Given text view locates R document in underlying text buffer graph. In REPL window there may be multiple R text buffers but usually only last one (the one active at the > prompt) has attached R document. Other R buffers represent previously typed commands. They still have colorizer attached but no active R documents.
public static FindInProjectedBuffers ( ITextBuffer viewBuffer ) : IREditorDocument
viewBuffer ITextBuffer
return IREditorDocument

FindRBuffer() public static method

Locates first R buffer in the projection buffer graph. Note that in REPL this may not be the active buffer. In REPL used FindInProjectedBuffers.
public static FindRBuffer ( ITextBuffer viewBuffer ) : ITextBuffer
viewBuffer ITextBuffer
return ITextBuffer

FromTextBuffer() public static method

Retrieves document instance from text buffer
public static FromTextBuffer ( ITextBuffer textBuffer ) : IREditorDocument
textBuffer ITextBuffer
return IREditorDocument

MapCaretPositionFromView() public static method

Maps caret position in text view to position in the projected R editor text buffer. R text buffer can be projected into view in REPL window case or in case when R is embedded in another language file such as in SQL file.
public static MapCaretPositionFromView ( ITextView textView ) : SnapshotPoint?
textView ITextView
return SnapshotPoint?

MapPointFromView() public static method

Maps given point from view buffer to R editor buffer
public static MapPointFromView ( ITextView textView, SnapshotPoint point ) : SnapshotPoint?
textView ITextView
point SnapshotPoint
return SnapshotPoint?

REditorDocument() public method

public REditorDocument ( ITextBuffer textBuffer, ICoreShell shell ) : System
textBuffer ITextBuffer
shell ICoreShell
return System

TryFromTextBuffer() public static method

Retrieves document instance from text buffer
public static TryFromTextBuffer ( ITextBuffer textBuffer ) : IREditorDocument
textBuffer ITextBuffer
return IREditorDocument