Skip to content

Click code in help views#1138

Merged
ManuelHentschel merged 10 commits intomasterfrom
clickCode
Jul 3, 2022
Merged

Click code in help views#1138
ManuelHentschel merged 10 commits intomasterfrom
clickCode

Conversation

@ManuelHentschel
Copy link
Member

@ManuelHentschel ManuelHentschel commented Jun 27, 2022

Closes #459 #1137

Code sections in the help viewer are highlighted on hover, and can be clicked to be copied to the clipboard, or run in the terminal.

The behavior can be modified with the setting "r.helpPanel.clickCodeExamples". Changes to this setting might require reloading the window to take effect.

@ManuelHentschel ManuelHentschel marked this pull request as ready for review June 29, 2022 10:45
@ManuelHentschel ManuelHentschel changed the title WIP: Click code in help views Click code in help views Jun 29, 2022
package.json Outdated
"enum": [
"Disabled",
"Copy",
"Run"
Copy link
Member

Choose a reason for hiding this comment

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

It is nice to have the capability to either copying or running the example code. I wonder if it is possible to have both at the same time. For example, click to copy, and cmd+click to run, or something like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. I wasn't sure how to handle the possible modifier keys best, especially w.r.t. mac (Should we just make them all configurable, or are there sensible "groupings"?).

Copy link
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.

Works nicely! Thanks!

@ManuelHentschel ManuelHentschel linked an issue Jul 3, 2022 that may be closed by this pull request
@ManuelHentschel ManuelHentschel merged commit 94acedb into master Jul 3, 2022
@ManuelHentschel ManuelHentschel deleted the clickCode branch July 3, 2022 08:05
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.

Code/Text in Help Window can't be copied Help view: send code to console?

2 participants