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: various fixes for the injected formatter #235

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

mehalter
Copy link
Contributor

@mehalter mehalter commented Dec 5, 2023

Some formatters rely on information such as filetype. If that one of those formatters are used by the injected formatter, we need to load the buffer of the injected so that it calculates information such as filetype.

This also validates that _injection_query exists before enabling the injected formatter. Not all treesitter parsers provide this query if they do not have any possible language injections. One example of this is the json parser which doesn't have any injections. This will tell the parser that it doesn't actually need to run for buffers with parsers without injections.

@mehalter mehalter changed the title fix: load temp buffer once created to load the context for formatters fix: various fixes for the injected formatter Dec 5, 2023
@stevearc stevearc merged commit 07fcbfc into stevearc:master Dec 7, 2023
7 checks passed
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.

None yet

2 participants