@@ -1320,10 +1320,10 @@ declare module 'vscode' {
13201320 }
13211321
13221322 /**
1323- * Represents a custom document for a custom webview editor .
1323+ * Represents a custom document used by a `CustomEditorProvider` .
13241324 *
13251325 * Custom documents are only used within a given `CustomEditorProvider`. The lifecycle of a
1326- * `CustomDocument` is managed by VS Code. When more more references remain to a given `CustomDocument`
1326+ * `CustomDocument` is managed by VS Code. When no more references remain to a given `CustomDocument`,
13271327 * then it is disposed of.
13281328 *
13291329 * @param UserDataType Type of custom object that extensions can store on the document.
@@ -1366,6 +1366,11 @@ declare module 'vscode' {
13661366 /**
13671367 * Resolve the model for a given resource.
13681368 *
1369+ * `resolveCustomDocument` is called when the first editor for a given resource is opened, and the resolve document
1370+ * is passed to `resolveCustomEditor`. The resolved `CustomDocument` is re-used for subsequent editor opens.
1371+ * If all editors for a given resource are closed, the `CustomDocument` is disposed of. Opening an editor at
1372+ * this point will trigger another call to `resolveCustomDocument`.
1373+ *
13691374 * @param document Document to resolve.
13701375 *
13711376 * @return The capabilities of the resolved document.
@@ -1375,11 +1380,15 @@ declare module 'vscode' {
13751380 /**
13761381 * Resolve a webview editor for a given resource.
13771382 *
1383+ * This is called when a user first opens a resource for a `CustomTextEditorProvider`, or if they reopen an
1384+ * existing editor using this `CustomTextEditorProvider`.
1385+ *
13781386 * To resolve a webview editor, the provider must fill in its initial html content and hook up all
1379- * the event listeners it is interested it. The provider should also take ownership of the passed in `WebviewPanel`.
1387+ * the event listeners it is interested it. The provider can also hold onto the `WebviewPanel` to use later,
1388+ * for example in a command. See [`WebviewPanel`](#WebviewPanel) for additional details
13801389 *
13811390 * @param document Document for the resource being resolved.
1382- * @param webviewPanel Webview to resolve. The provider should take ownership of this webview.
1391+ * @param webviewPanel Webview to resolve.
13831392 *
13841393 * @return Thenable indicating that the webview editor has been resolved.
13851394 */
@@ -1398,13 +1407,17 @@ declare module 'vscode' {
13981407 */
13991408 export interface CustomTextEditorProvider {
14001409 /**
1401- * Resolve a webview editor for a given resource.
1410+ * Resolve a webview editor for a given text resource.
1411+ *
1412+ * This is called when a user first opens a resource for a `CustomTextEditorProvider`, or if they reopen an
1413+ * existing editor using this `CustomTextEditorProvider`.
14021414 *
14031415 * To resolve a webview editor, the provider must fill in its initial html content and hook up all
1404- * the event listeners it is interested it. The provider should also take ownership of the passed in `WebviewPanel`.
1416+ * the event listeners it is interested it. The provider can also hold onto the `WebviewPanel` to use later,
1417+ * for example in a command. See [`WebviewPanel`](#WebviewPanel) for additional details.
14051418 *
1406- * @param document Resource being resolved .
1407- * @param webviewPanel Webview to resolve. The provider should take ownership of this webview.
1419+ * @param document Document for the resource to resolve .
1420+ * @param webviewPanel Webview to resolve.
14081421 *
14091422 * @return Thenable indicating that the webview editor has been resolved.
14101423 */
0 commit comments