Skip to content

Compose target stage completion across multiple lines raises an error #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rcjsuen opened this issue May 16, 2025 · 0 comments · Fixed by #211
Closed

Compose target stage completion across multiple lines raises an error #210

rcjsuen opened this issue May 16, 2025 · 0 comments · Fixed by #211
Assignees
Labels

Comments

@rcjsuen
Copy link
Collaborator

rcjsuen commented May 16, 2025

Using code completion on a different line from services.[N].build.target can cause a panic.

services:
  test:
    build:
      target: abc
        
{
    "textDocument": {
        "uri": "file:///tmp/compose.yaml"
    },
    "position": {
        "line": 4,
        "character": 8
    },
    "context": {
        "triggerKind": 1
    }
}
goroutine 52 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.23.8/x64/src/runtime/debug/stack.go:26 +0x64
runtime/debug.PrintStack()
	/opt/hostedtoolcache/go/1.23.8/x64/src/runtime/debug/stack.go:18 +0x1c
github.com/docker/docker-language-server/internal/pkg/server.(*Server).handleRecovered(0x140005b0000, {0x1400051e660, 0x17}, {0x10180a520, 0x1400051e6a8})
	/home/runner/work/docker-language-server/docker-language-server/internal/pkg/server/server.go:199 +0x44
github.com/docker/docker-language-server/internal/pkg/server.NewServer.func1({0x1400051e660?, 0x140000573c7?}, {0x10180a520?, 0x1400051e6a8?})
	/home/runner/work/docker-language-server/docker-language-server/internal/pkg/server/server.go:127 +0x40
github.com/docker/docker-language-server/internal/tliron/glsp/protocol.(*Handler).Handle.func1()
	/home/runner/work/docker-language-server/docker-language-server/internal/tliron/glsp/protocol/handler.go:100 +0x6c
panic({0x10180a520?, 0x1400051e6a8?})
	/opt/hostedtoolcache/go/1.23.8/x64/src/runtime/panic.go:791 +0x124
github.com/docker/docker-language-server/internal/compose.buildTargetCompletionItems(0x14000672f90, 0x140000d58f0, {0x1400067a5a0, 0x4, 0x9?}, 0x1400027f320, 0x0)
	/home/runner/work/docker-language-server/docker-language-server/internal/compose/completion.go:348 +0x398
github.com/docker/docker-language-server/internal/compose.Completion({0x102230d10?, 0x10181fd00?}, 0x14000672f90, 0x140000d58f0, {0x1018d2360, 0x14000319ce0})
	/home/runner/work/docker-language-server/docker-language-server/internal/compose/completion.go:158 +0x2e0
github.com/docker/docker-language-server/internal/pkg/server.(*Server).TextDocumentCompletion(0x140005b0000, 0x14000674730, 0x14000672f90)
	/home/runner/work/docker-language-server/docker-language-server/internal/pkg/server/completion.go:22 +0x254
github.com/docker/docker-language-server/internal/tliron/glsp/protocol.(*Handler).Handle(0x140006a6008, 0x14000674730)
	/home/runner/work/docker-language-server/docker-language-server/internal/tliron/glsp/protocol/handler.go:388 +0x146c
github.com/docker/docker-language-server/internal/tliron/glsp/server.(*Server).handle(0x140001ba1e0, {0x1018c9988, 0x140003dc070}, 0x140005b6000, 0x14000670c00)
	/home/runner/work/docker-language-server/docker-language-server/internal/tliron/glsp/server/handler.go:48 +0x220
github.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0x1400051a3c0, {0x1018c9988, 0x140003dc070}, 0x140005b6000, 0x14000670c00)
	/home/runner/go/pkg/mod/github.com/sourcegraph/[email protected]/handler_with_error.go:21 +0x4c
github.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0x140005b6000, {0x1018c9988, 0x140003dc070})
	/home/runner/go/pkg/mod/github.com/sourcegraph/[email protected]/conn.go:205 +0x2a4
created by github.com/sourcegraph/jsonrpc2.NewConn in goroutine 1
	/home/runner/go/pkg/mod/github.com/sourcegraph/[email protected]/conn.go:62 +0x1d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant