-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
No API for closing inactive TextEditors #38239
Comments
For the API an inactive editor doesn't exist, only the combination of a document and editor widget is an API-editor. That's also why the Your use-case sounds similar to #10659 which is about adding a rename file to the
Yeah, that's not very nice... We should really offer a rename for this. @bpasero Is there anything today extensions can do to prevent this? |
@bpasero I noticed the "deleted" text behavior when implementing OmniSharp/omnisharp-roslyn#1023. In that PR, Omnisharp will delete files on disk if Roslyn CodeActions rename them. I had the default value for that option and still saw the text show up. Do you know if any bugs were fixed in this area lately? |
@jrieken Put differently: what API can I call to close a tab that is not the currently open tab? If there's no such API, consider this a request for it 😄 . |
Looking at the docs for TextEditor (https://code.visualstudio.com/docs/extensionAPI/vscode-api#TextEditor) the Hide method has been deprecated. Per the documentation, its replacement is
workbench.action.closeActiveEditor
, which only closes the currently visible TextEditor tab.There is (apparently) no supported way to close inactive TextEditors. Would it be possible to add such an API back?
(User scenario:
Omnisharp-Roslyn is adding support for CodeActions that rename files. When a file is renamed on disk, that's open in VS Code, Code keeps open the tab for the old file name but adds "Deleted" to the tab title. Omnisharp-Roslyn would like to close editor for renamed files. With the current APIs, there's no good way for us to close files that get renamed unless they are the active editor)
The text was updated successfully, but these errors were encountered: