Skip to content

Commit 9507d3c

Browse files
committed
Fix link range for Windows paths with a drive letter
Signed-off-by: Remy Suen <remy.suen@docker.com>
1 parent 6bef505 commit 9507d3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/compose/documentLink.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ func createVolumeFileLinks(folderAbsolutePath string, wslDollarSign bool, servic
114114
links := []protocol.DocumentLink{}
115115
for _, node := range sequence.Values {
116116
if s, ok := resolveAnchor(node).(*ast.StringNode); ok {
117-
config, err := format.ParseVolume(s.GetToken().Value)
117+
t := s.GetToken()
118+
config, err := format.ParseVolume(t.Value)
118119
if err == nil && config.Type == composeTypes.VolumeTypeBind {
119120
uri, path := createLocalFileLink(folderAbsolutePath, config.Source, wslDollarSign)
120121
info, err := os.Stat(path)
121122
if err == nil && !info.IsDir() {
122-
t := volumeToken(s.GetToken())
123123
links = append(links, protocol.DocumentLink{
124-
Range: createRange(t, len(t.Value)),
124+
Range: createRange(t, len(config.Source)),
125125
Target: types.CreateStringPointer(uri),
126126
Tooltip: types.CreateStringPointer(path),
127127
})

0 commit comments

Comments
 (0)