golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.84k stars 735 forks source link

show enclosing method name, when searching for usages #3083

Closed guettli closed 9 months ago

guettli commented 9 months ago

Is your feature request related to a problem? Please describe.

I press ctrl-click on a function name:

func (s *Service) handleIncompleteBoot(isRebootIntoRescue, isTimeout) (failed bool, err error) {

Now I see all usages of that function.

image

I see 4 usages of the method in host.go (right side of the screenshot).

I am missing the surrounding method name. The method in which handleIncompleteBoot() gets called.

Describe the solution you'd like

If I click on a search result (right side of screenshot), then I see the preview.

New: At the top, I want to see the method name of the lines I see in the preview.

In the above example, I would like to see which method the line 1286 belongs to.

hyangah commented 9 months ago

The preview UI and reference UX are implemented by microsoft/vscode. This extension and the language server just offers just reference location list and the vscode renders the list. So, I think discussion there will be more fruitful.

Existing alternatives (not convenient as what you are proposing) are:

hyangah commented 9 months ago

@guettli Can you try the alternatives? The same feature request was open multiple times in microsoft/vscode e.g https://github.com/microsoft/vscode/issues/67268, but rejected in favor of an alternative like sticky-scroll.

Closing. Out-of-scope.

guettli commented 9 months ago

Thank you very much!

Sticky scroll solves my issue.

Now I see the function name in the preview window.

image

Don't ask me why sticky scroll is not enabled by default in vscode....