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

Fix template string highlights #1182

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

aaronvg
Copy link
Contributor

@aaronvg aaronvg commented Nov 19, 2024

Important

Fixes template string highlighting in BAML files and adds a Completion function for handling template string completions.

  • Syntax Highlighting:
    • Fixes template string highlighting in baml.tmLanguage.json by adjusting the regex patterns for template_string_declaration and template_string_body.
    • Updates block_string_pair and function_declaration2 patterns to handle multi-line strings correctly.
  • New Functionality:
    • Adds Completion function to handle template string completions in async_client.py, sync_client.py, and client.rb.
  • Testing:
    • Adds template_string.baml test file to verify template string handling.
    • Updates inlinedbaml.py and inlined.rb to include the new test file.

This description was created by Ellipsis for 5ce06a5. It will automatically update as commits are pushed.

@aaronvg aaronvg enabled auto-merge November 19, 2024 21:40
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 5ce06a5 in 36 seconds

More details
  • Looked at 662 lines of code in 10 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_nN65ylgXfP0CxjLw


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -83,26 +83,27 @@
"1": { "name": "storage.type.declaration.function" },
"2": { "name": "entity.name.function" }
},
"end": "(\")(#{1,3})",

"end": "^(\"#{1,3})",
Copy link
Contributor

Choose a reason for hiding this comment

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

The regex pattern for the end of a template string declaration should match the same number of hash symbols as the beginning. Consider changing the end pattern to "\1 to ensure consistency.

Suggested change
"end": "^(\"#{1,3})",
"end": "^("\1)",

@aaronvg aaronvg added this pull request to the merge queue Nov 19, 2024
Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 9:42pm

Merged via the queue into canary with commit 60c823a Nov 19, 2024
10 checks passed
@aaronvg aaronvg deleted the fix-template-string-highlight branch November 19, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant