Fork me on GitHub
#joyride
<
2024-03-01
>
pinkfrog19:03:48

Maybe offtopic here. I want to move focus to a tab matching a name. I can done the finding the tab part, e.g.,

for (const tabGroup of vscode.window.tabGroups.all) {
    for (const tab of tabGroup.tabs) {find the right tab}
But after locating the tab, how can I activate that tab?

pez20:03:25

Is there an editor or document property on the tab?

pinkfrog21:03:08

tab.document and tab.editor gives undefined.

Max07:03:32

It looks like this info is on the tab’s input property, at least according to the docs: https://code.visualstudio.com/api/references/vscode-api#Tab

pinkfrog17:03:59

Hi @U01EB0V3H39, after that, how shall I open the tab?

Max17:03:22

I don’t know what type that property is, it’s marked as unknown in the docs and looks like it varies based on the tab contents (not all tabs have editors, like webviews for example). If I were you I would probably try out and see what’s in there, I’ll bet there’s an editor you can focus in there somewhere

thanks3 1