-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
API Access to "Open Editors" #15178
Comments
Also, just wanted to add that this is blocking our vscode Salesforce IDE extension (mavensmate) from reaching feature parity with Sublime and Atom (and thus increasing the risk of it being abandoned by users). Background: Salesforce requires that classes be compiled on their servers. In order to refactor multiple classes, you must send a single compilation request with all classes. Because compilation is slow, you typically only want to compile a subset of your project (IE only files related to a refactor). The way existing salesforce IDE's handle this, is by allowing users to compile all open tabs. |
@ChuckJonas I don't know if this is still blocking you, but I've used a hack here that might work for your depending on your use-case. You can see it in action in the Restore Editors extension. |
@eamodio ahhh very nice! Never would have thought to use the Still seems like sort of a ridiculous hack for something that should obviously be accessible in the API. |
@ChuckJonas totally agree, but it was the best I could figure out with the tools available ;) |
fyi @dbaeumer |
Cheers @eamodio, using your work around for something I'm working on too! Also noticed I had to copy the way you wait in between executing commands because sometimes the activeEditor wont be set yet? Is that a separate issue worth reporting do you think? |
@lukebatchelor getting an active editor of |
@eamodio, Im not getting undefined in these cases, but sometimes the same editor. I assumed that was why have the 500ms pauses in your code? |
@lukebatchelor sort of -- the timeout is because while the |
Oh okay. Thats different to what i was getting. I'll try again but i was executing closeActiveEditor then logging the active editors document uri and would sometimes be the same still, until i added the pause. Same with nexrEditor. Weird. |
This would be really nice to have! I am working on an extension that takes encrypted files and decrypts them. The problem is I need the encrypted file path so that I can decrypt the file. vscode doesn't let you access the file uri of a binary file because the active editor is undefined. Alternatively it would be cool to allow the user to choose what encoding to display binary files. I would think the default would be UTF-8. |
#11247 is about making the tab-model not only readable but also writeable, e.g. open a background-tab which we must consider when implementing this |
the lifecycle of a text document, which may map to a file, is unrelated to whether that document is opened in an editor, and closing an editor does not reliably close the document (it _currently_ does for documents opened with the `vscode.open` command, but apparently that's an implementation detail we cannot rely on) there is currently no event in vscode for when a file is opened in an editor this change ensures that our own commands notice when we're opening a blocked .envrc file, and documents the limitation related upstream issues: - microsoft/vscode#138924 - microsoft/vscode#114005 - microsoft/vscode#15178 - microsoft/vscode#133532
I would welcome this. The default open editors widget is not very convenient, this API could help to get a reliable extensions to replace it. |
Thank you for
with April 2022. As this feature request from November 2016 (issue no 15178) with 314 upvotes was done, is there now hope for #1012 (a feature request from December 2015 with 410 upvotes; not sure if the additional 10 hoorays, 35 hearts, 5 rockets and 11 eyes should be counted additional) to be re-inspected and at least get an up-to-date comment from the UX team? |
Is there a way to get a file uri or get to the TextEditor from a tab? |
For example, see https://code.visualstudio.com/api/references/vscode-api#TabInputText |
I have a use case where I would like to be able to get a list of all the open editors (basically exactly what is shown here).
I understand that Editors are disposed but I just need a list of filenames.
Something like:
workspace.openDocuments:Array<TextDocument>
or even justworkspace.openFiles:Array<string>
.Long term, it might be nice to have API access to operate on this list (EG: sort open editors pane by last opened, name, etc).
The text was updated successfully, but these errors were encountered: