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

workspace.workspaceFolders API should return undefined when no folder is open #8641

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

azatsarynnyy
Copy link
Member

@azatsarynnyy azatsarynnyy commented Oct 15, 2020

Signed-off-by: Artem Zatsarynnyi azatsary@redhat.com

What it does

Makes workspace.workspaceFolders Plugin API returns undefined when no folder is opened. As it is in VS Code.

Closes #8640

How to test

  1. Put the test plugin into the plugins folder and run Theia.
  2. Call Hello World command from the Commands Palette when no workspace folder is opened.
  3. It must show the message no workspace folders which means the API has returned undefined.
    With a workspace folder opened, it should display the message ws api returns X workspace folders

Review checklist

Reminder for reviewers

… is open

Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good based on the definition in vscode:

/**
 * List of workspace folders or `undefined` when no folder is open.
 * *Note* that the first entry corresponds to the value of `rootPath`.
 */
export const workspaceFolders: ReadonlyArray<WorkspaceFolder> | undefined;

@azatsarynnyy
Copy link
Member Author

Thank you @vince-fugnitto for reviewing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

workspace.workspaceFolders API should return undefined when no folder is open
2 participants