C# Class Microsoft.R.Editor.Validation.TreeValidator

Main R validator: performs syntax check, produces results that then sent to the task list and tagger that creates squiggles. Works asynchronously except the final part that pushes actual task items to the IDE. Additional validators can be added via MEF exports. Validator listens to tree updated events and schedules validation passes for next idle slot. Next idle validation thread starts and performas its work. Validator also listens to changes in settings which may turn validation on or off.
Show file Open project: Microsoft/RTVS Class Usage Examples

Private Properties

Property Type Description
AdviseToIdle void
ClearResultsForNode void
OnIdle void
OnNodesRemoved void
OnSettingsChanged void
OnTreeClose void
OnTreeUpdateCompleted void
QueueTreeForValidation void
StartValidation void
StartValidationNextIdle void
StopValidation void
UnadviseFromIdle void

Public Methods

Method Description
EnsureFromTextBuffer ( ITextBuffer textBuffer, IEditorTree editorTree, ICoreShell shell ) : TreeValidator

Retrieves (or creates) the validator (syntax checker) for the document that is associated with the text buffer

IsSyntaxCheckEnabled ( ITextBuffer textBuffer ) : bool
TreeValidator ( IEditorTree editorTree, ICoreShell shell ) : System

Private Methods

Method Description
AdviseToIdle ( ) : void
ClearResultsForNode ( IAstNode node ) : void
OnIdle ( object sender, EventArgs e ) : void
OnNodesRemoved ( object sender, TreeNodesRemovedEventArgs e ) : void

Listens to 'nodes removed' event which fires when user deletes text that generated AST nodes or pastes over new content. This allows validator to remove related errors from the task list quickly so they don't linger until the next validation pass.

OnSettingsChanged ( object sender, EventArgs e ) : void
OnTreeClose ( object sender, EventArgs e ) : void
OnTreeUpdateCompleted ( object sender, TreeUpdatedEventArgs e ) : void
QueueTreeForValidation ( ) : void
StartValidation ( ) : void
StartValidationNextIdle ( ) : void
StopValidation ( ) : void
UnadviseFromIdle ( ) : void

Method Details

EnsureFromTextBuffer() public static method

Retrieves (or creates) the validator (syntax checker) for the document that is associated with the text buffer
public static EnsureFromTextBuffer ( ITextBuffer textBuffer, IEditorTree editorTree, ICoreShell shell ) : TreeValidator
textBuffer ITextBuffer Text buffer
editorTree IEditorTree
shell ICoreShell
return TreeValidator

IsSyntaxCheckEnabled() public static method

public static IsSyntaxCheckEnabled ( ITextBuffer textBuffer ) : bool
textBuffer ITextBuffer
return bool

TreeValidator() public method

public TreeValidator ( IEditorTree editorTree, ICoreShell shell ) : System
editorTree IEditorTree
shell ICoreShell
return System