-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 support for onPrettifyQuery callback to enable customised query formatting #3640
Conversation
🦋 Changeset detectedLatest commit: 0bc748a The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@i-like-robots can you sign CLA? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3640 +/- ##
==========================================
- Coverage 67.30% 67.28% -0.02%
==========================================
Files 121 121
Lines 7016 7018 +2
Branches 2263 2246 -17
==========================================
Hits 4722 4722
- Misses 2277 2279 +2
Partials 17 17
|
superseded by #3733 |
Thanks @dimaMachina 🙏 |
This adds a new optional callback function named
onPrettifyQuery
to enable the use of customised query formatting, such as integrating Prettier. This is a very quick POC implementation but I'm happy to invest more time if the feature is accepted as being valuable.When provided this callback will be invoked when the user formats the current contents of the query editor. It has no affect on the header or variable editors. The callback will receive the current value of the query editor and should return a string containing the formatted query. When the callback is not provided it will fallback to the current parse/print logic.
Intended to resolve #1517 and #3385.