# SourceHoverProvider class
{: .no_toc }

Adds text to the box that the code editor shows when the mouse rests on twinBASIC code. Made by [**Integration.AddSourceHoverProvider**](/tB/Packages/tbIDE/Integration.md#addsourcehoverprovider).

```tb check_build
Private WithEvents LineInfo As SourceHoverProvider

Private Sub Host_OnProjectLoaded()
    Set LineInfo = Host.Integration.AddSourceHoverProvider("lineInfo")
End Sub

Private Sub LineInfo_Hover(ByVal Uri As String, ByVal LineNumber As Long, ByVal CharOffset As Long, _
        ByVal IsDebugging As Boolean, ByVal ResultResolver As AsyncResultResolver)
    If IsDebugging Then
        ResultResolver.Resolve ""
    Else
        ResultResolver.Resolve "**Line " & LineNumber & "**, column " & CharOffset
    End If
End Sub
```

* TOC
{:toc}

## Properties

### Enabled
{: .no_toc }

Whether the provider is asked. **Boolean**, read/write. **True** when it is added. While it is **False**, [**Hover**](#hover) does not fire, and the box shows what it would without the provider.

### Name
{: .no_toc }

The name given to [**AddSourceHoverProvider**](/tB/Packages/tbIDE/Integration.md#addsourcehoverprovider). **String**, read-only.

## Events

### Hover
{: .no_toc }

Fires when the mouse rests on code in a twinBASIC file, before the box shows. The box waits for the answer of every provider.

Syntax: *provider*_**Hover**( *Uri* **As String**, *LineNumber* **As Long**, *CharOffset* **As Long**, *IsDebugging* **As Boolean**, *ResultResolver* **As** [**AsyncResultResolver**](/tB/Packages/tbIDE/AsyncResultResolver.md) )

*Uri*
: The file's path in the project, with `twinbasic:` in front of it: `twinbasic:/MyProject/Sources/Module1.twin`.

*LineNumber*
: The line the mouse is on, counted from 1.

*CharOffset*
: The column the mouse is at, counted from 1.

*IsDebugging*
: **True** while the program is stopped in the debugger.

*ResultResolver*
: Takes the answer. Call its [**Resolve**](/tB/Packages/tbIDE/AsyncResultResolver.md#resolve) with the text to add, in markdown, or with an empty string to add nothing. The call may come later, from a timer or another thread, but every hover waits for it.

The answer is markdown: `**bold**`, `` `code` `` and links. A link to `command:` and a [**SourceCommand**](/tB/Packages/tbIDE/SourceCommand.md)'s [**CommandID**](/tB/Packages/tbIDE/SourceCommand.md#commandid) runs that command when clicked; see [**CommandID**](/tB/Packages/tbIDE/SourceCommand.md#commandid) for its arguments. An HTML tag in the answer is dropped, and the text inside it kept.

The box shows the IDE's own text first, then the providers' answers in the order of their priority, the lowest first. A provider gives its priority with [**SetPriority**](/tB/Packages/tbIDE/AsyncResultResolver.md#setpriority) before it calls **Resolve**; the priority is 0 when it does not.

## See Also

- [Integration.AddSourceHoverProvider](/tB/Packages/tbIDE/Integration.md#addsourcehoverprovider) method
- [AsyncResultResolver](/tB/Packages/tbIDE/AsyncResultResolver.md) class
- [SourceCommand](/tB/Packages/tbIDE/SourceCommand.md) class
