mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 (#7404)
* Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 * readd svgs
This commit is contained in:
@@ -209,7 +209,7 @@ export interface IFileSystemProvider {
|
||||
|
||||
readonly onDidErrorOccur?: Event<string>; // TODO@ben remove once file watchers are solid
|
||||
|
||||
readonly onDidChangeFile: Event<IFileChange[]>;
|
||||
readonly onDidChangeFile: Event<readonly IFileChange[]>;
|
||||
watch(resource: URI, opts: IWatchOptions): IDisposable;
|
||||
|
||||
stat(resource: URI): Promise<IStat>;
|
||||
@@ -389,19 +389,19 @@ export interface IFileChange {
|
||||
/**
|
||||
* The type of change that occurred to the file.
|
||||
*/
|
||||
type: FileChangeType;
|
||||
readonly type: FileChangeType;
|
||||
|
||||
/**
|
||||
* The unified resource identifier of the file that changed.
|
||||
*/
|
||||
resource: URI;
|
||||
readonly resource: URI;
|
||||
}
|
||||
|
||||
export class FileChangesEvent {
|
||||
|
||||
private _changes: IFileChange[];
|
||||
private readonly _changes: readonly IFileChange[];
|
||||
|
||||
constructor(changes: IFileChange[]) {
|
||||
constructor(changes: readonly IFileChange[]) {
|
||||
this._changes = changes;
|
||||
}
|
||||
|
||||
|
||||
@@ -449,8 +449,8 @@ export class DiskFileSystemProvider extends Disposable implements IFileSystemPro
|
||||
private _onDidWatchErrorOccur: Emitter<string> = this._register(new Emitter<string>());
|
||||
readonly onDidErrorOccur: Event<string> = this._onDidWatchErrorOccur.event;
|
||||
|
||||
private _onDidChangeFile: Emitter<IFileChange[]> = this._register(new Emitter<IFileChange[]>());
|
||||
get onDidChangeFile(): Event<IFileChange[]> { return this._onDidChangeFile.event; }
|
||||
private _onDidChangeFile = this._register(new Emitter<readonly IFileChange[]>());
|
||||
get onDidChangeFile(): Event<readonly IFileChange[]> { return this._onDidChangeFile.event; }
|
||||
|
||||
private recursiveWatcher: WindowsWatcherService | UnixWatcherService | NsfwWatcherService | undefined;
|
||||
private recursiveFoldersToWatch: { path: string, excludes: string[] }[] = [];
|
||||
|
||||
@@ -13,7 +13,7 @@ export class NullFileSystemProvider implements IFileSystemProvider {
|
||||
capabilities: FileSystemProviderCapabilities = FileSystemProviderCapabilities.Readonly;
|
||||
|
||||
onDidChangeCapabilities: Event<void> = Event.None;
|
||||
onDidChangeFile: Event<IFileChange[]> = Event.None;
|
||||
onDidChangeFile: Event<readonly IFileChange[]> = Event.None;
|
||||
|
||||
constructor(private disposableFactory: () => IDisposable = () => Disposable.None) { }
|
||||
|
||||
@@ -30,4 +30,4 @@ export class NullFileSystemProvider implements IFileSystemProvider {
|
||||
close?(fd: number): Promise<void> { return Promise.resolve(undefined!); }
|
||||
read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number> { return Promise.resolve(undefined!); }
|
||||
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number> { return Promise.resolve(undefined!); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1918,7 +1918,7 @@ suite('Disk File Service', function () {
|
||||
});
|
||||
}
|
||||
|
||||
function hasChange(changes: IFileChange[], type: FileChangeType, resource: URI): boolean {
|
||||
function hasChange(changes: readonly IFileChange[], type: FileChangeType, resource: URI): boolean {
|
||||
return changes.some(change => change.type === type && isEqual(change.resource, resource));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user