-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Add range_select
function to simple expr
#628
Conversation
@@ -1,4 +1,4 @@ | |||
[toolchain] | |||
channel = "nightly-2022-08-27" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the nightly bump?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to use the now stable let ... else
I think. Not really necessary, though.
@@ -341,13 +346,39 @@ fn call_expr_function(name: &str, args: Vec<DynVal>) -> Result<DynVal, EvalError | |||
[json] => Ok(DynVal::from(json.as_json_object()?.len() as i32)), | |||
_ => Err(EvalError::WrongArgCount(name.to_string())), | |||
}, | |||
"range_select" => match args.as_slice() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the function to the docs here: https://github.com/elkowar/eww/blob/master/docs/src/expression_language.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. Wanted to finalize the design a little in #622
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be closed since #622 is fixed?
probably, I don't really use eww much so I havn't looked at this in a while. I can always reopen should I feel like there is still something missing in the future. |
docs were missing and there was a discussion that had been resolved (handling of empty json strings), but there were no consequences after that; see my pr for details |
Fixes #622
Please follow this template, if applicable.
Description
Adds
range_select
function. PoC.Usage
When adding a widget or anything else that affects the configuration,
please provide a minimal example configuration snippet showcasing how to use it and
Showcase
When adding widgets, please provide screenshots showcasing how your widget looks.
This is not strictly required, but strongly appreciated.
Additional Notes
Anything else you want to add, such as remaining questions or explanations.
Checklist
Please make sure you can check all the boxes that apply to this PR.
docs/content/main
directory has been adjusted to reflect my changes.cargo fmt
to automatically format all code before committing