unison icon indicating copy to clipboard operation
unison copied to clipboard

Edit fzf to ignore lib

Open ChrisPenner opened this issue 1 year ago • 1 comments

Overview

Opening this as an experiment to try out;

I noticed when using fzf with edit that it includes stuff from lib, which was making it harder to find what I wanted to edit. I realized I never want to edit things from in lib, so this build removes lib from commands like edit and delete, but leaves it on for things like view where you're more likely to be delving into lib defns.

You can still explicitly type out an edit for any defn you like.

Implementation notes

Adds a param to argument resolvers for whether to include lib in the FZF.

Test coverage

Updated the fzf transcripts

ChrisPenner avatar May 17 '24 18:05 ChrisPenner

I'll confess that I occasionally (ab)use edit to load a lib definition into my scratch file intentionally. Sometimes it's because large definitions are easier to inspect in my editor than in less. And sometimes it's because I want to copy parts of it or write a new version that I plan to later submit upstream.

ceedubs avatar May 17 '24 18:05 ceedubs

Based on the conflicting comments above, I'm not sure whether to merge this or not. Are folks wanting to try it out first?

aryairani avatar May 20 '24 14:05 aryairani

It's an experiment, we can try some other things too; like maybe adjusting the fzf integration to deprioritize lib results to the bottom of the list.

ChrisPenner avatar May 20 '24 19:05 ChrisPenner

adjusting the fzf integration to deprioritize lib results to the bottom of the list

At face value that sounds nice. But I guess that I don't know how it is in practice. Like if I search for List.map does myapp.fibonacci show up before lib.base.dataList.map because it has a couple of the same characters and isn't in lib? :sweat_smile:

It's also possible that removing lib from edit results is just fine. I don't commit the aforementioned sin often.

ceedubs avatar May 20 '24 19:05 ceedubs

I managed to update it to trunk once before a merge conflict appeared. :) :(

aryairani avatar May 20 '24 21:05 aryairani

Well, we can always just merge it to try it; or we could get something set up to make it easier to toggle this sort of setting from inside or outside of ucm. i.e. add a set/settings command to ucm

aryairani avatar May 20 '24 21:05 aryairani

This doesn't seem to be a slam dunk, so closing for now :)

ChrisPenner avatar Jun 11 '24 22:06 ChrisPenner