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

Can't rename method under golang #42

Closed
orbatschow opened this issue Dec 16, 2023 · 2 comments
Closed

Can't rename method under golang #42

orbatschow opened this issue Dec 16, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@orbatschow
Copy link

Using the code below as an example, renaming foo works as expected, but trying to rename Bar changing just the Bar part of the input text does nothing.

package main

type foo struct{}

func (*foo) Bar() {
}

func main() {
	_ = foo{}
}

Deleting the input text (i.e. removing the trailing (*foo).) works.

Versions:

nvim: v0.9.4
outline: rev d073791
gopls: v0.14.2

old issue: simrat39/symbols-outline.nvim#175 (comment)

@hedyhli hedyhli added bug Something isn't working help wanted Extra attention is needed labels Dec 18, 2023
@hedyhli
Copy link
Owner

hedyhli commented Dec 27, 2023

The issue is due to handling the LSP rename ourselves in a naive approach, so we can handle blacklisted LSP clients from the config effectively. In nvim 0.8 vim.lsp.buf.rename added the ability to filter clients, so we can now delegate this task to the native API instead, which handles the rename for golang methods correctly.

outline_golang_rename.mov

This should now work with nvim 0.8+; the commit will be live soon.

Do let me know if it's still an issue.

@orbatschow
Copy link
Author

confirmed working, thanks alot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants