Add documentation for efm neovim integration#1197
Open
danielebra wants to merge 1 commit intodjlint:masterfrom
Open
Add documentation for efm neovim integration#1197danielebra wants to merge 1 commit intodjlint:masterfrom
danielebra wants to merge 1 commit intodjlint:masterfrom
Conversation
✅ Deploy Preview for djlint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds documentation for integrating djlint with the efm-languageserver for Neovim users. The integration handles djlint's quirk of returning non-zero exit codes even when successfully formatting files.
- Added a new section explaining efm-languageserver integration with step-by-step setup instructions
- Provided a complete sample Lua configuration for efm-languageserver
- Included specific djlint command flags to handle the tool's unique behavior with exit codes
Comment on lines
+111
to
+120
| 0. Install djlint with Mason via `:MasonInstall djlint` | ||
| 1. Add `htmldjango` to `filetypes` | ||
| 2. Create format configuration | ||
| ``` | ||
| local djlint = { | ||
| formatCommand = "djlint --reformat --quiet --warn -", | ||
| formatStdin = true, | ||
| } | ||
| ``` | ||
| 3. Connect language to formatter with `htmldjango = {djlint}` |
There was a problem hiding this comment.
[nitpick] The numbering starts with '0' which is unconventional for step-by-step instructions. Consider starting with '1' for better readability and consistency with typical documentation conventions.
Suggested change
| 0. Install djlint with Mason via `:MasonInstall djlint` | |
| 1. Add `htmldjango` to `filetypes` | |
| 2. Create format configuration | |
| ``` | |
| local djlint = { | |
| formatCommand = "djlint --reformat --quiet --warn -", | |
| formatStdin = true, | |
| } | |
| ``` | |
| 3. Connect language to formatter with `htmldjango = {djlint}` | |
| 1. Install djlint with Mason via `:MasonInstall djlint` | |
| 2. Add `htmldjango` to `filetypes` | |
| 3. Create format configuration |
local djlint = {
formatCommand = "djlint --reformat --quiet --warn -",
formatStdin = true,
}
4. Connect language to formatter with `htmldjango = {djlint}`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added documentation to demonstrate how to integrate
djlintandefmfor neovim formatting.This tool has some quirks such as returning non-zero status codes when successfully formatting a file, which makes chaining this tool into other tools more challenging. This configuration snippet takes those quirks into consideration to correctly integrate with
efmand allowing for smooth buffer updates when reformatting a django template.