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

Allow entry_maker to return a flag to denote entries type #2230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dsych
Copy link

@dsych dsych commented Nov 8, 2022

Description

What the tittle says.

This is useful when one is creating a live_grep like picker that makes a request to some url that returns a single json array with multiple entries. From the perspective of the oneshot job, the json is on a single line and has to be considered as a single entry, however this might not be what we actually want. Instead, we might want to parse the json and return multiple entries. For instance:
source line : "{someArray: [1, 2, 3]}" -> wanted entries : 1, 2, 3

Fixes # (issue)

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

I tested this with curl as a command that makes request to an http endpoint that returns a json. Also tested other pickers like live_grep, find_files, lsp pickers etc.

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

  • Test A
  • Test B

Configuration:

  • Neovim version (nvim --version):
nvim --version
NVIM v0.9.0-dev-213+gcc5b7368d
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/dsych/.local/source/neovim/build/cmake.config -I/home/dsych/.local/source/neovim/src -I/home/dsych/.local/source/neovim/.deps/usr/include -I/usr/include -I/home/dsych/.local/source/neovim/build/src/nvim/auto -I/home/dsych/.local/source/neovim/build/include
Compiled by 

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info
  • Operating system and version:
    Amazon Linux 2

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)

This is useful when one is creating a live_grep like picker that makes a
request to some url that returns a single json array with multiple
entries. From the perspective of the oneshot job, the json is on a
single line and has to be considered as a single entry, however this
might not be what we actually want. Instead, we might want to parse the
json and return *multiple* entries. For instance:
source line : "{someArray: [1, 2, 3]}" -> wanted entries : 1, 2, 3
@Conni2461
Copy link
Member

hmm i gotta think about this and if we can solve this with some configuration, so we are replacing the actual code that is running and dont have to do the consider multiple job in every iteration

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