Skip to content

Commit

Permalink
Update jsdoc for openTextDocument, #15723
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Mar 22, 2017
1 parent 8f6e350 commit 3755bb8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4054,15 +4054,18 @@ declare module 'vscode' {
export let textDocuments: TextDocument[];

/**
* Opens the denoted document from disk. Will return early if the
* document is already open, otherwise the document is loaded and the
* [open document](#workspace.onDidOpenTextDocument)-event fires.
* The document to open is denoted by the [uri](#Uri). Two schemes are supported:
*
* file: A file on disk, will be rejected if the file does not exist or cannot be loaded, e.g. `file:///Users/frodo/r.ini`.
* untitled: A new file that should be saved on disk, e.g. `untitled:c:\frodo\new.js`. The language will be derived from the file name.
*
* Uris with other schemes will make this method return a rejected promise.
* Opens a document. Will return early if this document is already open. Otherwise
* the document is loaded and the [didOpen](#workspace.onDidOpenTextDocument)-event fires.
*
* The document is denoted by an [uri](#Uri). Depending on the [scheme](#Uri.scheme) the
* following rules apply:
* * `file`-scheme: Open a file on disk, will be rejected if the file does not exist or cannot be loaded.
* * `untitled`-scheme: A new file that should be saved on disk, e.g. `untitled:c:\frodo\new.js`. The language
* will be derived from the file name.
* * For all other schemes the registered text document content [providers](#TextDocumentContentProvider) are consulted.
*
* *Note* that the lifecycle of the returned document is owned by the editor and not by the extension. That means an
* [`onDidClose`](#workspace.onDidCloseTextDocument)-event can occur at any time after opening it.
*
* @param uri Identifies the resource to open.
* @return A promise that resolves to a [document](#TextDocument).
Expand Down

0 comments on commit 3755bb8

Please sign in to comment.