Open Bug 1567203 Opened 5 years ago Updated 2 years ago

Search in this directory

Categories

(DevTools :: Debugger, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: jlast, Unassigned)

References

(Blocks 1 open bug)

Details

Users should be able to right click on a directory in the sources tree and select search in this directory.

Priority: -- → P3

Did you envision this for "Find in Files" or "Quick search"?

Find in files . basically project search with a pth

This could be a nice feature to have for searching the browser toolbox.

Here is a rough UI, which is heavily inspired from editors like atom/sublime.
https://www.figma.com/file/iHGysqN3Scics2cOrK9leX/project-search?node-id=0%3A1

diff --git a/devtools/client/debugger/src/actions/project-text-search.js b/devtools/client/debugger/src/actions/project-text-search.js
index f048434eafdd..fd7d9bfb6708 100644
--- a/devtools/client/debugger/src/actions/project-text-search.js
+++ b/devtools/client/debugger/src/actions/project-text-search.js
@@ -84,7 +84,7 @@ export function stopOngoingSearch(cx: Context) {
   };
 }

-export function searchSources(cx: Context, query: string) {
+export function searchSources(cx: Context, query: string, path: string) {
   let cancelled = false;

   const search = async ({ dispatch, getState }: ThunkArgs) => {
@@ -94,7 +94,10 @@ export function searchSources(cx: Context, query: string) {
     await dispatch(addSearchQuery(cx, query));
     dispatch(updateSearchStatus(cx, statusType.fetching));
     const validSources = getSourceList(getState()).filter(
-      source => !hasPrettySource(getState(), source.id) && !isThirdParty(source)
+      source =>
+        !hasPrettySource(getState(), source.id) &&
+        !isThirdParty(source) &&
+        source.url.startsWith(path)
     );
     for (const source of validSources) {
       if (cancelled) {

I would like to work on this one :-)

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.