blakjakau / dev.jakbox.code

Simple, fast, lightweight code editing. Edit your local code files straight from your web browser, or install the web app for that sweet "native app" experience.
https://code.jakbox.dev
Other
2 stars 1 forks source link

Suggested Enhancement: Find in Files #3

Open Wrongtown opened 3 years ago

Wrongtown commented 3 years ago

See Ctrl+Shift+F in Sublime Text. I'm sure this is non-trivial but damn it's useful.

blakjakau commented 2 years ago

@Wrongtown is this conceptually an index across all appropriate files in all workspace folders?

Wrongtown commented 2 years ago

Sorry mate, completely missed this question.

That's correct, for example the attached screenshot is a search for the string password in any .txt or .csv files (but explicitly not in any .xlsx files) contained within three specific subfolders of C:\git.

2022-01-17_185343

blakjakau commented 2 years ago

@Wrongtown I don't have sublime text easily to hand on any of my dev machines ATM. what is the output of this function? does it provide a list of all files with the text? does it open buffers for all files with the text?

Given the ideal to keep Code as light as possible, I'm hesitent to explore options of pre-indexing file contents at all, but I'm not sure if the per-use time cost of doing the find operation live (without access to CLI grep, etc) would make the feature fast enough to be worthwhile.

blakjakau commented 2 years ago

@Wrongtown, I'm working towards finding text in all files that are supported by the editor (skipping binaries, archives etc) with a configurable include/exclude filter on the omnibox, and with results being rendered progressively as the find function does it's thing.

A little unsure about the output of the find results, currently just listing the files (per the goto-file results), but might be more useful to include a snippet of text? Maybe the file path, and the first hit in the file, with ~50 character either side of the match?

I tend to work on SSHFS mounted filesystems, so performing the lookup can be pretty slow on big or even modestly sized project folders.

blakjakau commented 2 years ago

Hey @Wrongtown I've created a branch for this feature. It's sort of working, the performance isn't bad on a local file system , though kind of apalling on remote... there's a hacked together "include/exclude" filter and it only looks in supported files to begin with. It's very much a rough approximation UI-wise at this point, but do you wanna check out the branch and take a look?

Wrongtown commented 2 years ago

Sorry @blakjakau I totally spaced on these, currently the number of new github repos spinning up for my day job resembles a girthy firehose so I reckon I missed them in the mix 😅

Happy to do so, may have questions as to how to execute locally.