提交 d2501cdb 编写于 作者: B Benjamin Pasero

polish API docs

上级 f963973e
...@@ -159,33 +159,37 @@ declare module 'vscode' { ...@@ -159,33 +159,37 @@ declare module 'vscode' {
export function registerFileSystemProvider(scheme: string, provider: FileSystemProvider): Disposable; export function registerFileSystemProvider(scheme: string, provider: FileSystemProvider): Disposable;
/** /**
* Updates the workspace folders of the currently opened workspace. This method allows to add and remove * Updates the workspace folders of the currently opened workspace. This method allows to add, remove
* workspace folders a the same time. * and change workspace folders a the same time.
* *
* Example: adding a new workspace folder at the end of workspace folders * **Example:** adding a new workspace folder at the end of workspace folders
* ```typescript * ```typescript
* workspace.updateWorkspaceFolders(workspace.workspaceFolders ? workspace.workspaceFolders.length : 0, null, [{ uri: ...}]) * workspace.updateWorkspaceFolders(workspace.workspaceFolders ? workspace.workspaceFolders.length : 0, null, [{ uri: ...}]);
* ``` * ```
* *
* Example: removing the first workspace folder * **Example:** removing the first workspace folder
* ```typescript * ```typescript
* workspace.updateWorkspaceFolders(0, 1) * workspace.updateWorkspaceFolders(0, 1);
* ``` * ```
* *
* Example: replacing an existing workspace folder with a new one * **Example:** replacing an existing workspace folder with a new one
* ```typescript * ```typescript
* workspace.updateWorkspaceFolders(0, 1, [{ uri: ...}]) * workspace.updateWorkspaceFolders(0, 1, [{ uri: ...}]);
* ``` * ```
* *
* Note: if the first workspace folder is removed or changed, all extensions will be restarted * It is valid to remove an existing workspace folder and add it again with a different name
* to rename that folder.
*
* Note: if the first workspace folder is added, removed or changed, all extensions will be restarted
* so that the (deprecated) `rootPath` property is updated to point to the first workspace * so that the (deprecated) `rootPath` property is updated to point to the first workspace
* folder. * folder.
* *
* @param index the zero-based index in the list of currently opened [workspace folders](#WorkspaceFolder) * @param index the zero-based index in the list of currently opened [workspace folders](#WorkspaceFolder)
* from where to delete workspace folders or from where to add to. * from where to delete workspace folders or from where to add to.
* @param deleteCount the optional number of workspace folders to delete from the index that is provided. * @param deleteCount the optional number of workspace folders to delete from the index that is provided.
* @param workspaceFoldersToAdd the optional number of workspace folders to add * @param workspaceFoldersToAdd the optional number of workspace folders to add at the index that is provided.
* @return A thenable that resolves when the workspace folder was removed successfully * @return A thenable that resolves when the workspace folder was removed successfully. The user might prevent
* the operation from happening and this will be indicated with the return type.
*/ */
export function updateWorkspaceFolders(index: number, deleteCount?: number, workspaceFoldersToAdd?: { uri: Uri, name?: string }[]): Thenable<boolean>; export function updateWorkspaceFolders(index: number, deleteCount?: number, workspaceFoldersToAdd?: { uri: Uri, name?: string }[]): Thenable<boolean>;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册