Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to the Docker Language Server will be documented in this file.

## [Unreleased]

### Fixed

- Compose
- textDocument/completion
- prevent wildcard object attribute suggestions if the text cursor is not at the right indentation for attributes to be inserted ([#342](https://github.com/docker/docker-language-server/issues/342))

## [0.13.0] - 2025-07-09

### Added
Expand Down
14 changes: 13 additions & 1 deletion internal/compose/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,18 @@ services:
test:
configs:
- mode: 0
`,
line: 5,
character: 6,
list: nil,
},
{
name: "indentation considered for regexp object properties",
content: `
services:
test:
networks:
abc:
`,
line: 5,
character: 6,
Expand Down Expand Up @@ -4319,7 +4331,7 @@ services:
},
},
{
name: "build completion items include autofilled stages when build is empty",
name: "build completion items include autofilled stages when build is empty when build object has other attributes",
dockerfileContent: "FROM busybox as bstage\nFROM alpine as astage",
content: `
services:
Expand Down
3 changes: 3 additions & 0 deletions internal/compose/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func nodeProperties(nodes []*ast.MappingValueNode, line, column int) ([]*ast.Map

func recurseNodeProperties(nodes []*ast.MappingValueNode, line, column, nodeOffset int, properties map[string]*jsonschema.Schema, arrayAttributes bool) ([]*ast.MappingValueNode, any, bool) {
if len(nodes) == nodeOffset {
if nodes[len(nodes)-1].Key.GetToken().Position.Column >= column {
return nodes, nil, false
}
return nodes, properties, arrayAttributes
}
if nodes[nodeOffset].Key.GetToken().Position.Column == column {
Expand Down
Loading