Definition implements plugins.LSPAdapter. line/column are 1-based.
(file string, line, column int)
| 122 | |
| 123 | // Definition implements plugins.LSPAdapter. line/column are 1-based. |
| 124 | func (a *lspToolAdapter) Definition(file string, line, column int) (string, error) { |
| 125 | sess, _, err := a.acquire(file) |
| 126 | if err != nil { |
| 127 | return "", err |
| 128 | } |
| 129 | locs, err := sess.Client.Definition(sess.URI, lspPos(line, column)) |
| 130 | if err != nil { |
| 131 | return "", err |
| 132 | } |
| 133 | if len(locs) == 0 { |
| 134 | return "No definition found at that position — check that line/column point at the symbol name (1-based).", nil |
| 135 | } |
| 136 | return formatLocations("definition", sess.Root, locs, len(locs)), nil |
| 137 | } |
| 138 | |
| 139 | // References implements plugins.LSPAdapter. line/column are 1-based. |
| 140 | func (a *lspToolAdapter) References(file string, line, column int, includeDeclaration bool, limit int) (string, error) { |
nothing calls this directly
no test coverage detected