Skip to content

feature: add java.action.applyRefactoringCommand #96

@mawkler

Description

@mawkler

Did you check the docs?

  • I have read all the docs

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

First of all, thank you for this awesome plugin! It made it super simple for me to get a Java config up and running.

Second, Is there any reason why it doesn't wrap nvim-jdtls? According to this comment by its author it would be pretty simple. nvim-jdtls supports code-actions like extracting methods and variables for instance. What would be your response to this? 🙂

Describe the solution you'd like

nvim-java sets up nvim-jdtls

Describe alternatives you've considered

Not using nvim-java and instead manually settings up nvim-jdtls (which seems is really tedious)

Additional context

Here's the post that I made in nvim-jdtls:

LSP client configuration

No response

Eclipse.jdt.ls version

v1.30.1

Steps to Reproduce

Hi! Thanks for making this awesome plugin! I just installed it, and when I try and perform the code action "Extract to method" I get the message

Language server `jdtls` does not support command `java.action.applyRefactoringCommand`. This command may require a client extension.

Is this expected behaviour? The README says that extract_method is supported.

This is the config that I'm using:

Click to expand
return {
  'nvim-java/nvim-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',
    {
      'williamboman/mason.nvim',
      opts = {
        registries = {
          'github:nvim-java/mason-registry',
          'github:mason-org/mason-registry',
        },
      },
    },
  },
  config = function()
    require('java').setup()
    require('lspconfig').jdtls.setup({})
  end
}

To reproduce:

  1. Open a .java file
  2. Select text in visual mode
  3. Do :=vim.lsp.buf.code_action()
  4. Select Extract to method
  5. Message pops up

Expected Result

Code action lets me extract code to a new method

Actual Result

I get the message

Language server `jdtls` does not support command `java.action.applyRefactoringCommand`. This command may require a client extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions