The folder uri is in, the innermost when folders nest, or undefined.
The open folders, in the order VS Code lists them, read when called.
Calls listener after folders are added, removed or changed.
The caller owns the subscription. One still open when the application stops is released with it, so a forgotten one lasts for the session rather than past it.
uri relative to the folder it is in, with / between segments.
A resource in no folder comes back as its file system path. A folder itself is looked up from the directory it sits in, so it is named relative to a folder around that directory, or comes back as its file system path when there is none.
OptionalincludeFolderName: boolean
Start with the folder's name. When omitted, it does exactly when more than one folder is open, as the Explorer does.
The open workspace folders, and where a resource sits among them.
Which folder a resource is in, and how its path is written relative to it, are VS Code's answers: with folders nested the innermost wins, letter case is compared the way the resource's file system compares it, and with more than one folder open a relative path starts with the folder's name — the same text the Explorer shows. Asking VS Code rather than comparing paths here is what keeps a multi-root or remote workspace from being a special case.
Its shape is the workspace capability's, so
createFakeWorkspacefrom/testingstands in for it in a unit test of a feature that takes the service, with no test host around it.Example