Skip to content

x/tools/gopls: -remote causes the first run with Helix to not work for a few seconds #70298

@mvdan

Description

@mvdan

What did you do?

Running gopls with https://helix-editor.com/ and with -remote=auto, I open a Go file inside a Go module for the first time without gopls already running in remote mode, and ask gopls a question very quickly, such as go-to-definition or the workspace symbol picker.

What did you expect to see?

It should work, even if it takes a few seconds to give an answer due to the LSP loading the module.

What did you see instead?

An error from Helix:

No configured language server supports workspace symbols

This error seems to come from the editor, so it may not be a gopls bug. However, if I remove -remote=auto as suggested by @alandonovan, then the bug disappears - I can kill gopls, open a file and very quickly list all workspace symbols, and the UI pops up immediately without a problem, even if it takes a couple of seconds for the symbols to show up.

Presumably an editor like Helix starting the LSP causes a handshake to happen for the editor to know which features the LSP supports, so I wonder if this doesn't work too well when -remote=auto is used, causing the editor to think a Go LSP is not supported or present while it is still loading.

Build info

golang.org/x/tools/gopls v0.0.0-20241111214603-06a498a7a312
    golang.org/x/tools/gopls@v0.0.0-20241111214603-06a498a7a312 h1:7KWJGDbH0ZlvryN3TlO+JzxJWieJHrk0mPS20KRc8uE=
    github.com/BurntSushi/toml@v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
    github.com/google/go-cmp@v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
    golang.org/x/exp/typeparams@v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=
    golang.org/x/mod@v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
    golang.org/x/sync@v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
    golang.org/x/telemetry@v0.0.0-20241106142447-58a1122356f5 h1:TCDqnvbBsFapViksHcHySl/sW4+rTGNIAoJJesHRuMM=
    golang.org/x/text@v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
    golang.org/x/tools@v0.27.1-0.20241111214603-06a498a7a312 h1:8k/Q1o+SUyt5050kQIaxFUZdu3rDC6XHaiASBndZKn0=
    golang.org/x/vuln@v1.0.4 h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I=
    honnef.co/go/tools@v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
    mvdan.cc/gofumpt@v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
    mvdan.cc/xurls/v2@v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: devel go1.24-c96939fbed 2024-11-12 01:08:33 +0000

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions