Closed gwww closed 2 months ago
Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:
Proper conventional commit scoping:
If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin
If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error
[ ] Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above
[ ] README
is properly formatted and uses fenced in links with <url>
unless they are inside a [title](url)
[ ] Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).
[ ] Proper usage of opts
table rather than setting things up with the config
function.
[ ] Proper usage of specs
table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).
This is incorrect. With just the fresh clone like you said, conform isn't installed at all. If you want to use conform then you need to install it. If you are using conform then this already works as intended because it won't use the laptop for formatting at all
For clarity, without conform installed, by default it uses ruff's language server for formatting which doesn't support organizing imports on format. If you install conform it sets up to just use the ruff command line to do the formatting and not the language server.
I understand, but with conform installed, the command line for sorting the imports on write is not called without this PR. To me formatting is code formatting and sorting, no matter what command is doing it. Is that the difference?
Import sorting works without this PR. What this PR is saying is "fallback to the LSP if no formatter are configured". It would change no behavior because there are formatters configured. This is not something that should be in this pack.
Import sorting on file save does not work for me with the base template, conform enabled, and this pack installed. I understand this PR may not be the correct way to solve it.
What does your StatusLine show is attached to the buffer when you open a Python file with the pack and conform added
Also how are you adding conform
The good news is that I was trying to say, is if this PR fixes the problem, then without this PR it would also be working since this change wouldn't affect any of the behavior
Just tested again from scratch.
Conform enabled using this:
return {
"stevearc/conform.nvim",
}
I have exactly two changes to the default template. The above and enabling the community pack. (In the PR I said one change, which is incorrect).
Heirline:
(Sorry it is cut off)
Without PR sorting on save does not get called. With PR sorting on save works.
Oh you just are just not setting up conform at all. I would recommend installing the conform plugin from AstroCommunity as it sets up its interaction with things.
I had no idea about that pack! Now I understand.
Does it make sense to add a line to the readme recommending that pack be installed too?
No, it's just an option for the user if they want to use conform. We recommend not using it for the out of the box experience of the LSP rather than recommending users the much more manual configuration if conform. It's just up to them to opt into it
📑 Description
Using a freshly cloned template, changing only the file
lua/astrocommunity.lua
to:then only the
ruff_format
formatter is called when saving a Python file. Theruff_organize_imports
formatter is not called.This PR adds
conform
configuration that ensures that both formatters are called.ℹ Additional Information