question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’d like to be able to search for something, for example ipad and then in the files which contain that term, search for something else, for example terminal.

IE find files which contain ____ && ____.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:10
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
roblourenscommented, Jun 16, 2021

Could also be a good extension candidate using the (proposed) findTextInFiles API.

For your original case, it sounds like what I often use “files to include” for, when I want to search for the use of a term like ipad in some feature area like notebooks, I would use notebook or *Notebook* (note that it’s case sensitive)

0reactions
ArturoDentcommented, Jul 2, 2021

I made an extension which applies a workaround by copying the current search results, regex-ing for the filenames, getting their relative paths and then putting those paths into the 'files to include` filter. Find and Transform.

Specifically Using the Search Results files in another search.

Use from the context menu, Command Palette or a keybinding like:


{
  "key": "alt+shift+f", 
  "command": "runInSearchPanel",   
  "args": {
    "find": "Second",                            // plus all the other args from the findInFiles command 
    "replace": "Third",
    "filesToInclude": "${resultsFiles}",   // !!
    "triggerSearch": true                
  },
	"when": "hasSearchResult"      // I suggest this but it isn't mandatory
}

There are other ways to use the ${resultsFiles} variable as well. Such as in the find-and-transform.searchInResults command where it is automatically applied.

Using this keybinding:

  {
    "key": "alt+z",
    "command": "runInSearchPanel",
    "args": {
      "filesToInclude": "${resultsFiles}",
      "triggerSearch": true,
    }
  },

Demo:

searchWithoutSelection2

[Since the context menu item for this really belongs in the Search results context menu but that is not currently exposed to extensions, I am going to file an issue requesting it. See https://github.com/microsoft/vscode/issues/127896]

Read more comments on GitHub >

github_iconTop Results From Across the Web

Secondary Research: Definition, Methods & Examples
Secondary research, also known as desk research, is a research method that involves compiling existing data sourced from a variety of channels. This...
Read more >
Secondary Search Techniques | Firehouse
The mission of the secondary search is to locate any unaccounted-for victims. On completion of the secondary search, the worst possible scenario ...
Read more >
Secondary Research- Definition, Methods and Examples.
Secondary research or desk research is a research method that involves using already existing data. Existing data is summarized and collated to increase...
Read more >
Secondary research - Wikipedia
Secondary research involves the summary, collation and/or synthesis of existing research. Secondary research is contrasted with primary research in that ...
Read more >
Primary Research vs Secondary Research: Definitions ...
While primary research involves active participation from the researcher themselves, secondary research involves the summary or synthesis of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found