Skip to content

x/tools/gopls: with fieldalignment analyzer deprecated, there is no visual feedback upon misalignment #76237

@gitsomebit

Description

@gitsomebit

Go version

[email protected]

Output of go env in your module/workspace:

win10, amd64

What did you do?

in the settings.json add the fieldalignment flag:

"gopls": {
    "analyses": {
        "fieldalignment": true
    }
 }

What did you see happen?

It now gives a popup warning in the bottom right corner:

Invalid settings: setting option "analyses": the 'fieldalignment' analyzer was removed in gopls/v0.17.0; instead, hover over struct fields to see size/offset information (https://go.dev/issue/66861)

It links to a completly unrelated issue #66861

What did you expect to see?

I expect a visual warnings when struct fields are misaligned by underlining the struct with a yellow line and a warning in the bottom panel.

note

I saw that there is a new way of hovering over the fields to check the alignment and offset, but this feels clunky and like a step back from an already good system where you would get visual feedback when you misaligned things.

Now I need to manually check the struct fields and must not forget to do so, since there is no visual feedback any more, when fields are misaligned.

Is there a way to get the old way back or add an option to give visual feedback for when fields are misaligned?

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