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

Upcoming changes in the knitr progress bar #1263

Closed
yihui opened this issue Nov 22, 2022 · 3 comments
Closed

Upcoming changes in the knitr progress bar #1263

yihui opened this issue Nov 22, 2022 · 3 comments

Comments

@yihui
Copy link

yihui commented Nov 22, 2022

Is your feature request related to a problem? Please describe.

We are currently working on condensing the knitr progress bar: yihui/knitr#1880. I'm filing this issue to check if the changes would affect the progress tracking in this extension: https://github.com/REditorSupport/vscode-R/wiki/R-Markdown#progress-tracking

Describe the solution you'd like

The form of the progress bar will be changed from

  |...   | x%
label: foo (with options)
  str(options)

to

  |...   | x% chunk: foo

I don't know the assumptions of this extension when parsing the percentages. If it only looks for x% no matter where it appears, it's probably going to be okay. If it assumes that x% appears at the end of a line, it may be broken with a future version of knitr.

You can install the dev version of knitr to verify:

remotes::install_github('yihui/knitr')

Additional context

In a future version of knitr, users may also be able to provide their custom progress bars (yihui/knitr#2196). If they do, the progress tracking may not work, since we can't predict the form of the progress bars, but I guess that might be fine---if users customize the progress bar, that means they prefer their own style of progress tracking.

Thanks!

@renkun-ken
Copy link
Member

Thanks for the information! Currently, we simply capture the percentage that appears in the log with

const percentRegex = /[0-9]+(?=%)/g;

As long as there is a percentage number in x% it should not be broken.

@renkun-ken
Copy link
Member

I test with the latest knitr dev and the progress works as expected.

@yihui
Copy link
Author

yihui commented Nov 23, 2022

Great! Thank you for the confirmation! Then I'll close this issue.

BTW, the PR yihui/knitr#2196 will make it possible to use a custom progress bar. Perhaps this vscode extension can also use this feature to create a native vscode progress bar directly.

@yihui yihui closed this as completed Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants