golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.35k stars 17.71k forks source link

x/tools/gopls: deprecate 'Structured' hover kind #70233

Open findleyr opened 3 weeks ago

findleyr commented 3 weeks ago

The 'Structured' hover kind does not serve human readable hover content. Rather, it serves JSON describing the hover. https://github.com/golang/tools/blob/master/gopls/doc/settings.md#hoverkind-enum

gopls should conform to the semantics of the LSP: hover is intended to be human readable. If we want to delegate hover presentation to the client, we must by definition have a thick client, in which case the client can just use a separate command via workspace/executeCommand. By analogy, tsserver has a command for structured hover info: https://github.com/microsoft/TypeScript/blob/55f1248a2052eebdea6bc0e2eef754df89a44bf7/src/server/protocol.ts#L2015.

CC @adonovan

adonovan commented 3 weeks ago

I vaguely recall that the sole thick client of the Hover JSON output is one of the Vims. (The feature was added in the CL attached to #33352. Paging @myitcv for awareness.)