-
Notifications
You must be signed in to change notification settings - Fork 162
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
feat!: large rework of configuration logic #491
Merged
Merged
Conversation
This file contains 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
stevearc
force-pushed
the
stevearc-config-refactor
branch
from
July 16, 2024 04:13
f3a21c1
to
e36a3d4
Compare
stevearc
force-pushed
the
stevearc-config-refactor
branch
from
July 19, 2024 15:41
e36a3d4
to
54ea60d
Compare
json = { { "prettierd", "prettier" }, "fixjson" },
markdown = { { "prettierd", "prettier" }, "markdownlint" }, How to implement these settings with the new logic? That is, I want to use fixjson and markdownlint always and make it only optional and first available in the pair "prettierd", "prettier" |
nfielder
added a commit
to nfielder/dotfiles
that referenced
this pull request
Jul 22, 2024
conform.nvim changed configuration logic to no longer support multiple formatters in a certain syntax. See stevearc/conform.nvim#491
yamgent
added a commit
to yamgent/mynvim
that referenced
this pull request
Jul 26, 2024
The syntax was changed in stevearc/conform.nvim#491 The replacement for nested formatter is: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#run-the-first-available-formatter-followed-by-more-formatters
yamgent
added a commit
to yamgent/mynvim
that referenced
this pull request
Jul 26, 2024
The syntax was changed in stevearc/conform.nvim#491 The replacement for nested formatter is: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#run-the-first-available-formatter-followed-by-more-formatters
yamgent
added a commit
to yamgent/mynvim
that referenced
this pull request
Jul 26, 2024
* chore!: upgrade conform & fidget No breaking change on fidget. Breaking changes on conform.nvim: * stevearc/conform.nvim@9228b2f * Change `lsp_fallback = true` -> `lsp_format = "fallback"` * chore!: upgrade gitsigns.nvim Breaking changes for gitsigns.nvim: * lewis6991/gitsigns.nvim@d9d94e0 * Not affected. Not using nvim v0.8. * lewis6991/gitsigns.nvim@720061a * Not affected. Not using nvim v0.8. * lewis6991/gitsigns.nvim@3d7e49c * Not affected. Not using the option. * lewis6991/gitsigns.nvim@61f5b64 * Not affected. Not using the option 'yadm'. * lewis6991/gitsigns.nvim@92a8fbb * Not affected. Not using the option 'current_line_blame_formatter_opts'. * chore!: upgrade lazy.nvim Affected changes for lazy.nvim: * folke/lazy.nvim@183f59e * Partially affected, there's change in startup script * chore: upgrade neo-tree Breaking changes for neo-tree: * nvim-neo-tree/neo-tree.nvim@403a9c5 * Not affected, not using `enable_normal_mode_for_inputs` * chore: upgrade nvim-lspconfig Breaking changes for nvim-lspconfig: * neovim/nvim-lspconfig@946c58c * Not affected, not using solidity-language-server * neovim/nvim-lspconfig@2054452 * Not affected, not using omnisharp. * neovim/nvim-lspconfig@70d1c2c * Not affected, not using ruff-lsp. * chore!: upgrade nvim-treesitter Too many breaking changes here. We are affected, but nothing is unsolvable without re-running :TSUpdate. * chore!: upgrade telescope-zf-native.nvim No breaking changes in this plugin, BUT lazy.nvim enabled luarocks, which causes issues with this plugin, so have to disable luarocks. * chore: upgrade kanagawa and tokyonight Both have breaking changes but we do not use the options. * chore!: upgrade nvim-dap-ui Dependencies for plugin has changed. * chore!: upgrade the rest of the plugins They reported no breaking changes, but you never know... * feat: use softer version of gruvbox * chore: add maintenance.md * fix: on Windows, use zig compiler for treesitter instead of clang On Windows: Rust: `cargo build` -> builds successfully. Zig: `zig build-exe` -> builds successfully. C++: `clang++ main.cpp` -> unable to find a visual studio installation; try running clang from a developer command prompt [-wmsvc-not-found] Windows C++ toolchain is still a joke today, and the joke's not funny anymore. As the zig way of building treesitter is unstable on other platforms, limit zig usage to just Windows. * feat: switch colorscheme to gruvbox * fix: conform replace outdated nested syntax The syntax was changed in stevearc/conform.nvim#491 The replacement for nested formatter is: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#run-the-first-available-formatter-followed-by-more-formatters * chore: upgrade plugins again
askoufis
added a commit
to askoufis/dotfiles
that referenced
this pull request
Jul 31, 2024
- Some config was recently deprecated. See stevearc/conform.nvim#491.
This was referenced Aug 7, 2024
1 task
glwbr
added a commit
to glwbr/kickstart.nixvim
that referenced
this pull request
Sep 2, 2024
- This change allows for the use of the `stop_after_first` option to run formatters sequentially, stopping after the first successful one. Aligns with the recent changes in conform.nvim to better support attribute sets and sequential execution of formatters. - Using a list of lists will throw a deprecation warning Ref: stevearc/conform.nvim#491 Docs: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#run-the-first-available-formatter-followed-by-more-formatters
glwbr
added a commit
to glwbr/kickstart.nixvim
that referenced
this pull request
Sep 2, 2024
- This change allows for the use of the `stop_after_first` option to run formatters sequentially, stopping after the first successful one. Aligns with the recent changes in conform.nvim to better support attribute sets and sequential execution of formatters. - Running nixvim with nixpkgs unstable while using a list of lists will now throw a deprecation warning Ref: stevearc/conform.nvim#491 Docs: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#run-the-first-available-formatter-followed-by-more-formatters
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.
This PR bundles several changes related to how conform can be configured. There are two breaking changes in the form of deprecating a method and deprecating the formatter alternation syntax, however both will continue to work for now after one warning notification. The final breaking change is dropping support for Neovim 0.8, which was done because the tests now fail on 0.8 due to nvim-treesitter. Since 0.9 has been around for a while, it's easier to just bump the requirement and bundle that breaking change with these others.
Default format options
feature: New
default_format_opts
option that will allow you to configure the default behavior ofconform.format()
motivation: The primary reason for this is because the per-filetype configuration (below) needs this to make sense. If we can configure the
lsp_format
on a per-filetype basis, we also probably want to be able to customize the default value to avoid repetition.example:
Per-filetype configuration of format options
feature:
formatters_by_ft
can now customize some format optionsmotivation: make it easier to customize behavior for specific filetypes. Previous advice for changing the LSP fallback behavior for one filetype was fairly involved. People frequently perform formatting in two places: on save, and on a particular keymap (e.g.
<leader>f
). It can be annoying to keep the behavior in those two places in sync. This, combined withdefault_format_opts
, should make it much easier to keep the logic simple in both places.example:
Notification for no available formatters
feature: You will now get a once-per-filetype notification when you call
conform.format
on a buffer that does have formatters configured when none of those formatters are available (i.e. they aren't installed). There is an option to disable this notification.motivation: #480
example:
Deprecate formatter alternation syntax for option to only run the first available formatter
feature: Previously you could use nested list syntax like
{ { "prettierd", "prettier" } }
to run the first formatter available instead of all formatters. Now,conform.format
takes a single boolean optionstop_after_first
that will determine whether to use all formatters, or just the first available.motivation: This is a useful feature, but the syntax is a weird special case and complicates the data structures we accept and deal with internally. It's also harder for new users to understand what magic is happening.
example:
Note that we are aware that this new format is slightly less flexible, since you can't use constructs like
{ { "prettierd", "prettier" }, "injected" }
anymore. This behavior is still possible, you will just need to write it yourself usingget_formatter_info
and checking what is available. We think that the simplification of the code and the common case is worth the added complication for these advanced uses.Deprecate
will_fallback_lsp
forlist_formatters_to_run
feature: new API method that will return the exact list of formatters that will be run, accounting for all
stop_after_first
, LSP fallback, and other logic.motivation: the original purpose for
will_fallback_lsp
was for use in statusline plugins to help them determine if the formatters will be used or if conform will use LSP instead. With the refactor oflsp_format
to add more ways LSP formatting can work, it makes more sense to just bundle all this logic up into a function that just gives you what you want. This new function should make it easier to integrate conform into statuslines.example: