Skip to content

x/tools/gopls: add examples from <pkg>/examples_test.go to hover info #54002

@abenz1267

Description

@abenz1267

Hello everyone,

i'd be a good addition to add an option to show code examples for hover. I figured out pkg.go.dev simply parses the packages example_test.go file/function. So f.e. regexp.ReadAllString -> regexp/examples_test.go ExampleRegexp_ReadAllString.

I tried a very naive approach just as a POC and got this result:

Screenshot_20220722_170426

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ThinkingToolsThis 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