Partager via


LanguageService.CreateSource(IVsTextLines) Method

Definition

Instantiates a Source class.

public:
 virtual Microsoft::VisualStudio::Package::Source ^ CreateSource(Microsoft::VisualStudio::TextManager::Interop::IVsTextLines ^ buffer);
public virtual Microsoft.VisualStudio.Package.Source CreateSource (Microsoft.VisualStudio.TextManager.Interop.IVsTextLines buffer);
abstract member CreateSource : Microsoft.VisualStudio.TextManager.Interop.IVsTextLines -> Microsoft.VisualStudio.Package.Source
override this.CreateSource : Microsoft.VisualStudio.TextManager.Interop.IVsTextLines -> Microsoft.VisualStudio.Package.Source
Public Overridable Function CreateSource (buffer As IVsTextLines) As Source

Parameters

buffer
IVsTextLines

[in] The IVsTextLines buffer that the Source object represents.

Returns

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

Remarks

A Source object controls various features of the language service including colorization and code snippet expansion, as well as all parsing other than that used for colorization (which is done by the Colorizer object directly). If you need to support additional features such as commands associated with markers, or to override an existing method to provide additional handling, then you must derive a class from the Source class and return an instance of your class from this method.

The base method always returns a new Source object that has been initialized with a Colorizer object that in turn has been initialized with an IScanner object returned from GetScanner.

Note that the Source object returned by this method will not be parsed automatically (by OnIdle) after loading. To accomplish automatic parsing, override this method and set LastParseTime to 0.

Applies to