This is the read-only interface for the files context, which is used to manage all files known to the FlowrAnalyzer. It prevents you from modifying the available files, but allows you to inspect them (which is probably what you want when using the FlowrAnalyzer). If you are a FlowrAnalyzerProjectDiscoveryPlugin and want to modify the available files, you can use the FlowrAnalyzerFilesContext directly.

interface ReadOnlyFlowrAnalyzerFilesContext {
    consideredFilesList(): readonly string[];
    exists(path: string, ignoreCase: boolean): undefined | string;
    getFilesByRole<Role extends FileRole>(role: Role): RoleBasedFiles[Role];
    hasFile(path: string): boolean;
    loadingOrder: ReadOnlyFlowrAnalyzerLoadingOrderContext;
    name: string;
    resolveRequest(
        r: RParseRequest,
    ): { path?: string; r: RParseRequestFromText };
}

Implemented by

Properties

The loading order context provides access to the loading order of script files in the project.

name: string

The name of this context.

Methods

  • Check if a file exists at the given path, optionally ignoring case.

    Parameters

    • path: string

      The path to the file.

    • ignoreCase: boolean

      Whether to ignore case when checking for the file.

      Please note that this method checks the file system based on the configuration (see FlowrConfigOptions.project.resolveUnknownPathsOnDisk).

    Returns undefined | string

    The actual path of the file if it exists, otherwise undefined.

  • Check if the context has a file with the given path. Please note, that this may also check the file system, depending on the configuration (see FlowrConfigOptions.project.resolveUnknownPathsOnDisk).

    Parameters

    • path: string

      The path to the file.

      If you do not know the exact path or, e.g., casing of the file, use exists instead.

    Returns boolean