Skip to content

Remove dead code from archive filesystem provider #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions extensions/ql-vscode/src/archive-filesystem-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,6 @@ export class ArchiveFileSystemProvider implements vscode.FileSystemProvider {
throw vscode.FileSystemError.FileNotFound(uri);
}

private async _lookupAsDirectory(uri: vscode.Uri, silent: boolean): Promise<Directory> {
let entry = await this._lookup(uri, silent);
if (entry instanceof Directory) {
return entry;
}
throw vscode.FileSystemError.FileNotADirectory(uri);
}

private async _lookupAsFile(uri: vscode.Uri, silent: boolean): Promise<File> {
let entry = await this._lookup(uri, silent);
if (entry instanceof File) {
Expand All @@ -254,36 +246,16 @@ export class ArchiveFileSystemProvider implements vscode.FileSystemProvider {
throw vscode.FileSystemError.FileIsADirectory(uri);
}

private _lookupParentDirectory(uri: vscode.Uri): Promise<Directory> {
const dirname = uri.with({ path: path.dirname(uri.path) });
return this._lookupAsDirectory(dirname, false);
}

// file events

private _emitter = new vscode.EventEmitter<vscode.FileChangeEvent[]>();
private _bufferedEvents: vscode.FileChangeEvent[] = [];
private _fireSoonHandle?: NodeJS.Timer;

readonly onDidChangeFile: vscode.Event<vscode.FileChangeEvent[]> = this._emitter.event;

watch(_resource: vscode.Uri): vscode.Disposable {
// ignore, fires for all changes...
return new vscode.Disposable(() => { });
}

private _fireSoon(...events: vscode.FileChangeEvent[]): void {
this._bufferedEvents.push(...events);

if (this._fireSoonHandle) {
clearTimeout(this._fireSoonHandle);
}

this._fireSoonHandle = setTimeout(() => {
this._emitter.fire(this._bufferedEvents);
this._bufferedEvents.length = 0;
}, 5);
}
}

/**
Expand Down