Closed jokerclay closed 1 year ago
Hey! I really appreciate your feedback, happy to hear you enjoyed the video! Thanks for pointing this out and for the detailed explanation of the issue you ran into with images for what you've encountered. What you've described would definitely fix the issue for previous versions of nvim, though you would have to disable "document_formatting" and "document_range_formatting" for all of the languages you have a null-ls formatter configured, not just "sumneko_lua" (i.e. the "tsserver" as well as I am using prettier with null-ls for formatting here too). This was my original approach, but I decided to make this config specifically for NVIM 0.8 or later and modified things according to the null-ls documentation.
You can find more info on where my decisions came from here: Formating on Save. Specifically, the "Sync Formatting" section and "Choosing a Client for Formatting".
I went with the 0.8 version of things and their suggestion for configuring null-ls so that it is the only one that gets formatting requests and you don't have to choose an lsp when saving. Using NVIM 0.8 is a requirement for it to work properly. Is there a particular reason why you are using an earlier version of Neovim?
HI ! Josean , Thank you for your amazing video, I followed along your video , Here are some problems I run into, hope it can inspire you and help others out there with similar problems.
null-ls.lua:37: attempt to call field 'format' (a nil value)
this just because the version ofNVIM v0.7
andNVIM v0.8
you can find it Here:How do I format files? they said :so, I change it as following, and it works
I don't really know how to fix it, so I add the following
Just disable sumneko_lua, instead of choose
null-ls
orsumneko_lua
every time I find it Here : Avoiding LSP formatting conflicts and Here : Neovim Select a Language PromptAgain, your video is amazing , thx !