ParseRequest ParseRequest ParseRequest Class

Definition

Important

This API is not CLS-compliant.

Provides information to execute a parsing operation in a language service.

[System.CLSCompliant(false)]
public class ParseRequest
type ParseRequest = class
Public Class ParseRequest
Inheritance
ParseRequestParseRequestParseRequest
Attributes

Examples

This example shows how to create a new ParseRequest object with a custom AuthoringSink object (the class for which is not shown).

using Microsoft.VisualStudio.Package;  
using Microsoft.VisualStudio.TextManager.Interop;  

namespace MyLanguagePackage  
{  
    class MyLanguageService : LanguageService  
    {  
        public ParseRequest CreateParseRequest(Source s,   
                                               int line,   
                                               int idx,   
                                               TokenInfo info,   
                                               string sourceText,   
                                               string fname,   
                                               ParseReason reason,   
                                               IVsTextView view)  
        {  
             ParseRequest req = new ParseRequest(line,  
                                                 idx,  
                                                 info,  
                                                 sourceText,  
                                                 fname,  
                                                 reason,  
                                                 view);  
             if (req != null)  
             {  
                  req.Sink = new MyAuthoringSink(reason, line, idx);  
             }  
             return req;  
         }  
    }  
}  

Remarks

This class is used to communicate information to a parser about a particular parsing operation and to return information about the parsing operation. The source used by the parser is accessed as a single block of text through the Text property. This text is passed to the ParseRequest constructor.

Notes to Inheritors

Everything a typical parsing operation needs can be found in this class so there should be no reason to derive from this class. However, if you do need to derive a class from the ParseRequest class, you must derive a class from the LanguageService class and override the CreateParseRequest(Source, Int32, Int32, TokenInfo, String, String, ParseReason, IVsTextView) method to instantiate your own version of the ParseRequest class.

Note that if your language service is going to support parsing variables for display in the Autos debugging window and/or support validation of breakpoints, you must derive a class from the AuthoringSink class and set the Sink property in an instance of the ParseRequest class to your version of the AuthoringSink class. This can be done in the CreateParseRequest(Source, Int32, Int32, TokenInfo, String, String, ParseReason, IVsTextView) method after the ParseRequest object is created.

Notes to Callers

This class is instantiated by a call to the CreateParseRequest(Source, Int32, Int32, TokenInfo, String, String, ParseReason, IVsTextView) method in the LanguageService class.

Do not attempt to use the View property in a background thread: the IVsTextView object is meant only for foreground use by the base Source class.

Constructors

ParseRequest(Boolean) ParseRequest(Boolean) ParseRequest(Boolean)

Initializes a new instance of the ParseRequest class in order to terminate the thread used for background parsing operations.

ParseRequest(Int32, Int32, TokenInfo, String, String, ParseReason, IVsTextView, AuthoringSink, Boolean) ParseRequest(Int32, Int32, TokenInfo, String, String, ParseReason, IVsTextView, AuthoringSink, Boolean) ParseRequest(Int32, Int32, TokenInfo, String, String, ParseReason, IVsTextView, AuthoringSink, Boolean)

Initializes a new instance of the ParseRequest class.

Properties

Callback Callback Callback

Specifies the callback delegate to be called when the parsing operation has completed.

Col Col Col

Specifies the character offset on the first line to begin the parsing operation.

DirtySpan DirtySpan DirtySpan

Specifies a span of source that has changed.

FileName FileName FileName

Specifies the name of the source file being parsed.

IsSynchronous IsSynchronous IsSynchronous

Gets or sets whether or not the request is synchronous.

Line Line Line

Specifies the line on which to start the parsing operation.

Reason Reason Reason

Specifies the reason the parsing operation was started.

Scope Scope Scope

Specifies the AuthoringScope object that is used to return extended information from the parsing operation.

Sink Sink Sink

Specifies an AuthoringSink object used to contain information from the parsing operation.

Terminate Terminate Terminate

Specifies whether the worker thread handling background parsing operations should exit.

Text Text Text

Specifies the source text to be parsed.

Timestamp Timestamp Timestamp

Specifies a time stamp for the parse request.

TokenInfo TokenInfo TokenInfo

Specifies a TokenInfo structure that is filled in with the results of the parsing operation.

View View View

Specifies the IVsTextView object representing the view that contains the source that is being parsed.

Extension Methods

FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)
FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)

Microsoft internal use only.

FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)
FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)
IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>)

Microsoft internal use only.

Applies to