Skip to content

Conversation

@TmLev
Copy link

@TmLev TmLev commented Jan 22, 2025

Description

This PR aims to add support for generic items filtering mechanism as described in #3401.

Resolves #3401.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

local map = function(keys, func, desc, mode)
  mode = mode or 'n'
  vim.keymap.set(mode, keys, func, { 
    -- buffer = event.buf, -- `LspAttach` event (taken from `kickstart.nvim`)
    desc = 'LSP: ' .. desc 
  })
end

map('gd', function()
  require('telescope.builtin').lsp_definitions {
    filter_items = function(items)
      return items -- Test A: Returns all results.
      -- return {} -- Test B: Returns nothing, displaying the `No LSP Definitions found` message.
    end,
  }
end, '[G]oto [D]efinition')

Configuration:

  • Neovim version (nvim --version):
    NVIM v0.10.3
    Build type: Release
    LuaJIT 2.1.1734355927
    
  • Operating system and version: macOS 13.4

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas There is no hard-to-understand code
  • I have made corresponding changes to the documentation (lua annotations)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic list_or_jump items filtering mechanism

1 participant