In VSCode there is an event when the active text editor has been changed: onDidChangeActiveTextEditor
, it doesn't fire when a file that isn't a text file is opened (for example an image). I searched the VSCode API, and googled it, but didn't find anything.
Although the onDidChangeActiveTextEditor
event does fire when a text file is selected and then you select an image file, it doesn't fire when you have an image file selected and you select another image file.
So my question is is there an event that will fire when any file is selected in the explorer, or am I overlooking something with onDidChangeActiveTextEditor
?
EDIT: Looks like there is an open issue for this: https://github.com/Microsoft/vscode/issues/15178
To make it clear this question has been answered, I'm using the OP's edited question information to make a proper answer:
- There is currently (VSCode 1.37.1) no such event to listen for changes to active non-text editors.
- There is an open VSCode issue, 15178, that ostensibly tracks this request.
- However, in my opinion, 14483 is really the right issue, and closing it as a duplicate was a mistake. (15178 is about enumerating open editors, while only 14483 specifically addresses notification events.)
来源:https://stackoverflow.com/questions/54062785/vscode-event-that-fires-when-a-non-text-file-has-been-opened-selected