MCPcopy Create free account
hub / github.com/docker/docker-language-server / PrepareRename

Function PrepareRename

internal/compose/prepareRename.go:8–20  ·  view source on GitHub ↗
(doc document.ComposeDocument, params *protocol.PrepareRenameParams)

Source from the content-addressed store, hash-verified

6)
7
8func PrepareRename(doc document.ComposeDocument, params *protocol.PrepareRenameParams) (*protocol.Range, error) {
9 highlights, err := DocumentHighlight(doc, params.Position)
10 if err != nil || len(highlights) == 0 {
11 return nil, err
12 }
13
14 for _, highlight := range highlights {
15 if insideRange(highlight.Range, params.Position.Line, params.Position.Character) {
16 return &highlight.Range, nil
17 }
18 }
19 return nil, nil
20}

Calls 2

insideRangeFunction · 0.85
DocumentHighlightFunction · 0.70

Tested by 6