Skip to content

Commit ccc1152

Browse files
authored
Merge pull request #177 from docker/compose-completion-item-schema-docs
Add schema documentation to Compose completion items
2 parents 16ef1a5 + 851c842 commit ccc1152

File tree

3 files changed

+249
-0
lines changed

3 files changed

+249
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to the Docker Language Server will be documented in this fil
99
- Compose
1010
- textDocument/completion
1111
- support build stage names for the `target` attribute ([#173](https://github.com/docker/docker-language-server/issues/173))
12+
- set schema documentation to the completion items ([#176](https://github.com/docker/docker-language-server/issues/176))
1213

1314
## [0.6.0] - 2025-05-07
1415

internal/compose/completion.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ func Completion(ctx context.Context, params *protocol.CompletionParams, manager
151151
InsertTextMode: types.CreateInsertTextModePointer(protocol.InsertTextModeAsIs),
152152
InsertTextFormat: types.CreateInsertTextFormatPointer(protocol.InsertTextFormatSnippet),
153153
}
154+
if schema.Description != "" {
155+
item.Documentation = schema.Description
156+
} else if schema.Ref != nil && schema.Ref.Description != "" {
157+
item.Documentation = schema.Ref.Description
158+
}
154159

155160
if schema.Enum != nil {
156161
options := []string{}

0 commit comments

Comments
 (0)