All files / services/core workspace-file-service.interface.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74                                                                                                                                                   
import * as vscode from 'vscode';
 
/**
 * Event arguments for workspace file changes.
 */
export interface WorkspaceFileChangeEvent {
	/**
	 * The type of file change.
	 */
	type: vscode.FileChangeType;
 
	/**
	 * The URI of the affected file or folder.
	 */
	uri: vscode.Uri;
}
 
/**
 * Interface for the WorkspaceFileService which provides file discovery,
 * watching, and navigation functionality for the workspace.
 */
export interface IWorkspaceFileService {
	/**
	 * Get all discovered files in the workspace matching the supported extensions.
	 */
	readonly files: ReadonlyArray<vscode.Uri>;
 
	/**
	 * Indicates if the workspace files have been discovered.
	 */
	readonly initialized: boolean;
 
	/**
	 * An event that is fired when file discovery has completed.
	 */
	readonly onDidFinishDiscovery: vscode.Event<void>;
 
	/**
	 * An event that is fired when workspace file contents change (create/delete).
	 */
	readonly onDidChangeFiles: vscode.Event<WorkspaceFileChangeEvent>;
 
	/**
	 * Discovers all supported files in the workspace.
	 * @returns A promise that resolves when discovery is complete.
	 */
	discoverFiles(): Promise<void>;
 
	/**
	 * Wait for file discovery to complete.
	 * @returns A promise that resolves when discovery has finished.
	 */
	waitForDiscovery(): Promise<void>;
 
	/**
	 * Generator that yields files matching the given language ID's extensions.
	 * @param languageId The VS Code language identifier (e.g., 'turtle', 'sparql')
	 * @returns Generator yielding matching files one by one.
	 */
	getFilesByLanguageId(languageId: string): AsyncGenerator<vscode.Uri, void, unknown>;
 
	/**
	 * Retrieves the contents of a folder in the workspace.
	 * @param folderUri The URI of the folder to search in.
	 * @returns A list of matching files and folders sorted by type and name.
	 */
	getFolderContents(folderUri: vscode.Uri): Promise<vscode.Uri[]>;
 
	/**
	 * Disposes of resources held by this service.
	 */
	dispose(): void;
}