nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.47k stars 288 forks source link

[finder] Improve docs for filter config and function signature #1302

Closed protiumx closed 1 year ago

protiumx commented 1 year ago

Is your feature request related to a problem? Please describe. The filter documentation currently is incorrect https://nvimdev.github.io/lspsaga/finder/#filter-search-result. The function signature mentioned in the doc does not match what the code does.

The filter function signature is also not very usable since it has return a similar object { resul = {} } otherwise the finder breaks. E.g.

{
  result = { {
      range = {
        ["end"] = {
          character = 14,
          line = 24
        },
        start = {
          character = 10,
          line = 24
        }
      },
      uri = "file:///a.go"
    }, {
      range = {
        ["end"] = {
          character = 14,
          line = 25
        },
        start = {
          character = 10,
          line = 25
        }
      },
      uri = "file:///a.go"
    } }
}

Describe the solution you'd like Fix the original documented filter config to filter each result

    filter = {
      ['textDocument/implementation'] = function(item)
         return item.uri ~= "test.go"
      end
    },
glepnir commented 1 year ago
filter = {
      ['textDocument/implementation'] = function(item)
         item now is list-like table .
      end
    },