mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
add NoPermissions-error, more jsdoc, #48527
This commit is contained in:
19
src/vs/vscode.d.ts
vendored
19
src/vs/vscode.d.ts
vendored
@@ -4854,17 +4854,14 @@ declare module 'vscode' {
|
||||
* to a file.
|
||||
*/
|
||||
type: FileType;
|
||||
|
||||
/**
|
||||
* The creation timestamp in milliseconds.
|
||||
* The creation timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.
|
||||
*/
|
||||
ctime: number;
|
||||
|
||||
/**
|
||||
* The modification timestamp in milliseconds.
|
||||
* The modification timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.
|
||||
*/
|
||||
mtime: number;
|
||||
|
||||
/**
|
||||
* The size in bytes.
|
||||
*/
|
||||
@@ -4904,6 +4901,12 @@ declare module 'vscode' {
|
||||
*/
|
||||
static FileIsADirectory(messageOrUri?: string | Uri): FileSystemError;
|
||||
|
||||
/**
|
||||
* Create an error to signal that an operation lacks required permissions.
|
||||
* @param messageOrUri Message or uri.
|
||||
*/
|
||||
static NoPermissions(messageOrUri?: string | Uri): FileSystemError;
|
||||
|
||||
/**
|
||||
* Creates a new filesystem error.
|
||||
*
|
||||
@@ -5043,6 +5046,7 @@ declare module 'vscode' {
|
||||
* @param options Defines if existing files should be overwriten.
|
||||
* @returns Metadata about the renamed file or a thenable that resolves to such.
|
||||
* @throws [`FileNotFound`](#FileSystemError.FileNotFound) when `oldUri` doesn't exist.
|
||||
* @throws [`FileNotFound`](#FileSystemError.FileNotFound) when parent of `newUri` doesn't exist
|
||||
* @throws [`FileExists`](#FileSystemError.FileExists) when `newUri` exists and when the `overwrite` option is not `true`.
|
||||
*/
|
||||
rename(oldUri: Uri, newUri: Uri, options: { overwrite: boolean }): FileStat | Thenable<FileStat>;
|
||||
@@ -5055,8 +5059,9 @@ declare module 'vscode' {
|
||||
* @param destination The destination location.
|
||||
* @param options Defines if existing files should be overwriten.
|
||||
* @returns Metadata about the copied file or a thenable that resolves to such.
|
||||
* @throws [`FileNotFound`](FileSystemError.FileNotFound) when `source` doesn't exist
|
||||
* @throws [`FileExists`](FileSystemError.FileExists) when `destination` exists and when the `overwrite` option is not `true`.
|
||||
* @throws [`FileNotFound`](#FileSystemError.FileNotFound) when `source` doesn't exist
|
||||
* @throws [`FileNotFound`](#FileSystemError.FileNotFound) when parent of `destination` doesn't exist
|
||||
* @throws [`FileExists`](#FileSystemError.FileExists) when `destination` exists and when the `overwrite` option is not `true`.
|
||||
*/
|
||||
copy?(source: Uri, destination: Uri, options: { overwrite: boolean }): FileStat | Thenable<FileStat>;
|
||||
}
|
||||
|
||||
@@ -1878,6 +1878,9 @@ export class FileSystemError extends Error {
|
||||
static FileIsADirectory(messageOrUri?: string | URI): FileSystemError {
|
||||
return new FileSystemError(messageOrUri, 'EntryIsADirectory', FileSystemError.FileIsADirectory);
|
||||
}
|
||||
static NoPermissions(messageOrUri?: string | URI): FileSystemError {
|
||||
return new FileSystemError(messageOrUri, 'NoPermissions', FileSystemError.NoPermissions);
|
||||
}
|
||||
|
||||
constructor(uriOrMessage?: string | URI, code?: string, terminator?: Function) {
|
||||
super(URI.isUri(uriOrMessage) ? uriOrMessage.toString(true) : uriOrMessage);
|
||||
|
||||
@@ -240,7 +240,12 @@ export class RemoteFileService extends FileService {
|
||||
case 'EntryIsADirectory':
|
||||
res = FileOperationResult.FILE_IS_DIRECTORY;
|
||||
break;
|
||||
case 'NoPermissions':
|
||||
res = FileOperationResult.FILE_PERMISSION_DENIED;
|
||||
break;
|
||||
case 'EntryExists':
|
||||
res = FileOperationResult.FILE_MOVE_CONFLICT;
|
||||
break;
|
||||
case 'EntryNotADirectory':
|
||||
default:
|
||||
// todo
|
||||
|
||||
Reference in New Issue
Block a user