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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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

## [Unreleased]

### Fixed

- Compose
- textDocument/documentHighlight
- prevent file and folder bind mounts from returning results as they are not valid volume object references ([#450](https://github.com/docker/docker-language-server/issues/450))
- textDocument/prepareRename
- prevent file and folder bind mounts from returning results as they are not valid volume object references ([#450](https://github.com/docker/docker-language-server/issues/450))
- textDocument/rename
- prevent file and folder bind mounts from returning results as they are not valid volume object references ([#450](https://github.com/docker/docker-language-server/issues/450))

## [0.17.0] - 2025-08-21

### Added
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.25.0
require (
github.com/bep/debounce v1.2.1
github.com/bugsnag/bugsnag-go v2.5.1+incompatible
github.com/compose-spec/compose-go/v2 v2.8.1
github.com/docker/buildx v0.26.1
github.com/dromara/carbon/v2 v2.6.11
github.com/go-git/go-git/v5 v5.14.0
Expand Down Expand Up @@ -47,7 +48,6 @@ require (
github.com/bugsnag/panicwrap v1.3.4 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cloudflare/circl v1.6.0 // indirect
github.com/compose-spec/compose-go/v2 v2.7.2-0.20250703132301-891fce532a51 // indirect
github.com/containerd/console v1.0.5 // indirect
github.com/containerd/containerd/api v1.9.0 // indirect
github.com/containerd/containerd/v2 v2.1.3 // indirect
Expand Down Expand Up @@ -149,6 +149,7 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.39.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7q
github.com/cloudflare/circl v1.6.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/compose-spec/compose-go/v2 v2.7.2-0.20250703132301-891fce532a51 h1:AjI75N9METifYMZK7eNt8XIgY9Sryv+1w3XDA7X2vZQ=
github.com/compose-spec/compose-go/v2 v2.7.2-0.20250703132301-891fce532a51/go.mod h1:Zow/3eYNOnl2T4qLGZEizf8d/ht1qfy09G7WGOSzGOY=
github.com/compose-spec/compose-go/v2 v2.8.1 h1:27O4dzyhiS/UEUKp1zHOHCBWD1WbxGsYGMNNaSejTk4=
github.com/compose-spec/compose-go/v2 v2.8.1/go.mod h1:veko/VB7URrg/tKz3vmIAQDaz+CGiXH8vZsW79NmAww=
github.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo=
github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins=
github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/qqsc=
Expand Down Expand Up @@ -392,6 +392,8 @@ go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down
8 changes: 7 additions & 1 deletion internal/compose/documentHighlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package compose
import (
"strings"

"github.com/compose-spec/compose-go/v2/format"
"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/docker-language-server/internal/pkg/document"
"github.com/docker/docker-language-server/internal/tliron/glsp/protocol"
"github.com/goccy/go-yaml/ast"
Expand Down Expand Up @@ -100,7 +102,11 @@ func volumeReferences(servicesNode *ast.MappingNode) []*token.Token {
}
}
} else {
tokens = append(tokens, volumeToken(volumeNode.GetToken()))
token := volumeNode.GetToken()
volumeConfig, err := format.ParseVolume(token.Value)
if err == nil && volumeConfig.Type == types.VolumeTypeVolume {
tokens = append(tokens, volumeToken(token))
}
}
}
} else if mappingNode, ok := volumesValue.(*ast.MappingNode); ok {
Expand Down
17 changes: 17 additions & 0 deletions internal/compose/documentHighlight_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2796,6 +2796,23 @@ services:
End: protocol.Position{Line: 4, Character: 14},
},
},
{
name: "read highlight on a volume's string array item with a bind mount",
content: `
services:
test:
volumes:
- ./folder:/mount/path`,
line: 4,
character: 14,
locations: func(u protocol.DocumentUri) any { return nil },
links: func(u protocol.DocumentUri) any { return nil },
ranges: nil,
renameEdits: func(u protocol.DocumentUri) *protocol.WorkspaceEdit {
return nil
},
prepareRename: nil,
},
{
name: "read highlight on an undefined volume array item's mount path",
content: `
Expand Down
Loading