function searchInFile({ file, content, search }) {
	const matches = [];

	let text = `${file.name}`;
	let match;

	if (text.length > 30) {
		text = `...${text.slice(-30)}`;
	}

	while ((match = search.exec(content))) {
		const [word] = match;
		const start = match.index;
		const end = start + word.length;
		const position = {
			start: getLineColumn(content, start),
			end: getLineColumn(content, end),
		};
		const [line, renderText] = getSurrounding(content, word, start, end);
		text += `\n\t${line.trim()}`;
		matches.push({ match: word, position, renderText });
	}

	self.postMessage({
		action: "search-result",
		data: {
			file,
			matches,
			text,
		},
	});
}
Search for a string in the content of a file.
@param {object} arg - The content of the file to search.
@param {import('lib/fileList').Tree} arg.file - The file.
@param {string} arg.content - The file content.
@param {RegExp} arg.search - The string to search for.