Skip to content

Commit

Permalink
no closeTextDocument
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Jan 8, 2016
1 parent b85b55c commit d625b55
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3021,11 +3021,6 @@ declare namespace vscode {
*/
export function openTextDocument(fileName: string): Thenable<TextDocument>;

/**
*
*/
export function closeTextDocument(document: TextDocument): Thenable<boolean>;

/**
*
*/
Expand Down
3 changes: 0 additions & 3 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ export class ExtHostAPIImplementation {
openTextDocument(uriOrFileName:vscode.Uri | string) {
return pluginHostDocuments.openDocument(uriOrFileName);
},
closeTextDocument(document: vscode.TextDocument) {
return pluginHostDocuments.closeDocument(document);
},
registerTextDocumentContentProvider(scheme: string, provider: vscode.TextDocumentContentProvider) {
return pluginHostDocuments.registerTextDocumentContentProvider(scheme, provider);
},
Expand Down
9 changes: 0 additions & 9 deletions src/vs/workbench/api/common/extHostDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ export class ExtHostModelService {
});
}

public closeDocument(document: vscode.TextDocument): TPromise<boolean> {
return this._proxy._tryCloseDocument(<URI> document.uri);
}

public registerTextDocumentContentProvider(scheme: string, provider: vscode.TextDocumentContentProvider): vscode.Disposable {
if (scheme === 'file' || scheme === 'untitled' || this._documentContentProviders[scheme]) {
throw new Error(`scheme '${scheme}' already registered`);
Expand Down Expand Up @@ -752,9 +748,4 @@ export class MainThreadDocuments {
return true;
});
}

_tryCloseDocument(uri: URI): TPromise<boolean> {
this._modelService.destroyModel(uri);
return TPromise.as(true);
}
}

3 comments on commit d625b55

@blackmiaool
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to close TextDocument then?

@jrieken
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't, the editor does that for you, e.g. when time passes or when an editor is closed.

@SURYASPR
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to show a text document only during debugging. I have opened it using "window.showTextDocument" while debugging but now how can I close this after terminating the debug session ?

Please sign in to comment.