Skip to content

feat: add pretty formatting for groq queries [WIP]#26

Draft
runeb wants to merge 2 commits into
mainfrom
feat/formatting
Draft

feat: add pretty formatting for groq queries [WIP]#26
runeb wants to merge 2 commits into
mainfrom
feat/formatting

Conversation

@runeb

@runeb runeb commented Aug 7, 2024

Copy link
Copy Markdown
Member

Uses wasm for groq formatting, inspired by groq.app by @juice49 . Currently only works for inlined queries, not standalone files.

Modified lens provider to calculate a range for the query instead of just a start position, so that replacement is easier.
There is currently a bug where the range is not recalculated after edits are made or formatter has replaced the query. Most easily reproduced by replacing a query multiple times.

@runeb

runeb commented Aug 7, 2024

Copy link
Copy Markdown
Member Author

Feature requested in #8

@socket-security

socket-security Bot commented Aug 7, 2024

Copy link
Copy Markdown

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@groqfmt/wasm@1.2.2 None 0 3.8 MB ash

View full report↗︎

@runeb

runeb commented Aug 7, 2024

Copy link
Copy Markdown
Member Author

Ideally we move the new dependency into the org before publishing this and not rely on @groqfmt/wasm

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