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

Default to closing strings with fewer than ~20 characters #2544

Closed
1 task done
OAGr opened this issue Nov 16, 2023 · 1 comment
Closed
1 task done

Default to closing strings with fewer than ~20 characters #2544

OAGr opened this issue Nov 16, 2023 · 1 comment

Comments

@OAGr
Copy link
Contributor

OAGr commented Nov 16, 2023

Description of suggestion or shortcoming:

Here, the strings are short, so it would be preferred if those elements were closed.

This is in the packages/components library. We auto-close numbers and bools and stuff, but not short strings.

image
Checklist
  • Modify packages/components/src/languageSupport/squiggle.tsec5c951

Flowchart

@OAGr OAGr added Language Regarding Squiggle language semantics, distributions and function registry sweep labels Nov 16, 2023
Copy link
Contributor

sweep-ai bot commented Nov 16, 2023

Here's the PR! #2546.

Sweep Basic Tier: I'm using GPT-4. You have 1 GPT-4 tickets left for the month and 3 for the day. (tracking ID: 31002c16cd)

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).

Actions (click)

  • ↻ Restart Sweep

Sandbox execution failed

The sandbox appears to be unavailable or down.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.
I also found the following external resources that might be helpful:

Summaries of links found in the content:


Step 2: ⌨️ Coding

  • Modify packages/components/src/languageSupport/squiggle.tsec5c951
Modify packages/components/src/languageSupport/squiggle.ts with contents:
• Locate the function or method that handles the auto-closing of elements in the Squiggle language. This function or method is likely to contain logic for auto-closing numbers and boolean values.
• Modify this function or method to include logic for auto-closing short strings. This can be done by adding a condition that checks if the element is a string and if its length is less than or equal to 20. If both conditions are met, the string should be auto-closed.
• Ensure that this modification does not interfere with the existing logic for auto-closing numbers and boolean values.

Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/auto-close-short-strings.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.
Join Our Discord

@OAGr OAGr self-assigned this Nov 16, 2023
@OAGr OAGr added Web components and removed Language Regarding Squiggle language semantics, distributions and function registry labels Nov 16, 2023
@OAGr OAGr closed this as completed Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment