folke / noice.nvim

đź’Ą Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to exclude `tselect` and related prompts output from Noice

oinak opened this issue · comments

Did you check the docs?

  • I have read all the noice.nvim docs

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

When I set my cursor on provider.run (see screenshot)
^
And type g] to show a list of tags matching the word under cusror.

The list is mangled withing a message popup and the prompt is not visible/usable.

image

Describe the solution you'd like

Keep original behavior for :tselect and related messages

image

It could work also to have a Noive window and prompt, but excluding might be easier.

Describe alternatives you've considered

  • only using c-] (jump to 1st tag) but it does not scale for common method names like run and call
  • using Telescope.live_grep but it does not scale to look for only the implementation for methods with a lot of usages

Additional context

These are the files for my test

# a.rb
require_relative 'a/b'
require_relative 'a/c'

module A
  extend self

  def run(provider: A::B)
    provider.run
  end
end
# a/b.rb
module A
  class B
    def self.run
      puts 'b'
    end
  end
end
# a/c.rb
module A
  class C
    def self.run
      puts 'c'
    end
  end
end

And th .tags file

!_TAG_EXTRA_DESCRIPTION	anonymous	/Include tags for non-named objects like lambda/
!_TAG_EXTRA_DESCRIPTION	fileScope	/Include tags of file scope/
!_TAG_EXTRA_DESCRIPTION	pseudo	/Include pseudo tags/
!_TAG_EXTRA_DESCRIPTION	subparser	/Include tags generated by subparsers/
!_TAG_FIELD_DESCRIPTION	epoch	/the last modified time of the input file (only for F\/file kind tag)/
!_TAG_FIELD_DESCRIPTION	file	/File-restricted scoping/
!_TAG_FIELD_DESCRIPTION	input	/input file/
!_TAG_FIELD_DESCRIPTION	name	/tag name/
!_TAG_FIELD_DESCRIPTION	pattern	/pattern/
!_TAG_FIELD_DESCRIPTION	typeref	/Type and name of a variable or typedef/
!_TAG_FIELD_DESCRIPTION!Ruby	mixin	/how the class or module is mixed in (mixin:HOW:MODULE)/
!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_DESCRIPTION!Ruby	A,accessor	/accessors/
!_TAG_KIND_DESCRIPTION!Ruby	C,constant	/constants/
!_TAG_KIND_DESCRIPTION!Ruby	L,library	/libraries/
!_TAG_KIND_DESCRIPTION!Ruby	S,singletonMethod	/singleton methods/
!_TAG_KIND_DESCRIPTION!Ruby	a,alias	/aliases/
!_TAG_KIND_DESCRIPTION!Ruby	c,class	/classes/
!_TAG_KIND_DESCRIPTION!Ruby	f,method	/methods/
!_TAG_KIND_DESCRIPTION!Ruby	m,module	/modules/
!_TAG_OUTPUT_EXCMD	mixed	/number, pattern, mixed, or combineV2/
!_TAG_OUTPUT_FILESEP	slash	/slash or backslash/
!_TAG_OUTPUT_MODE	u-ctags	/u-ctags or e-ctags/
!_TAG_OUTPUT_VERSION	0.0	/current.age/
!_TAG_PARSER_VERSION!Ruby	0.0	/current.age/
!_TAG_PATTERN_LENGTH_LIMIT	96	/0 for no limit/
!_TAG_PROC_CWD	/Users/fmartinez/src/fer/noice_tags/	//
!_TAG_PROGRAM_AUTHOR	Universal Ctags Team	//
!_TAG_PROGRAM_NAME	Universal Ctags	/Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL	https://ctags.io/	/official site/
!_TAG_PROGRAM_VERSION	6.0.0	//
!_TAG_ROLE_DESCRIPTION!Ruby!library	loaded	/loaded by "load" method/
!_TAG_ROLE_DESCRIPTION!Ruby!library	required	/loaded by "require" method/
!_TAG_ROLE_DESCRIPTION!Ruby!library	requiredRel	/loaded by "require_relative" method/
A	a.rb	/^module A$/;"	m	mixin:extend:self
A	a/b.rb	/^module A$/;"	m
A	a/c.rb	/^module A$/;"	m
B	a/b.rb	/^  class B$/;"	c	module:A
C	a/c.rb	/^  class C$/;"	c	module:A
run	a.rb	/^  def run(provider: A::B)$/;"	f	module:A
run	a/b.rb	/^    def self.run$/;"	S	class:A.B
run	a/c.rb	/^    def self.run$/;"	S	class:A.C

I have also tried adding:

        redirect = {
          filter = {
            event = "msg_show",
            find = "# pri kind tag" -- the first line of the tselect prompt
          },
          view = "cmdline"
        }

To the config but it does not seem to trigger with this kind of message

I tried also with find = "tag", without find and with redirects instead of routes to no avail.

I am afraid there is something I am not understanding from the documentation.

I have found a workaround which don't love but works:

return {
  -- lazy.nvim
  {
    "folke/noice.nvim",
    -- rest of the config
    config = function()
      require("noice").setup({
      vim.keymap.set('n', 'g]', function()
        vim.cmd("Noice disable")
        vim.cmd.tselect(vim.fn.expand("<cword>"))
        vim.cmd("Noice enable")
      end, { desc = '[G]o to Tag List' })
    end
  }