-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Tab model API #133532
Comments
Sounds very promising and seems like a good fit for #95266, which was stalled for quite some time because of a missing API to detect if all editors for a specific resource URI have been closed. I will try to get #95266 running within a week and report my findings :) |
I mentioned this in #9498, but one thing that seems missing from the window api is a proper "positional" identifier. The currently available ViewColumn isn't enough since there's ambiguity wrt vertical / horizontal splits, let alone editor size (which I could live without since that's likely to be even more difficult). This request may be out of scope of this exact discussion since the original issue mainly wanted the list of tabs within an editor. But lots of the comments in the thread was about restoring editor states, which I think would require something like what I described, and does seem to fit in the "window" part of this api. |
@msftwindowslinux You are correct there is a gap with regards to the grid layout because we have always used |
Thanks for the note! Is there a similar |
No there is currently not, and no plans to add one at this time |
Might be a silly question, because I don't know much about the vscode internals but I'll ask anyways: And what are your thought on a "isPinned" and "isSaved" property for a tab? |
@Kaniee No worries always wiling to answer any questions. No plans to support customizable icons at this point in time. As for |
@lramos15 I don't have a specific use case in mind for 'isPinned' or 'isSaved'. It just crossed my mind. I'm sure you have good reasons to not support customizable icons but would you mind sharing those? |
It's just not on the radar at the moment since there's always additional complexity involved with serving user provided content in a secure manner. There are discussions around allowing the coloring of tabs, but that's in the early stages of development. This API is very powerful so we want to make careful decisions to provide a clean interface focused on enabling the most commonly asked for use cases |
I'd also be interested in getting the Generally speaking I am very happy with the proposed |
Interesting use case. Close currently prompts the user if they'd like to save their work so your use case would still work currently, but I understand not wanting to disrupt the user and have a prompt randomly appear |
I am wondering whether this API would actually be enough to support the case from #136162 which feels like a fairly common/userful use case? In my specific case, I would like to open files in a specific editor (and/or column), based on some properties of the file (whether extension, or metadata I have associated to it). I am not sure this can be achieved with the currently proposed API, am I missing something? |
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
The type of
|
That's unfortunate but looks like TypeScript issue to me. We need the |
Thank you for your explanation. I see that, with the type |
\closedWith aa69f3d |
🎸 |
To verify: |
👯♂️ |
There are many cases where the user wants to be able to either get the state of opened editors / tabs or modify it. This has been conveyed in multiple issues such as #15178. This issue will serve to track the proposal and API development for an API which allows the reading and modification of the tabs.
The current proposal is:
vscode/src/vs/vscode.proposed.d.ts
Lines 2224 to 2317 in a0446e9
The text was updated successfully, but these errors were encountered: