Skip to content

How can I get the list of all open documents? #10304

Closed

Description

@DanTup

Struggling to find this in the API, or something I can reference in your own code (OpenEditorsView seems to get it from IFilesConfiguration? Can I get that?)

I can see window.visibleTextEditors but this is only the visible editors (eg. normally one, unless you have split views) and workspace.textDocuments but that says it's "All text documents currently known to the system").

I need a list to give to my language servers as priority files - it accepts the visible editors first and then any other open files.

Activity

  1. added
    *question
    on Aug 9, 2016
  2. jrieken commented on Aug 9, 2016

    @jrieken
    Contributor

    workspace.textDocuments is what you want - it's those that not yet disposes/closed (shown in the 'Open Editor' section in the explorer)

  3. DanTup commented on Aug 9, 2016

    @DanTup
    ContributorAuthor

    Aha, thanks! The comment in the docs is a bit misleading "All text documents currently known to the system", I assumed it meant everything in the explorer view.

  4. jrieken commented on Aug 10, 2016

    @jrieken
    Contributor

    It's a little fuzzy since we changes our document dispose story a few times ;-)

  5. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    *question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions