Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add events to extension API to capture editor opened / editor closed #59159

Closed
Divni opened this issue Sep 22, 2018 · 4 comments
Closed

Add events to extension API to capture editor opened / editor closed #59159

Divni opened this issue Sep 22, 2018 · 4 comments
Assignees
Labels

Comments

@Divni
Copy link

@Divni Divni commented Sep 22, 2018

At the moment there is no proper way of capturing that the user opened or closed a tab. You can capture whether they switched between tabs, and you can capture opens/closes of text documents, but not editors.

Note that the text document events aren't helpful here because they trigger any time you switch between files.

As a workaround I've noticed that when switching tabs the onDidChangeActiveTextEditor event is called before onDidCloseTextDocument. When closing a tab it's the inverse. You can use this information to infer whether a tab was closed or just switched, but that requires you to use some very error-prone timing.

This request is similar to but not the same as #15178

@jrieken

This comment has been minimized.

Copy link
Member

@jrieken jrieken commented Sep 24, 2018

This request is similar to but not the same as #15178

It is the same

@jrieken jrieken added the *duplicate label Sep 24, 2018
@vscodebot

This comment has been minimized.

Copy link

@vscodebot vscodebot bot commented Sep 24, 2018

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this Sep 24, 2018
@Divni

This comment has been minimized.

Copy link
Author

@Divni Divni commented Sep 24, 2018

@jrieken with due respect I disagree. Not to say it cannot be solved the same way, but the linked ticket is requesting an API to retrieve a list of open editors whereas I'm requesting an API to listen for events for opened / closed editors. These are not the same things, though they can certainly address similar use-cases.

I would appreciate this issue be reopened or at least some clarification as to why this is a duplicate (eg. are you intending to address both requests under that one issue?).

@jrieken

This comment has been minimized.

Copy link
Member

@jrieken jrieken commented Sep 24, 2018

These are not the same things, though they can certainly address similar use-cases.

Rest assured that we will tackle the open-editor-issue properly. That means expose read access and events when those change (e.g. you have to read again).

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.