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

[Extension API] vscode.workspace.textDocuments does not return all documents at the beginning #33546

Closed
mkloubert opened this issue Aug 30, 2017 · 5 comments
Assignees
Labels

Comments

@mkloubert
Copy link

@mkloubert mkloubert commented Aug 30, 2017

I am using vscode.workspace.textDocuments to detect all opened and visible text documents.

At the beginning, when I start debugging my extension, I have 3 open text documents, lets say test_1.php, test_2.php, test_3.php.

Now when I access vscode.workspace.textDocuments, I only get the active one (in that example test_1.php).

When I click on another one (test_2.php) and access vscode.workspace.textDocuments again, I get the new active document and the previous one (test_1.php and test_2.php).

When I click on the last, remaining one (test_3.php) and access vscode.workspace.textDocuments again, I get the list of all documents.

But it seems to depend on the situation, which document has been active at the beginning or has been activated after I have clicked on it.

Is this a bug or a feature?

If a feature: Is there another way to access an up-to-date list of all opened documents?

@vscodebot vscodebot bot added the php label Aug 30, 2017
@roblourens roblourens assigned bpasero and unassigned roblourens Aug 30, 2017
@bpasero bpasero assigned jrieken and unassigned bpasero Aug 31, 2017
@jrieken jrieken added needs more info and removed php labels Aug 31, 2017
@jrieken
Copy link
Member

@jrieken jrieken commented Aug 31, 2017

In what version does this happen?

@mkloubert
Copy link
Author

@mkloubert mkloubert commented Aug 31, 2017

@jrieken

Oh, sorry: 1.15

@jrieken
Copy link
Member

@jrieken jrieken commented Oct 31, 2017

At the beginning, when I start debugging my extension, I have 3 open text documents, lets say test_1.php, test_2.php, test_3.php.

What do you mean by that? Right after start? Are those tabs or actual editors, e.g. three editor columns filled or one column with 3 tabs?

@mkloubert
Copy link
Author

@mkloubert mkloubert commented Nov 6, 2017

@jrieken

Right after start. 3 tabs inside 1 column.

@jrieken
Copy link
Member

@jrieken jrieken commented Nov 6, 2017

Ok, so right after start the tabs are just restored, not the documents. Only the visible documents exists in memory, the other tabs are just UX gestures that will trigger document loading.

@jrieken jrieken added *question and removed needs more info labels Nov 6, 2017
@jrieken jrieken closed this Nov 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants