eclipse-theia/theia

Support `CustomEditorInput` and correct `viewColumn` in Tabs API (`vscode.window.tabGroups`)

Open

#17,793 opened on Jul 17, 2026

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (2,478 forks)batch import
custom-editorenhancementhelp wantedvscode

Repository metrics

Stars
 (18,676 stars)
PR merge metrics
 (Avg merge 15d 4h) (75 merged PRs in 30d)

Description

Feature Description:

The TabsMainImpl implementation of the VS Code Tabs API (packages/plugin-ext/src/main/browser/tabs/tabs-main.ts) currently has two gaps compared to the upstream VS Code API:

  1. viewColumn is hard-coded to 0. createTabGroupDto() always returns viewColumn: 0 for every tab group, regardless of which editor column/tab bar it belongs to. This breaks any extension that relies on tabGroup.viewColumn to distinguish between multiple open editor groups (e.g. split editors).

  2. Custom editors are reported as UnknownInput. evaluateTabDtoInput() does not recognize CustomEditorWidget (used for webview-based custom editors registered via vscode.window.registerCustomEditorProvider). As a result, vscode.Tab.input for such tabs resolves to undefined instead of a TabInputCustom instance, making it impossible for extensions to identify custom editor tabs through the Tabs API.

Proposed change

  • Compute viewColumn from the position of the tab's TabBar within applicationShell.mainAreaTabBars instead of hard-coding 0.
  • In evaluateTabDtoInput(), add a branch that detects widget instanceof CustomEditorWidget and returns a TabInputKind.CustomEditorInput DTO with the widget's viewType and resource URI, mirroring how TextInput, NotebookInput, and other kinds are already handled.

Additional context

This aligns Theia's Tabs API implementation more closely with VS Code's behavior, where Tab.input for a custom editor tab is a TabInputCustom object exposing viewType and uri, and TabGroup.viewColumn reflects the actual editor column.

I'd be happy to contribute a PR.

Contributor guide