Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can editors be closed by an extension? #21617

Closed
Gruntfuggly opened this issue Mar 1, 2017 · 1 comment
Closed

Can editors be closed by an extension? #21617

Gruntfuggly opened this issue Mar 1, 2017 · 1 comment
Assignees
Labels
api *duplicate Issue identified as a duplicate of another issue(s)

Comments

@Gruntfuggly
Copy link

I would really like a feature to close any editors which are not modified in git. I would be happy to implement this as an extension, but I can't find anything in the API or in any examples that show how to close an open editor. Is this even possible?

@jrieken
Copy link
Member

jrieken commented Mar 1, 2017

well, we do have a deprecated TextEditor#hide method. It is deprecated because the editor will likely be disposed after hiding it and subsequent interactions will fail (like show et al). The current recommended workaround, which stinks, is to execute the 'workbench.action.closeActiveEditor' command.

Also, what you what seems to be a model of the 'tabs'. For the API an editor always one which is active and visible in the UI. Editors that are not showing and reveal only when selecting their tab don't really exist because it's always the same editor to which we set different documents. In the API tho, an editor is the combination of an text editor widget and a document.

I am closing this as a duplicate of #15178 which is about exposing our tab-model.

@jrieken jrieken closed this as completed Mar 1, 2017
@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Mar 1, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants