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

Updated docs to clarify which telescope.defaults options can be overriden by pickers #3251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

clorl
Copy link

@clorl clorl commented Aug 13, 2024

Description

Fixes #3238

The documentation isn't very clear about what keys are valid for pickers config options. There is a subset of of defaults options that pickers can override and it's not clear which ones are.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration

  •  Hot swapped telescope with this commit in my config, nothing broke
  • make test
  • make lint

Configuration:

  • Neovim version (nvim --version): NVIM v0.10.1

  • Operating system and version: Debian 12

Checklist:

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

Copy link
Contributor

@jamestrew jamestrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the very late response.

I have a few suggestions but otherwise looks good.

@@ -106,18 +106,26 @@ local telescope = {}
--- pickers = {
--- -- Default configuration for builtin pickers goes here:
--- -- picker_name = {
--- -- picker_config_key = value,
--- -- default_config_key = value_one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--- -- default_config_key = value_one
--- -- default_config_key = value_one, -- optionally override any default options

--- of the options you want to use. Pickers have their own specific set of
--- options, but also accept a subset of the defaults options. The default
--- options which are valid to configure a picker are marked as
--- "Picker-Overridable" in telescope.setup.defaults
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll probably be easier to mark options that aren't "picker-overriable".
In theory, all but a small handful can at least in technically be overriden by the each individual picker.

I would reword this bit slightly and let's leave out the marking of individual options an "Picker-Overridable" for now.

Comment on lines +113 to +118
--- -- Options set here will be applied everytime you call this builtin
--- -- picker. Each entry accepts a subset of the "defaults" configuration
--- -- options, as well as the picker's own specific configuration options.
--- -- Defaults options that are also valid for pickers are marked as
--- -- "Picker-Overridable" in telescope.setup.defaults. Learn about one
--- -- picker's specific set of options at telescope.builtin.$PICKER_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--- -- Options set here will be applied everytime you call this builtin
--- -- picker. Each entry accepts a subset of the "defaults" configuration
--- -- options, as well as the picker's own specific configuration options.
--- -- Defaults options that are also valid for pickers are marked as
--- -- "Picker-Overridable" in telescope.setup.defaults. Learn about one
--- -- picker's specific set of options at telescope.builtin.$PICKER_NAME
--- -- Options set here will be applied everytime you call this builtin
--- -- picker. The pickers will also inherit the "default" options unless
--- -- they are overwritten.
--- -- See `:h telescope.builtin` for options unique to each picker.

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.

Docs doesn't make it clear that pickers and extensions accept same opts as defaults
2 participants