LanguageService.CreateParseRequest Method (Source, Int32, Int32, TokenInfo, String, String, ParseReason, IVsTextView)

 

Creates a request to satisfy the given reason for parsing that is then passed on to the parser.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public virtual ParseRequest CreateParseRequest(
	Source s,
	int line,
	int idx,
	TokenInfo info,
	string sourceText,
	string fname,
	ParseReason reason,
	IVsTextView view
)

Parameters

s
Type: Microsoft.VisualStudio.Package.Source

[in] The Source object containing the source file.

line
Type: System.Int32

[in] The line number to start parsing on.

idx
Type: System.Int32

[in] The character index in the line where parsing starts.

info
Type: Microsoft.VisualStudio.Package.TokenInfo

[in] A TokenInfo structure that is to be filled in by the parsing operation for each token.

sourceText
Type: System.String

[in] The text to be parsed. This contains the entire source file's text.

fname
Type: System.String

[in] The file name of the source file. Can be null or empty.

reason
Type: Microsoft.VisualStudio.Package.ParseReason

[in] The ParseReason describing why the parse operation is being invoked.

view
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextView

[in] The IVsTextView object containing the text buffer from which the source was obtained.

Return Value

Type: Microsoft.VisualStudio.Package.ParseRequest

If successful, returns a ParseRequest object; otherwise, returns a null value.

This method is called whenever a parse operation must be performed on the source file to support the various features of the language service -- other than for support of colorization which is handled entirely in the Colorizer class and the IScanner parser. The parsing process must be able to parse a single token, a single line, a group of lines, or the entire text, all based on the ParseReason value supplied by the ParseRequest object.

The IVsTextView object passed to this method is for internal use only and should not be accessed by the ParseSource method parser. That parser should access the source only through the text that is passed in through the ParseRequest object created by this method.

The base method always returns a new ParseRequest object. Override this if your parser requires changes to the arguments or you need some specialized information to be passed on to your parser. Note that the ParseRequest class has no methods that can be overridden so your class would supply only additional methods.

Return to top
Show: