Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta-testing 'mini.extra' #550

Closed
echasnovski opened this issue Nov 2, 2023 · 18 comments
Closed

Beta-testing 'mini.extra' #550

echasnovski opened this issue Nov 2, 2023 · 18 comments

Comments

@echasnovski
Copy link
Owner

Please leave your feedback about new mini.extra module here. Feel free to either add new comment or positively upvote existing one.

Some things I am interested to find out (obviously, besides bugs):

  • Are configuration and picker/textobject names intuitive enough?
  • Are default values of settings convenient for you?
  • Is documentation and examples clear enough?

Thanks!

@echasnovski echasnovski pinned this issue Nov 2, 2023
@Ernest1338
Copy link

Ernest1338 commented Nov 2, 2023

Really cool additions! I really appreciate your work on mini, it is a literal game changer for my neovim config.
I have couple of suggestions though.

  1. If there is only one result in Pick lsp scope='definition' it should jump to it.
  2. I think that buf_lines should default to scope='current'. I don't know about others but for me it was unexpected to see lines from other buffers.

Also one thing to the whishlist 😄
Can we extend list picker to allow picking from file types? :set filetype

@echasnovski
Copy link
Owner Author

echasnovski commented Nov 3, 2023

1. If there is only one result in `Pick lsp scope='definition'` it should jump to it.

That is really interesting, because my thought process is exactly the opposite: if I call any of MiniExtra.pickers, then I want to always see a picker. No matter if there is one entry or even zero (like with diagnostic, for example). So I don't think this will change.

I'd suggest using vim.lsp.buf.definition() directly without its on_list option (or adjust it accordingly). Funny enough, I even made a Neovim PR to change its behavior to always call on_list (if present) even if response is a single Location (not an array of locations).

2. I think that buf_lines should default to `scope='current'`. I don't know about others but for me it was unexpected to see lines from other buffers.

Yes, I debated myself a bit here, but decided to go with "all" because it is more aligned with other default values. As changing that is pretty straightforward, this should not be a huge problem. Edit: correct wording.

Also one thing to the whishlist 😄 Can we extend list picker to allow picking from file types? :set filetype

I have seen this in both Telescope and Fzf-lua and couldn't really figure out the use for it. Do you use it often?

@Ernest1338
Copy link

Ernest1338 commented Nov 3, 2023

Yes, I debated myself a bit here, but decided to go with "all" because it is more aligned with other default values. As changing that is pretty straightforward, this should be a huge problem.

I wonder what other people think about this. Also, this should be a huge problem? 😅

I have seen this in both Telescope and Fzf-lua and couldn't really figure out the use for it. Do you use it often?

I mainly use it to enable syntax highlighting on empty buffers or unknown files. Recently I'm also developing a programming language and need to do :set filetype c to get any sort of syntax highlighting. Having a picker for that would be helpful. Edit: I thought you said "I haven't seen this in telescope"

@JulesNP
Copy link

JulesNP commented Nov 4, 2023

Loving the new pickers so far! The main improvement I can think of at the moment is to add an option to the oldfiles picker to filter by cwd.

@echasnovski
Copy link
Owner Author

Loving the new pickers so far! The main improvement I can think of at the moment is to add an option to the oldfiles picker to filter by cwd.

oldfiles will remain as a plain picker from readable oldfiles entries.
I should start soon working on the new module implementing file visit tracking. This will provide an entry point for a more advanced oldfiles-like picker.

@fedreg-bn
Copy link

fedreg-bn commented Nov 5, 2023

New pickers are great! Loving the oldfiles, git_commit, and diagnostic pickers. All super useful. Need to test out some more but already have replaced Telescope

Are configuration and picker/textobject names intuitive enough?

absolutely!

Are default values of settings convenient for you?

Have not customized a single package and am using defaults for everything

Is documentation and examples clear enough?

Everything is clear enough and the very well documented code makes it easy to dive in as needed.

Thank you for all the great plugins!

@Susensio
Copy link

Susensio commented Nov 8, 2023

Regarding the registers picker, it would be nice to have a preview of the register content. Useful for multiline text.

@echasnovski
Copy link
Owner Author

Regarding the registers picker, it would be nice to have a preview of the register content. Useful for multiline text.

Hmmm... Originally I thought that preview is not really needed as content is in the item text itself. But you make a good point. I'll think about it.

@sunzoje
Copy link

sunzoje commented Nov 9, 2023

Will it be possible to combined multiple scope for git_files? For example, I want to list files which are modified and untracked.

@echasnovski
Copy link
Owner Author

@Susensio, thanks again for the suggestion. I've pushed an update for pickers.registers to preview register content.


@sunzoje, I don't think pickers.git_files will have the possibility of combining its scopes. Otherwise it will lead to a not so concise options.

I'd suggest using builtin.cli from 'mini.pick' directly. Something like this should cover most common use cases:

_G.pick_modified_untracked = function()
  local local_opts = { command = { 'git', 'ls-files', '--modified', '--others' } }
  local source = {
    name = 'Git files (modified + untracked)',
    show = function(buf_id, items, query) return MiniPick.default_show(buf_id, items, query, { show_icons = true }) end,
  }
  return MiniPick.builtin.cli(local_opts, { source = source })
end

@sunzoje
Copy link

sunzoje commented Nov 10, 2023

Any plan on adding git status picker? That's the only picker I'm missing from Fzf-lua.

@echasnovski
Copy link
Owner Author

Any plan on adding git status picker? That's the only picker I'm missing from Fzf-lua.

No, I don't think so. Its functionality is kind of spread across git_hunks and git_files, which I find a better "separation of duties".

@Aphosis
Copy link

Aphosis commented Nov 13, 2023

Hi, a huge thank you first of all for your plugins !

I've switched to mini.pick for a few days now (from telescope) and there are one or two pickers I miss. In mini.extra, this is the ability to dynamically update the query for vim.lsp.buf.workspace_symbol. Some LSPs have different implementations of workspace_symbol, for example the Lua LSP returns all workspace symbols on an empty query, but pyright (a Python LSP) returns nothing. This means that Pick lsp scope='workspace_symbol' always fails with pyright.

To circumvent the issue, telescope had a dynamic_workspace_symbol picker: instead of filtering the results in your picker, you would refine the query passed to vim.lsp.buf.workspace_symbol.

Is this a feature you would consider ? I think this is mostly a workaround for LSPs that do not implement the spec properly (vim.lsp.buf.workspace_symbol implies that an empty query should return all results, not none at all), but since we can't control the LSP implementation side of things, it could still be useful to have it implemented in mini.extra directly.

@echasnovski
Copy link
Owner Author

Hi, a huge thank you first of all for your plugins !

I've switched to mini.pick for a few days now (from telescope) and there are one or two pickers I miss. In mini.extra, this is the ability to dynamically update the query for vim.lsp.buf.workspace_symbol. Some LSPs have different implementations of workspace_symbol, for example the Lua LSP returns all workspace symbols on an empty query, but pyright (a Python LSP) returns nothing. This means that Pick lsp scope='workspace_symbol' always fails with pyright.

To circumvent the issue, telescope had a dynamic_workspace_symbol picker: instead of filtering the results in your picker, you would refine the query passed to vim.lsp.buf.workspace_symbol.

Is this a feature you would consider ? I think this is mostly a workaround for LSPs that do not implement the spec properly (vim.lsp.buf.workspace_symbol implies that an empty query should return all results, not none at all), but since we can't control the LSP implementation side of things, it could still be useful to have it implemented in mini.extra directly.

Hi, thanks for the feedback!

I was not aware of this issue. After having read the LSP specification, it is indeed seems that LSP server does not follow it in this case. Here is a link for future reference: in "Request" subsection it says "Clients may send an empty string here to request all symbols.".

I am not really keen on providing built-in workarounds for something not following the standard. What I think is the best compromise here is to allow users to set that query themselves (which is possible thanks to vim.lsp.buf.workspace_symbol()) to not always use empty string. This way there can be something like :Pick lsp scope='workspace_symbol' symbol_query=vim.fn.input('Symbol:\ ') to prompt for query. It is not a "live workspace symbol" but is a decent solution I think.

I'll try to add it tomorrow.

@Aphosis
Copy link

Aphosis commented Nov 13, 2023

I am not really keen on providing built-in workarounds for something not following the standard. What I think is the best compromise here is to allow users to set that query themselves (which is possible thanks to vim.lsp.buf.workspace_symbol()) to not always use empty string. This way there can be something like :Pick lsp scope='workspace_symbol' symbol_query=vim.fn.input('Symbol:\ ') to prompt for query. It is not a "live workspace symbol" but is a decent solution I think.

I'll try to add it tomorrow.

Thanks for your quick reply, I think this solution would be fine indeed !

@echasnovski
Copy link
Owner Author

@Aphosis, pickers.lsp now has symbol_query local option. You can use :Pick lsp scope='workspace_symbol' symbol_query=vim.fn.input('Symbol:\ ') to interactively set query for filtering symbol.

@Aphosis
Copy link

Aphosis commented Nov 14, 2023

@Aphosis, pickers.lsp now has symbol_query local option. You can use :Pick lsp scope='workspace_symbol' symbol_query=vim.fn.input('Symbol:\ ') to interactively set query for filtering symbol.

Thank you, works like a charm !

@echasnovski
Copy link
Owner Author

With the release of 0.11.0, 'mini.extra' is now out of beta-testing. Many thanks to everyone for constructive feedback and ideas!

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

No branches or pull requests

7 participants