Skip to content
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

x/tools/gopls: Diagnostic's CodeDescription field with empty `href` #42314

martskins opened this issue Oct 31, 2020 · 4 comments

x/tools/gopls: Diagnostic's CodeDescription field with empty `href` #42314

martskins opened this issue Oct 31, 2020 · 4 comments


Copy link

@martskins martskins commented Oct 31, 2020

go version:
    go version go1.15.2 darwin/amd64

go version -m (which gopls):
    /path/to/go/bin//gopls: go1.15.2
        mod        v0.0.0-20201031021630-582c62ec74d0      h1:rkV8jMWGmZrVZYXGAWnw2J2dFwvwVqU6bYbd1bOJKNo=
        dep      v0.3.1  h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
        dep        v0.5.2  h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
        dep        v1.1.0  h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
        dep        v0.3.0  h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
        dep       v0.0.0-20201020160332-67f06af15bc9      h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
        dep      v0.0.0-20201031021630-582c62ec74d0      h1:obBdJPIfkOi5/rVh102giHaq0G8BZGE4eGB+NU6SgBo=
        dep    v0.0.0-20200804184101-5ec99f83aff1      h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
        dep      v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
        dep        v0.0.0-20201027171050-85d5401eb0f6      h1:QQ9mYdTscaVSaHC8A1wtLkECzvpD/YO2E2GyPvU1D/Y=
        dep       v2.2.0  h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

What did you do?

Open a file that had diagnostics to be reported. For example:

package main

func main() {
	var a = 42

What did you expect to see?

The diagnostics with either no codeDescription or a codeDescription with an href field and non-empty value.

What did you see instead?

Diagnostics with {"codeDescription": {"href": ""}}.

To add a little more context: I'm not sure if that's being marshaled that way intentionally, but I get the impression that it wasn't what was intended, given that there's an omitempty tag on the field (, but that field being a (non-pointer) struct will never be omitted. As it is being sent right now it breaks at least LanguageClientNeovim, as it fails to deserialize that into an URL, given that the value is an empty string.

Copy link

@leitzler leitzler commented Oct 31, 2020

@gopherbot please add labels Tools, gopls

Copy link

@leitzler leitzler commented Oct 31, 2020

@martskins martskins changed the title Diagnostic's CodeDescription field with in x/tools/gopls: Diagnostic's CodeDescription field with empty `href` Nov 1, 2020
@gopherbot gopherbot added this to the Unreleased milestone Nov 1, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.3 Nov 2, 2020
Copy link

@pjweinb pjweinb commented Nov 2, 2020

probably the right thing to do is to make Diagnostic.CodeDescription into a pointer. Let me look more closely.

@pjweinb pjweinb self-assigned this Nov 2, 2020
Copy link

@gopherbot gopherbot commented Nov 2, 2020

Change mentions this issue: internal/lsp: make Diagnostics.CodeDescription a pointer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants