Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

feat: ability to search in installed apidocs #66

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

Conversation

emmanueltouzery
Copy link
Contributor

i think this feature is useful. maybe it's a little crude, but it's better than not having the feature at all...

@luckasRanarison
Copy link
Owner

Intersting, I didn't know I needed this until now. But naming it DevdocsGrep would be better I think.

@emmanueltouzery
Copy link
Contributor Author

Sure, I can rename it a little later today! Why I wrote it was crude...

  • it doesn't respect the setting to pipe though glow
  • it shows the internal filenames such as 1.md instead of the real keys such as.. String.reverse or whatever

But going all the way would be quite a lot more work, and possibly too slow to be useful. I guess this is good enough, and can be improved though time potentially.

@emmanueltouzery
Copy link
Contributor Author

modified the PR to now use the Grep terminology.

@luckasRanarison
Copy link
Owner

luckasRanarison commented Nov 28, 2023

I think displaying the raw markdown is okay in this case, using glow actually doesn't make sense.
I found that we can hook into the live_grep builtin and change the display by passing a custom entry_maker. Having this with floating window would aso be nice but it seems that we can't directly change the default selection mapping, so that'd require some silly workaround. I'll take a closer look and try some stuff later but I think it can be improved.

@luckasRanarison
Copy link
Owner

luckasRanarison commented Nov 28, 2023

So I improved the result display format and made it a little bit fancy... I also want to customize the other pickers now...

  • it doesn't respect the setting to pipe though glow

I only realize it now, I thought you were talking about the previewer. Yes, the picker would just open the file in the current implementation.

@luckasRanarison
Copy link
Owner

luckasRanarison commented Nov 28, 2023

We could get the last preview buffer using telescope.state but the main problem is making it work with glow. We don't have enough information so we'd have to pass the entire buffer to glow, and you know what'd would happen with large files... I also don't know how we can implement jumping in this case.
Any thoughts on this?

@emmanueltouzery
Copy link
Contributor Author

Yes I think if we can't cut up the file at least to a large degree it's not going to work out.
Otherwise of course we could use the telescope live_grep preview code to see how they focus a certain line, if they can do it presumably we can too, but yes, splitting is the issue.

Otherwise I didn't test what you did yet, but it's looking great!

@luckasRanarison
Copy link
Owner

Glow output doesn't necessarily match the original one so jumping to the specified line won't always work. But this feature is still great and I just learned about conceallevel, with it set to 3 previewing raw markdown in neovim with treesitter is almost good as using glow. I'm working on some fixes now and I'll set it to 3 by default.

luckasRanarison#60
it was reverted in the original repo with luckasRanarison@fea272d
but i still think this should be deleted and that fixes the close issue
open a picker, type text until there are no matches, close the picker
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants