weilbith / nvim-code-action-menu

Pop-up menu for code actions to show meta-information and diff preview
MIT License
576 stars 19 forks source link

Plugin fails to insert type annotation #57

Open gvolpe opened 1 year ago

gvolpe commented 1 year ago

Foremost, thanks a lot for making this plugin available to all neo-vimmers out there!

The actions displayed by the code actions menu work most of the time, except for the "Insert type annotation" one of Kind: refactor.rewrite and Name: insert-inferred-type.

However, running :lua vim.lsp.buf.code_action() works without issues. I've tested it using the nvim-metals plugin for the Scala language.

Not sure how to debug this, but happy to do more debugging and provide more details if you can guide me a little bit.

NVIM v0.7.2
nvim-code-action-menu: latest master, revision: 58e12501ea028ff1171f8f06ea53891f7c6e1c3f

Here's a demo video showcasing the issue.

https://user-images.githubusercontent.com/443978/194530445-263b31cb-b729-4c46-849e-045469c64f97.mp4

weilbith commented 1 year ago

Damn it. The whole refactoring of this plugin is soooo overdue. I'm afraid something in the NeoVim core has changed again. But it is a bit awkward. I'm very sorry for your inconvenience. Unless you are willed to dig into the code of the plugin yourself and open a PR. I'm afraid I still struggle to find time to properly work on this plugin again. I got too much intention and was poorly written. 😕

In theory you only have to make a manual call to figure out if this is a command or an edit. Afterwards you can check this or that execute function that calls the underlying NeoVim core functionality. Maybe that gives you already an hint.

But maybe this issue is a good impetus again...

gvolpe commented 1 year ago

@weilbith thanks a lot for your reply! No worries, raised the issue for awareness but you don't owe anyone anything, this is OSS :)

I have never written any Lua, so I may take this opportunity to finally learn some, though it may need to wait for now...