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

Function isInsideRange

internal/bake/hcl/completion.go:209–224  ·  view source on GitHub ↗
(rng hcl.Range, position protocol.Position)

Source from the content-addressed store, hash-verified

207}
208
209func isInsideRange(rng hcl.Range, position protocol.Position) bool {
210 positionLine := int(position.Line + 1)
211 positionCharacter := int(position.Character + 1)
212 if rng.Start.Line < positionLine {
213 if positionLine < rng.End.Line {
214 return true
215 }
216 return positionLine == rng.End.Line && positionCharacter < rng.End.Column
217 } else if rng.Start.Line == positionLine {
218 if positionLine < rng.End.Line {
219 return rng.Start.Column <= positionCharacter
220 }
221 return rng.Start.Column <= positionCharacter && positionCharacter <= rng.End.Column
222 }
223 return false
224}
225
226func createTargetBlockCompletionItems(blocks hclsyntax.Blocks, quoted bool) *protocol.CompletionList {
227 list := &protocol.CompletionList{Items: []protocol.CompletionItem{}}

Callers 8

DocumentHighlightFunction · 0.85
hoveredVariableNameFunction · 0.85
DefinitionFunction · 0.85
ResolveAttributeValueFunction · 0.85
ResolveExpressionFunction · 0.85
CompletionFunction · 0.85
shouldSuggestFunction · 0.85
TestIsInsideRangeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsInsideRangeFunction · 0.68