Skip to content

Conditionally show view#487

Merged
renkun-ken merged 2 commits intoREditorSupport:masterfrom
ElianHugh:master
Dec 9, 2020
Merged

Conditionally show view#487
renkun-ken merged 2 commits intoREditorSupport:masterfrom
ElianHugh:master

Conversation

@ElianHugh
Copy link
Copy Markdown
Collaborator

@ElianHugh ElianHugh commented Dec 8, 2020

Only show workspace view when session watcher is enabled

What problem did you solve?

Workspace viewer only functions when session watcher is enabled. Currently, the workspace viewer is displayed even when non-functional because the session watcher is not enabled.

How can I check this pull request?
If session watcher is enabled, the workspace viewer should be visible. When session watcher is disabled, workspace viewer should not be shown.

Only show workspace view when session watcher is enabled
Comment thread src/extension.ts Outdated

// creates a custom context value for the workspace view
// only shows view when session watcher is enabled
const sessionBool = workspace.getConfiguration('r')['sessionWatcher'];
Copy link
Copy Markdown
Member

@renkun-ken renkun-ken Dec 8, 2020

Choose a reason for hiding this comment

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

I think this could be moved down to https://github.com/Ikuyadeu/vscode-R/blob/master/src/extension.ts#L305 where the session watcher setting is already checked.

Also, we use e.g. config().get<boolean>('sessionWatcher') instead of workspace.getConfiguration.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fix inc! Is there much of a difference between config() and workspace.getConfig? I hadn't seen that command in my googling

Comment thread src/extension.ts Outdated
Refactor code in line with suggestions
Copy link
Copy Markdown
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

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

LGTM

@renkun-ken renkun-ken merged commit 3ce3326 into REditorSupport:master Dec 9, 2020
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.

3 participants