Export (0) Print
Expand All
Expand Minimize

LanguageService.GetLanguageID Method

Returns the language GUID of the language service.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

public virtual int GetLanguageID(
	IVsTextBuffer buffer,
	int line,
	int col,
	out Guid langId
)

Parameters

buffer
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer

[in] The IVsTextBuffer containing the source for which to get the language id.

line
Type: Int32

[in] The line index into the buffer to the source for which to get the language.

col
Type: Int32

[in] The character position in the line.

langId
Type: Guid

[out] Returns the GUID of the language for the associated source.

Return Value

Type: Int32
If successful, returns S_OK; otherwise, returns an error code.

Implements

IVsLanguageDebugInfo.GetLanguageID(IVsTextBuffer, Int32, Int32, Guid)

The supplied buffer object holds the entire source file. Some source files support mixed languages, for example JScript and VBScript embedded in an HTML page. This method is called to get the language ID for a particular debugger. If you support multiple languages in a source file, you must derive a class from the LanguageService class and override this method in your class.

The base method always calls LanguageService.GetLanguageServiceGuid which returns the GUID of the language service. This assumes the source file contains only a single language.

Show:
© 2015 Microsoft