Skip to content

debug window is unexpectedly considered a "text editor" #45188

@DanTup

Description

@DanTup

There are some events and properties related to text editors:

  • window.activeTextEditor
  • window.onDidChangeActiveTextEditor

These sound perfect for something I'm doing - rendering an explorer tree with an outline of the current document. The docs describe the active editor as "The active editor is the one that currently has focus or, when none has focus, the one that has changed input most recently".

However, they fire for things I wouldn't consider "text editors". When I click the debug window the event fires and the activeTextEditor is updated to something with a document that has the URI debug:input.

This makes it difficult to track the last actual document the user interacted with (which is what the description of window.activeTextEditor suggests it does). While we could skip over changes from non-documents it then would be difficult to track when the last document we're tracking was closed (since it could be closed without firing another window.activeTextEditor.

I don't know if this is a bug, but if it's not, I think there shoud be a way to track what the user would consider a text document.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions