Closed kkharji closed 2 years ago
I don't think this is a null-ls issue, since the following command to pass the file's content via stdin
(which is the equivalent of what null-ls is doing) also produces the same error:
cat test.swift | swiftformat --config .swiftformat
Based on their documentation, this command worked for me:
cat test.swift | swiftformat stdin --stdinpath test.swift --config .swiftformat
I'd guess that adding additional arguments means you have to explicitly state that input is coming from stdin
, since cat test.swift | swiftformat
works. This is just a guess, though, since I've never worked with Swift or this formatter before.
Indeed, it's not null-ls issues per-se but how null-ls support swiftformat.
Thanks a lot for taking the time to look into this one @jose-elias-alvarez . I guess I only need to append --stdinpath
to arguments.
Do you think it may make sense to have by default, I can open a pr?
Sure, I agree that it makes sense to be more explicit about the argument structure if it's causing issues. PR welcome!
FAQ
Issues
Neovim Version
v0.8.0-dev
Operating System
linux
Minimal config
Steps to reproduce
Expected behavior
file path to be passed as argument
Actual behavior
Failed to apply {file} template in file header as file name was not provided.
also with another variable
Failed to apply {created} template in file header as file info is unavailable
Debug log
Help
No
Implementation help
No response
Requirements