joyride

2024-03-01T19:54:48.739009Z

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?

Max 2024-03-09T07:00:32.235219Z

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

2024-03-09T17:26:59.304919Z

Hi @max.r.rothman, after that, how shall I open the tab?

Max 2024-03-09T17:32:22.137669Z

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

1
pez 2024-03-01T20:18:25.077889Z

Is there an editor or document property on the tab?

2024-03-01T21:13:08.324459Z

tab.document and tab.editor gives undefined.