The following implementation for the method isMultiRootWorkspaceOpened() is misleading.
https://github.com/theia-ide/theia/blob/a27cbd0bfcc03ccc36044e51c6bd341d7f5eb93a/packages/workspace/src/browser/workspace-service.ts#L267-L269
The method checks whether there is a workspace opened and that the preference is on.
This is a false positive and does not accurately describe if a multi-root workspace is in fact opened.
Additional checks should be made to verify the source of the workspace
(for example being a *.theia-workspace file) or a directory (single root).
@elaihau your thoughts?
you are right. isMultiRootWorkspaceOpened does not return what its name indicates. it should be renamed into something like isMultiRootWorkspaceEnabled.
We can keep though isMultiRootWorkspaceOpened with a workspace file stat check, but should still add a breaking change note in CHANGELOG, since semantics is changed.
Most helpful comment
you are right.
isMultiRootWorkspaceOpeneddoes not return what its name indicates. it should be renamed into something likeisMultiRootWorkspaceEnabled.