nanotee / sqls.nvim

Neovim plugin for sqls that leverages the built-in LSP client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Commands work but code actions do nothing

lucasvianav opened this issue · comments

As far as I understood, the commands that go in the on_attach were supposed to integrate this plugins with sqls so it would use this plugin's functions to execute code actions and stuff, is that it?

        client.resolved_capabilities.execute_command = true
        client.commands = require('sqls').commands -- Neovim 0.6+ only

When using the commands provided in README, it seems to work, but the LSP code actions do nothing.

Please let me know if I'm misunderstanding what the plugin does or if this issue does not belong here and I'll gladly look for help elsewhere :)

sqls

Just noticed the DB is receiving the query with the code action, although no preview/error window is being shown in Neovim.

db_1  | 2021-11-23 03:43:17.368 UTC [35] ERROR:  relation "foo" does not exist at character 19
db_1  | 2021-11-23 03:43:17.368 UTC [35] STATEMENT:  SELECT
db_1  |           *
db_1  |         FROM
db_1  |           foo

Thanks for the report! I can't seem to reproduce the bug, unfortunately. Out of curiosity, did you override the default LSP handler for code actions?

I'm surprised that results don't show up if the request is sent correctly, because the plugin ends up calling the same functions in either case

Thanks for the report! I can't seem to reproduce the bug, unfortunately. Out of curiosity, did you override the default LSP handler for code actions?

For code actions I didn't, but if it works for you then it's probably some incompatibility with my config. I'll try to reproduce it with a minimal config

(also thank YOU for the cool plugin and for helping :D)

I have the same issue with nvim-code-action-menu and Telescope lsp_code_actions but it works with built-in lua vim.lsp.buf.code_action().

Ah, nice catch! I've read the code and discovered Telescope uses a custom handler that doesn't take client.commands or vim.lsp.commands into account. I suspect the same is true for nvim-code-action-menu.

:Telescope code_actions was removed from telescope.nvim. I think this issue can be closed since there's not much I can do in this case, feel free to reopen if you think that's a mistake