Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -52,7 +52,7 @@ export interface IFileService {
/**
* Tries to activate a provider with the given scheme.
*/
activateProvider(scheme: string): Thenable<void>;
activateProvider(scheme: string): Promise<void>;
/**
* Checks if this file service can handle the given resource.
@@ -70,51 +70,51 @@ export interface IFileService {
* the stat service is asked to automatically resolve child folders that only
* contain a single element.
*/
resolveFile(resource: URI, options?: IResolveFileOptions): Thenable<IFileStat>;
resolveFile(resource: URI, options?: IResolveFileOptions): Promise<IFileStat>;
/**
* Same as resolveFile but supports resolving multiple resources in parallel.
* If one of the resolve targets fails to resolve returns a fake IFileStat instead of making the whole call fail.
*/
resolveFiles(toResolve: { resource: URI, options?: IResolveFileOptions }[]): Thenable<IResolveFileResult[]>;
resolveFiles(toResolve: { resource: URI, options?: IResolveFileOptions }[]): Promise<IResolveFileResult[]>;
/**
* Finds out if a file identified by the resource exists.
*/
existsFile(resource: URI): Thenable<boolean>;
existsFile(resource: URI): Promise<boolean>;
/**
* Resolve the contents of a file identified by the resource.
*
* The returned object contains properties of the file and the full value as string.
*/
resolveContent(resource: URI, options?: IResolveContentOptions): Thenable<IContent>;
resolveContent(resource: URI, options?: IResolveContentOptions): Promise<IContent>;
/**
* Resolve the contents of a file identified by the resource.
*
* The returned object contains properties of the file and the value as a readable stream.
*/
resolveStreamContent(resource: URI, options?: IResolveContentOptions): Thenable<IStreamContent>;
resolveStreamContent(resource: URI, options?: IResolveContentOptions): Promise<IStreamContent>;
/**
* Updates the content replacing its previous value.
*/
updateContent(resource: URI, value: string | ITextSnapshot, options?: IUpdateContentOptions): Thenable<IFileStat>;
updateContent(resource: URI, value: string | ITextSnapshot, options?: IUpdateContentOptions): Promise<IFileStat>;
/**
* Moves the file to a new path identified by the resource.
*
* The optional parameter overwrite can be set to replace an existing file at the location.
*/
moveFile(source: URI, target: URI, overwrite?: boolean): Thenable<IFileStat>;
moveFile(source: URI, target: URI, overwrite?: boolean): Promise<IFileStat>;
/**
* Copies the file to a path identified by the resource.
*
* The optional parameter overwrite can be set to replace an existing file at the location.
*/
copyFile(source: URI, target: URI, overwrite?: boolean): Thenable<IFileStat>;
copyFile(source: URI, target: URI, overwrite?: boolean): Promise<IFileStat>;
/**
* Creates a new file with the given path. The returned promise
@@ -122,26 +122,26 @@ export interface IFileService {
*
* The optional parameter content can be used as value to fill into the new file.
*/
createFile(resource: URI, content?: string, options?: ICreateFileOptions): Thenable<IFileStat>;
createFile(resource: URI, content?: string, options?: ICreateFileOptions): Promise<IFileStat>;
/**
* Reads a folder's content with the given path. The returned promise
* will have the list of children as a result.
*/
readFolder(resource: URI): Thenable<string[]>;
readFolder(resource: URI): Promise<string[]>;
/**
* Creates a new folder with the given path. The returned promise
* will have the stat model object as a result.
*/
createFolder(resource: URI): Thenable<IFileStat>;
createFolder(resource: URI): Promise<IFileStat>;
/**
* Deletes the provided file. The optional useTrash parameter allows to
* move the file to trash. The optional recursive parameter allows to delete
* non-empty folders recursively.
*/
del(resource: URI, options?: { useTrash?: boolean, recursive?: boolean }): Thenable<void>;
del(resource: URI, options?: { useTrash?: boolean, recursive?: boolean }): Promise<void>;
/**
* Allows to start a watcher that reports file change events on the provided resource.
@@ -168,6 +168,10 @@ export interface FileWriteOptions {
create: boolean;
}
export interface FileOpenOptions {
create: boolean;
}
export interface FileDeleteOptions {
recursive: boolean;
}
@@ -208,21 +212,21 @@ export interface IFileSystemProvider {
onDidChangeFile: Event<IFileChange[]>;
watch(resource: URI, opts: IWatchOptions): IDisposable;
stat(resource: URI): Thenable<IStat>;
mkdir(resource: URI): Thenable<void>;
readdir(resource: URI): Thenable<[string, FileType][]>;
delete(resource: URI, opts: FileDeleteOptions): Thenable<void>;
stat(resource: URI): Promise<IStat>;
mkdir(resource: URI): Promise<void>;
readdir(resource: URI): Promise<[string, FileType][]>;
delete(resource: URI, opts: FileDeleteOptions): Promise<void>;
rename(from: URI, to: URI, opts: FileOverwriteOptions): Thenable<void>;
copy?(from: URI, to: URI, opts: FileOverwriteOptions): Thenable<void>;
rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise<void>;
copy?(from: URI, to: URI, opts: FileOverwriteOptions): Promise<void>;
readFile?(resource: URI): Thenable<Uint8Array>;
writeFile?(resource: URI, content: Uint8Array, opts: FileWriteOptions): Thenable<void>;
readFile?(resource: URI): Promise<Uint8Array>;
writeFile?(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise<void>;
open?(resource: URI): Thenable<number>;
close?(fd: number): Thenable<void>;
read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Thenable<number>;
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Thenable<number>;
open?(resource: URI, opts: FileOpenOptions): Promise<number>;
close?(fd: number): Promise<void>;
read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
}
export interface IFileSystemProviderRegistrationEvent {

View File

@@ -45,12 +45,12 @@ suite('Files', () => {
assert.strictEqual(true, r1.gotDeleted());
});
function testIsEqual(testMethod: (pA: string, pB: string, ignoreCase: boolean) => boolean): void {
function testIsEqual(testMethod: (pA: string | null | undefined, pB: string, ignoreCase: boolean) => boolean): void {
// corner cases
assert(testMethod('', '', true));
assert(!testMethod(null, '', true));
assert(!testMethod(void 0, '', true));
assert(!testMethod(null!, '', true));
assert(!testMethod(undefined!, '', true));
// basics (string)
assert(testMethod('/', '/', true));