prabirshrestha / vim-lsp

async language server protocol plugin for vim and neovim
MIT License
3.13k stars 305 forks source link

LspCallHierarchyIncoming with eclipse-jdt-ls does not reference correct line #1466

Closed mgwolff closed 1 year ago

mgwolff commented 1 year ago

When using the LspCallHierarchyIncoming command with eclipse-jdt-ls to find the usage of a method, vim-lsp references the line of the method declaration that uses the method, instead of the actual line where the method is used.

Based on the lsp_log_file, it looks like vim-lsp uses the line defined in from.range.start.line instead of from.selectionRange.start.line.

For example, see the below excerpt from the lsp_log_file. The line used by vim-lsp is line 194, but it should actually be line 199.

{
    "from": {
      "uri": "file:///home/manuel/Test.java",
      "range": {
        "end": {
          "character": 5,
          "line": 205
        },
        "start": {
          "character": 4,
          "line": 193
        }
      },
      "name": "sample(String, String) : String",
      "selectionRange": {
        "end": {
          "character": 151,
          "line": 198
        },
        "start": {
          "character": 25,
          "line": 198
        }
      },
      "kind": 6,
      "detail": "Test"
    }
}
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.