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

Add evaluate-math-expression extension #17089

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DervexDev
Copy link

@DervexDev DervexDev commented Feb 15, 2025

Description

Screencast

Checklist

@raycastbot raycastbot added the new extension Label for PRs with new extensions label Feb 15, 2025
@raycastbot
Copy link
Collaborator

raycastbot commented Feb 15, 2025

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability, the initial review may take up to 10-15 business days

Once the PR is approved and merged, the extension will be available on our Store.

@pernielsentikaer
Copy link
Collaborator

@greptileai can you do a review here 😊

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds a new "Evaluate Math Expression" extension that reads selected text, evaluates it as a math expression, and outputs the result according to user preferences.

  • In CHANGELOG.md, please use {PR_MERGE_DATE} instead of the hardcoded date "2025-02-15" - this will be automatically replaced with the current date upon merging
  • In src/evaluate-math-expression.ts, error handling could be simplified with showFailureToast from @raycast/utils instead of the current showToast implementation
  • The evaluate function is marked as async but doesn't contain any await operations
  • Consider adding validation for empty text selection before evaluation
  • The Preferences interface in preferences.ts is unnecessary as it's autogenerated in raycast-env.d.ts

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

10 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

return {
...preferences,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
maxDecimals: parseInt(preferences.maxDecimals as any) || undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider using Number(preferences.maxDecimals) instead of parseInt() to handle decimal values properly

@pernielsentikaer pernielsentikaer self-assigned this Feb 27, 2025
DervexDev and others added 4 commits February 27, 2025 16:35
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…on.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@DervexDev
Copy link
Author

@pernielsentikaer Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new extension Label for PRs with new extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants