Partilhar via


Source.BeginParse Method

Definition

Overloads

BeginParse()

Begins a full parsing operation either in the foreground or the background.

BeginParse(Int32, Int32, TokenInfo, ParseReason, IVsTextView, ParseResultHandler)

BeginParse is called when this Source object needs to be parsed. The default implementation uses the LanguageService background parse thread to do the work.

BeginParse()

Begins a full parsing operation either in the foreground or the background.

public:
 virtual void BeginParse();
public:
 virtual void BeginParse();
 virtual void BeginParse();
public virtual void BeginParse ();
abstract member BeginParse : unit -> unit
override this.BeginParse : unit -> unit
Public Overridable Sub BeginParse ()

Remarks

This method is typically called from the OnIdle method, and calls the ParseSource method. The base method starts the parse with the ParseReason value of Check.

Note that the OnIdle method will not begin parsing after the source file is first loaded unless the LastParseTime property has been set to 0. To do so, override CreateSource and make sure that the resulting Source object has its LastParseTime property set to 0.

A complete parse operation is performed over the entire file. It collects information about the file including methods, members, variables, and braces. Because this parsing can take quite a bit of time, the parsing is typically done on a background thread.

Applies to

BeginParse(Int32, Int32, TokenInfo, ParseReason, IVsTextView, ParseResultHandler)

BeginParse is called when this Source object needs to be parsed. The default implementation uses the LanguageService background parse thread to do the work.

public:
 virtual Microsoft::VisualStudio::Package::ParseRequest ^ BeginParse(int line, int idx, Microsoft::VisualStudio::Package::TokenInfo ^ info, Microsoft::VisualStudio::Package::ParseReason reason, Microsoft::VisualStudio::TextManager::Interop::IVsTextView ^ view, Microsoft::VisualStudio::Package::ParseResultHandler ^ callback);
public virtual Microsoft.VisualStudio.Package.ParseRequest BeginParse (int line, int idx, Microsoft.VisualStudio.Package.TokenInfo info, Microsoft.VisualStudio.Package.ParseReason reason, Microsoft.VisualStudio.TextManager.Interop.IVsTextView view, Microsoft.VisualStudio.Package.ParseResultHandler callback);
abstract member BeginParse : int * int * Microsoft.VisualStudio.Package.TokenInfo * Microsoft.VisualStudio.Package.ParseReason * Microsoft.VisualStudio.TextManager.Interop.IVsTextView * Microsoft.VisualStudio.Package.ParseResultHandler -> Microsoft.VisualStudio.Package.ParseRequest
override this.BeginParse : int * int * Microsoft.VisualStudio.Package.TokenInfo * Microsoft.VisualStudio.Package.ParseReason * Microsoft.VisualStudio.TextManager.Interop.IVsTextView * Microsoft.VisualStudio.Package.ParseResultHandler -> Microsoft.VisualStudio.Package.ParseRequest
Public Overridable Function BeginParse (line As Integer, idx As Integer, info As TokenInfo, reason As ParseReason, view As IVsTextView, callback As ParseResultHandler) As ParseRequest

Parameters

line
Int32

The line position where intellisense is being requested (if any)

idx
Int32

The column position where intellisense is being requested

info
TokenInfo

The token at the line/col position or an empty token

reason
ParseReason

The reason for this parse request

view
IVsTextView

The IVsTextView or null if the view is not known.

callback
ParseResultHandler

A callback delegate to call when the parse is completed. If a callback delegate is provided then the ParseRequest will be processed asynchronously on a background thread and this method will return immediately, then the callback will be called on the UI thread when the parse is completed. The completed ParseRequest will then contain an AuthoringScope object which can be used to complete intellisense requests.

Returns

Remarks

This method is called by the BeginParse method at the beginning of the parse with Check. At other times it can be called with the appropriate ParseReason.

Applies to