import type { Range } from 'brighterscript'; /** * Unifies access to source files across the whole project */ export declare class FileManager { private logger; /** * A map of file lines, indexed by file path * Store all paths in lower case since Roku is case-insensitive */ private cache; getCodeFile(filePath: string): CodeFile; private getFunctionInfo; /** * Given the text of a file, find all of the function names */ private getFunctionNameMap; /** * The stacktrace sent by Roku forces all BrightScript function names to lower case. * This function will scan the source file, and attempt to find the exact casing from the function definition. * Also, this function caches results, so it should be faster than the previous implementation * which read the source file from the file system on each call * @param sourceFilePath the path to the source file * @param rootDir the rootDir of the staged running program. This is used to assist the BrighterScript parser for certain file operations * @param functionName the name of the function to translate to the correct case */ getCorrectFunctionNameCase(sourceFilePath: string, functionName: string): string; /** * Find the function at the given position */ private getFunctionInfoAtPosition; /** * Anonymous functions have obscure names. In most cases, we can derive a slightly better name * from the source code. * @param sourceFilePath the path to the source file * @param lineIndex the zero-indexed line number from the debugger */ getFunctionNameAtPosition(sourceFilePath: string, lineIndex: number, functionName: string): string; } export interface CodeFile { lines: string[]; /** * Map of lower case function name to its actual case in the source file */ functionNameMap: Record; /** * An array of function information from this file */ functionInfo: FunctionInfo[]; } interface FunctionInfo { name: string; children: FunctionInfo[]; range: Range; } export {};