LanguageService.CreateParseRequest Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a request to satisfy the given reason for parsing that is then passed on to the parser.
public:
virtual Microsoft::VisualStudio::Package::ParseRequest ^ CreateParseRequest(Microsoft::VisualStudio::Package::Source ^ s, int line, int idx, Microsoft::VisualStudio::Package::TokenInfo ^ info, System::String ^ sourceText, System::String ^ fname, Microsoft::VisualStudio::Package::ParseReason reason, Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ view);
public virtual Microsoft.VisualStudio.Package.ParseRequest CreateParseRequest (Microsoft.VisualStudio.Package.Source s, int line, int idx, Microsoft.VisualStudio.Package.TokenInfo info, string sourceText, string fname, Microsoft.VisualStudio.Package.ParseReason reason, Microsoft.VisualStudio.TextManager.Interop.IVsTextView view);
abstract member CreateParseRequest : Microsoft.VisualStudio.Package.Source * int * int * Microsoft.VisualStudio.Package.TokenInfo * string * string * Microsoft.VisualStudio.Package.ParseReason * Microsoft.VisualStudio.TextManager.Interop.IVsTextView -> Microsoft.VisualStudio.Package.ParseRequest
override this.CreateParseRequest : Microsoft.VisualStudio.Package.Source * int * int * Microsoft.VisualStudio.Package.TokenInfo * string * string * Microsoft.VisualStudio.Package.ParseReason * Microsoft.VisualStudio.TextManager.Interop.IVsTextView -> Microsoft.VisualStudio.Package.ParseRequest
Public Overridable Function CreateParseRequest (s As Source, line As Integer, idx As Integer, info As TokenInfo, sourceText As String, fname As String, reason As ParseReason, view As IVsTextView) As ParseRequest
Parameters
- line
- Int32
[in] The line number to start parsing on.
- idx
- Int32
[in] The character index in the line where parsing starts.
- info
- TokenInfo
[in] A TokenInfo structure that is to be filled in by the parsing operation for each token.
- sourceText
- String
[in] The text to be parsed. This contains the entire source file's text.
- fname
- String
[in] The file name of the source file. Can be null or empty.
- reason
- ParseReason
[in] The ParseReason describing why the parse operation is being invoked.
- view
- IVsTextView
[in] The IVsTextView object containing the text buffer from which the source was obtained.
Returns
If successful, returns a ParseRequest object; otherwise, returns a null value.
Remarks
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.