Skip to content

actually ignore interpolations#881

Open
auscyber wants to merge 2 commits into
stevearc:masterfrom
auscyber:master
Open

actually ignore interpolations#881
auscyber wants to merge 2 commits into
stevearc:masterfrom
auscyber:master

Conversation

@auscyber

@auscyber auscyber commented May 26, 2026

Copy link
Copy Markdown

This ignores interpolations inside of injected text and replaces them with placeholders so they can be formatted correctly. one example of this being useful is when using say nix with injected lua or bash and stylua will error out when it sees an interpolation like ${var} inside a string. This PR turns it something like _CONFORM_PLACEHOLDER_idx to make sure that it can be formatted properly. the actual replacement is not done with simply replace and is actually using the treesitter tree as they include information of injections. i've also made it possible to add your own queries for replacement to make this work as such

@github-actions github-actions Bot requested a review from stevearc May 26, 2026 04:00
@auscyber auscyber force-pushed the master branch 3 times, most recently from 56e12f1 to 77f27bc Compare May 26, 2026 10:49
@stevearc

stevearc commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Please mark this as draft until it's ready to review. If it is ready to review, please include a description in the PR.

@auscyber

auscyber commented Jun 3, 2026

Copy link
Copy Markdown
Author

Please mark this as draft until it's ready to review. If it is ready to review, please include a description in the PR.

This ignores interpolations inside of injected text and replaces them with placeholders so they can be formatted correctly. one example of this being useful is when using say nix with injected lua or bash and stylua will error out when it sees an interpolation like ${var} inside a string. This PR turns it something like _CONFORM_PLACEHOLDER_idx to make sure that it can be formatted properly. the actual replacement is not done with simply replace and is actually using the treesitter tree as they include information of injections. i've also made it possible to add your own queries for replacement to make this work as such

done

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.

2 participants