Freigeben über


IVsLanguageBlock Interface

Definition

Determines the span of the current language block.

public interface class IVsLanguageBlock
public interface class IVsLanguageBlock
__interface IVsLanguageBlock
[System.Runtime.InteropServices.Guid("BA303DF5-6283-4961-A4CE-76D4F0662D11")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsLanguageBlock
[System.Runtime.InteropServices.Guid("BA303DF5-6283-4961-A4CE-76D4F0662D11")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsLanguageBlock
[<System.Runtime.InteropServices.Guid("BA303DF5-6283-4961-A4CE-76D4F0662D11")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsLanguageBlock = interface
[<System.Runtime.InteropServices.Guid("BA303DF5-6283-4961-A4CE-76D4F0662D11")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsLanguageBlock = interface
Public Interface IVsLanguageBlock
Attributes

Remarks

Implement this interface to provide custom information about a language block for your language. The definition of a language block is particular to each programming language. For example, a language block in Visual Basic extends from the Sub command to the End Sub command as shown in the following example:

Private Sub SubroutineName()

End Sub

Language block information is typically used with the Find command to confine a search to a single function or method. This interface is also used to select an entire method when the user double-clicks in the selection margin.

Notes to Implementers

Implement this interface on the language service object to provide information about a language block within the core text editor.

Notes to Callers

Obtain this interface by asking the language service for it through the QueryService method. For example:

    public IVsLanguageBlock GetTextOps(Microsoft.VisualStudio.OLE.Interop.IServiceProvider provider,  
Guid languageServiceGuid)  
    {  
        IVsLanguageBlock languageBlock = null;  
        languageBlock = provider.QueryService(languageServiceGuid,  
                                              typeof(IVsLanguageBlock).GUID)  
                                as IVsLanguageBlock;  
        return languageBlock;  
    }  

Methods

GetCurrentBlock(IVsTextLines, Int32, Int32, TextSpan[], String, Int32)

Determines the current span of the language block.

Applies to