aznhe21 / actions-preview.nvim

Fully customizable previewer for LSP code actions.
GNU General Public License v3.0
365 stars 9 forks source link

Code actions didn't work with nvim-java #50

Closed GustavoJCL closed 1 month ago

GustavoJCL commented 2 months ago

Hi, i installed nvim-java and actions-preview.nvim, but I the code actions doesn't work Neovim version: 0.10 Operating system: Arch Linux actions-preview.vim config:

'aznhe21/actions-preview.nvim',
    lazy = true,
    opts = function(_, opts)
        opts.telescope = {
            sorting_strategy = 'ascending',
            layout_strategy = 'vertical',
            layout_config = {
                width = 0.7,
                height = 0.8,
                prompt_position = 'top',
                preview_cutoff = 20,
                preview_height = function(_, _, max_lines)
                    return max_lines - 25
                end,
            },
        }
    end,

nvim-java:

{
    'nvim-java/nvim-java',
    lazy = true,
    ft = 'java',
    dependencies = {
      'nvim-java/lua-async-await',
      'nvim-java/nvim-java-core',
      'nvim-java/nvim-java-test',
      'nvim-java/nvim-java-dap',
      'MunifTanjim/nui.nvim',
      'neovim/nvim-lspconfig',
      'mfussenegger/nvim-dap',
      'nvim-java/nvim-java-refactor',
      {
        'williamboman/mason.nvim',
        opts = function(_, opts)
          if not opts.registries then
            opts.registries = { 'github:mason-org/mason-registry' }
          end
          table.insert(opts.registries, 1, 'github:nvim-java/mason-registry')
        end,
      },
    },
    config = function()
      require('java').setup()
      require('lspconfig').jdtls.setup {
            settings = {
              java = {
                inlayHints = {
                  parameterNames = {
                    enabled = 'all',
                    exclusions = { 'this' },
                  },
                },
              },
            },
          }
    end,
  }
aznhe21 commented 1 month ago

I have set up nvim-java in my environment as well, and it seems to be working correctly. Could you please provide more detailed information? I have confirmed this on both Arch Linux (WSL2) and Fedora 40 (physical machine).

image

aznhe21 commented 1 month ago

It seemed to be working, but after updating the packages, it stopped functioning... Since vim.lsp.buf.code_action() works, it appears to be a bug. I will investigate further.

aznhe21 commented 1 month ago

Fixed in #52. Please check it.