You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow specifying AsIs scope without including lower-level transformations #703
When you select scope = 'tokens', you implicitly choose to select also spaces, indention, line break, i.e. scope is cummulative. See help(tidyverse_style, package = 'styler'). For certain applications, you don't want to have lower-level transformations, i.e. for indenting lines for vscode, you don't want to style spaces. I think we might simply want to use I() to indicate non-cummulative scopes. I() changes the class to AsIs and we can handle this internally. This is a non-breaking API change:
style_text("1+\n1", scope= I("indention")) # to only style indention
style_text("1+\n1", scope= I(c("spaces", "token")) # spaces and token only
style_text("1+\n1", scope="indention") # spaces and indention
Internals probably should be refactored to operate on a factor vector with scopes instead of the highest-level scope. Note that this will invalidate the cache as the scope argument will now be represented differently internally.
changed the title [-]Allow specifying non-cummulative scope[/-][+]Allow specifying AsIs scope without including lower-level transformations[/+]on Jan 2, 2021
Activity
[-]Allow specifying non-cummulative scope[/-][+]Allow specifying AsIs scope without including lower-level transformations[/+]