MCPcopy Create free account
hub / github.com/WhiskeyJack96/logseqlsp / FindLinkForPosition

Method FindLinkForPosition

document/document.go:87–94  ·  view source on GitHub ↗
(pos protocol.Position)

Source from the content-addressed store, hash-verified

85}
86
87func (d Document) FindLinkForPosition(pos protocol.Position) (Link, error) {
88 for _, link := range d.Links {
89 if positionInRange(d.Contents, link.Range, pos) {
90 return link, nil
91 }
92 }
93 return Link{}, ErrLinkNotFound
94}
95
96func newLink(href string, t linkType, line, start, end int) Link {
97 if href == "" {

Callers 3

definitionMethod · 0.80
hoverMethod · 0.80
highlightMethod · 0.80

Calls 1

positionInRangeFunction · 0.70

Tested by

no test coverage detected