Overview
I'll like to recursively search for a string in a selected source file. So the selected file will be searched, and all files imported into selected files, and files imported into those files, and so on.
I'm using Sublime Text 3 so answers geared towards that would be ideal, but any answers on how to achieve this in other editors will be greatly appreciated as well.
Goal/ What I want to do
In code below is from a Footer.jsx file. I'll like to find any occurrences of the string "container" in Footer.jsx, but also in the files imported into Footer.jsx, and the files imported into those imported files and so on.
Ideally if it's possible to specify to only recursively search for files in a particular folder (ie. the source folder & not React libraries) that would be ideal. So in instance below, of the imported files, only footerStyle.jsx &
GridContainer.jsx would be searched in the Footer.jsx file. Both files are relative to the "src" directory, which is defined in the .env file using NODE_PATH=./src
What can presently be done & why its insufficient
At present, I can search a single file (Ctrl+F), multiple files or all files (Ctrl+Shift+F), but not a single file and all files imported/included into that file recursively.
I could manually add the imported files in Footer.jsx to the list of files to be searched, but this would require me to manually recursively traverse the imported files, & files imported in those files,etc to a sufficient depth and add all of those files to the search list. This of course can become very labour intensive. I'll just like to know if there are any existing tools to do this.
/* eslint-disable */
import React from "react";
// nodejs library to set properties for components
import PropTypes from "prop-types";
// nodejs library that concatenates classes
import classNames from "classnames";
// @material-ui/core components
import withStyles from "@material-ui/core/styles/withStyles";
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
// @material-ui/icons
import Favorite from "@material-ui/icons/Favorite";
import footerStyle from "assets/jss/material-kit-pro-react/components/footerStyle.jsx";
import GridContainer from "components/Grid/GridContainer.jsx";
function Footer(props) {
const { children, content, classes, theme, big, className } = props;
const themeType =
theme === "transparent" || theme == undefined ? false : true;
const footerClasses = classNames({
[classes.footer]: true,
[classes[theme]]: themeType,
[classes.big]: big || children !== undefined,
[className]: className !== undefined
});
const aClasses = classNames({
[classes.a]: true
});
return (
<footer className={footerClasses}>
<div className={classes.container}>
{children !== undefined ? (
<div>
<div className={classes.content}>{children}</div>
<hr />
</div>
) : (
" "
)}
{content}
<div className={classes.clearFix} />
</div>
</footer>
);
}
Footer.propTypes = {
classes: PropTypes.object.isRequired,
theme: PropTypes.oneOf(["dark", "white", "transparent"]),
big: PropTypes.bool,
content: PropTypes.node.isRequired
};
export default withStyles(footerStyle)(Footer);




