diff --git a/langserver/cache/document.go b/langserver/cache/document.go index c6eb1e66..4223cd65 100644 --- a/langserver/cache/document.go +++ b/langserver/cache/document.go @@ -119,7 +119,9 @@ func (d *Document) SetContent(content string, version float64, new bool) error { d.content = content d.version = version - d.posData.SetLinesForContent([]byte(content)) + + // An additional newline is appended, to make sure the last line is indexed + d.posData.SetLinesForContent(append([]byte(content), '\n')) d.queries = []*CompiledQuery{} d.yamls = []*YamlDoc{}