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

support additional_args argument #86

Merged
merged 2 commits into from
Jul 28, 2024

Conversation

mebble
Copy link
Contributor

@mebble mebble commented Jul 27, 2024

Description

Support for additional_args

This plugin currently doesn't support searching within hidden files and directories. This makes it difficult to work with, say .github/workflows/ directories and the like. Telescope's live_grep picker has a solution for this: additional_args. I would like to bring this feature to the live-grep-args extension. This will allow us to pass additional_args = { "--hidden" } to this extension so that hidden files are included. We also get other benefits with the ability to pass other CLI flags.

In this change, additional_args will be either a function or a table, so that it matches the signature of Telescope's live_grep picker. The implementation is just a copy of the one on live_grep

About vimgrep_arguments

Currently, my workaround is to use vimgrep_arguments. The problem with this is that vimgrep_arguments is not merged with the default value; it sets the entire thing. This is also the case in the telescope picker. Hence I have to set to vimgrep_arguments the entire ripgrep CLI command. This solution is prone to breaking or becoming stale.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

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

  • Cloned plenary.nvim and ran make test

Configuration:

  • Neovim version (nvim --version):
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"
  • Operating system and version:
Darwin 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64

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
  • I have made corresponding changes to the documentation (lua annotations)

@mebble
Copy link
Contributor Author

mebble commented Jul 28, 2024

This PR possibly addresses issue #9

@weeman1337 weeman1337 force-pushed the feature-additional-args branch from be9d6b7 to 7693090 Compare July 28, 2024 08:28
@weeman1337 weeman1337 self-requested a review July 28, 2024 08:29
Copy link
Collaborator

@weeman1337 weeman1337 left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @mebble . I've added docs and a changelog. Also fixed some complains from the style checker.

Other than that looks good 👍

@weeman1337 weeman1337 merged commit 649b662 into nvim-telescope:master Jul 28, 2024
2 checks passed
@mebble
Copy link
Contributor Author

mebble commented Jul 28, 2024

Thank you for the quick review! I noticed the docs for this arg in the README doesn't look right. The markdown table is broken. I could maybe fix that, maybe even mention other args in the table too.

@mebble mebble deleted the feature-additional-args branch July 28, 2024 08:46
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.

2 participants