Skip to content

Fix checking workspaceFolders in rHelpProviderOptions#456

Merged
renkun-ken merged 2 commits intoREditorSupport:masterfrom
renkun-ken:fix-help-cwd
Nov 22, 2020
Merged

Fix checking workspaceFolders in rHelpProviderOptions#456
renkun-ken merged 2 commits intoREditorSupport:masterfrom
renkun-ken:fix-help-cwd

Conversation

@renkun-ken
Copy link
Copy Markdown
Member

What problem did you solve?

Fix checking workspaceFolders in the initialization of the help panel.

(If you do not have screenshot) How can I check this pull request?

  1. No open workspace folders.
  2. Open or create an R file.
  3. vscode-R should be activated properly.

@renkun-ken renkun-ken mentioned this pull request Nov 22, 2020
@renkun-ken
Copy link
Copy Markdown
Member Author

renkun-ken commented Nov 22, 2020

@Ikuyadeu We might need a quick release for this as the extension activation for no open workspace folder is broken.

@ManuelHentschel
Copy link
Copy Markdown
Member

ManuelHentschel commented Nov 22, 2020

Would it make sense to also check the length of the array?

         cwd: ((workspace.workspaceFolders !== undefined && workspace.workspaceFolders.length > 0) ? workspace.workspaceFolders[0].uri.fsPath : undefined)

The documentation seems to imply that an array of length 0 won't occurr ("List of workspace folders or undefined when no folder is open."), but better be safe than sorry

@renkun-ken
Copy link
Copy Markdown
Member Author

@ManuelHentschel Agreed.

Note that both vscode-R and languageserver support multi-root workspace. We might revisit the code where workspaceFolders[0] is used and see how we could properly handle multi-root workspace in these cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants