You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.
Log file
With the file test.hcl opened:
Log file: /home/[email protected]/Documents/nvim_sandbox/.repro//state/nvim/conform.log
Formatters for this buffer:
hcl unavailable: Command not found
Other formatters:
packer_fmt ready (packer) /usr/sbin/packer
With the file test.pkr.hcl opened:
Log file: /home/[email protected]/Documents/nvim_sandbox/.repro//state/nvim/conform.log
Formatters for this buffer:
hcl unavailable: Command not found
Other formatters:
packer_fmt ready (packer) /usr/sbin/packer
Describe the bug
Conform.nvim has support for detecting filetypes both root filetypes and nested filetypes such as hcl vs hcl.packer. So if I only configure packer in the formatters_by_ft then it correctly identifies hcl.packer as a compatible packer filetype. But I noticed if I configure both hcl and hcl.packer then the hcl formatters are the only ones that get attached to the buffer. I think the priority here should favor the more specific filetype.
What is the severity of this bug?
breaking (some functionality is broken)
Steps To Reproduce
nvim -u repro.lua test.hcl, Open up an .hcl file
:ConformInfo and see that hcl is set up
:e test.pkr.hcl, open up a .pkr.hcl file
:ConformInfo and see that hcl formatters are still used and the packer formatters are ignored.
Note: If the hcl formatters are removed and packer only exists, then opening a test.pkr.hcl file and running :ConformInfo shows that the formatters are correctly picked up for packer.
Expected Behavior
The formatter configured for the most specific filetype should be used. In this case, use the packer formatters for the filetype hcl.packer and the hcl formatters for the filetype hcl or any other hcl.X unless X is configured.
Minimal example file
Just needs files test.hcl and test.hcl.packer. Contents doesn't matter.
Also the main reason for using this nested filetype notation is to get stuff like treesitter and LSP to work nicely with the files without having to manually tell each that those nested filetypes should also be treated like their parent filetype.
In the example my logs show hcl command is not found. I just wanted to point out that this doesn't matter in the testing case just because I'm looking at how the buffer is configured and not having any problems with the formatters actually running.
Thanks so much for your maintenance of this plugin as it truly is an amazing formatting setup!
The text was updated successfully, but these errors were encountered:
Neovim version (nvim -v)
NVIM v0.10.3
Operating system/version
Arch Linux
Read debugging tips
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
With the file
test.hcl
opened:With the file
test.pkr.hcl
opened:Describe the bug
Conform.nvim has support for detecting filetypes both root filetypes and nested filetypes such as
hcl
vshcl.packer
. So if I only configurepacker
in theformatters_by_ft
then it correctly identifieshcl.packer
as a compatiblepacker
filetype. But I noticed if I configure bothhcl
andhcl.packer
then thehcl
formatters are the only ones that get attached to the buffer. I think the priority here should favor the more specific filetype.What is the severity of this bug?
breaking (some functionality is broken)
Steps To Reproduce
nvim -u repro.lua test.hcl
, Open up an.hcl
file:ConformInfo
and see thathcl
is set up:e test.pkr.hcl
, open up a.pkr.hcl
file:ConformInfo
and see thathcl
formatters are still used and thepacker
formatters are ignored.Note: If the
hcl
formatters are removed andpacker
only exists, then opening atest.pkr.hcl
file and running:ConformInfo
shows that the formatters are correctly picked up forpacker
.Expected Behavior
The formatter configured for the most specific filetype should be used. In this case, use the
packer
formatters for the filetypehcl.packer
and thehcl
formatters for the filetypehcl
or any otherhcl.X
unlessX
is configured.Minimal example file
Just needs files
test.hcl
andtest.hcl.packer
. Contents doesn't matter.Also the main reason for using this nested filetype notation is to get stuff like treesitter and LSP to work nicely with the files without having to manually tell each that those nested filetypes should also be treated like their parent filetype.
Minimal init.lua
Additional context
In the example my logs show
hcl
command is not found. I just wanted to point out that this doesn't matter in the testing case just because I'm looking at how the buffer is configured and not having any problems with the formatters actually running.Thanks so much for your maintenance of this plugin as it truly is an amazing formatting setup!
The text was updated successfully, but these errors were encountered: