Skip to content

[gopls]: gopls v0.22.0 by default don't advertise support for semantic tokens to client if semanticTokens option is not set at initialization #4438

@krukroman

Description

@krukroman

Description

This issue created to address changes to gopls configuration, introduced in v0.22.0. Upstream issue golang/go#79524

Before version v.0.22.0 gopls advertised support for semantic tokens even if semanticTokens option was set to false on client side. Since v0.22.0 it is not true anymore, and neovim users will face problems with features that depend on semantic tokens.

Currently it is unclear if this change will be reverted or properly documented by gopls maintainers, so for now there is no reason to update gopls config.

As a temporary solution for users that use semantic tokens support will be downgrading gopls to v0.21.1, or use this workaround

vim.lsp.config("gopls", {
-- ... config ...
  init_options = {
    semanticTokens = true
  }
-- ...config ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions