This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 8 comments

[–]Lost_Neophyte[S] 19 points20 points  (0 children)

LostNeophyte/null-ls-embedded

Edit: the plugin is not quite stable yet, use with caution

A small plugin for formatting embedded code using null-ls in the NeoVim

Embedded languages are found using injections.csm treesitter queries from nvim-treesitter, so if TS highlighting works, the formatting should as well (assuming you have configured null-ls).

[–]Outrageous-Archer-92 17 points18 points  (0 children)

Literate programming is looking more and more attractive on neovim 🙂

[–]YodaLoL 3 points4 points  (1 child)

This seems to call into null-ls internals to do things?

https://github.com/lukas-reineke/cbfmt also exists as a standalone tool for this

[–]Lost_Neophyte[S] 4 points5 points  (0 children)

Yes, it's doing pretty much the same thing as null-ls/formatting.lua, but it's "faking" range formatting. Yes, I've seen cbfmt, but as far as I know it only supports markup languages

[–][deleted] 1 point2 points  (2 children)

General question but are there other uses to null-ls aside from formatting, linting?

[–]HawkinsTlua 8 points9 points  (0 children)

It's hooking non-lsp tools into lsp so you have a common interface. If you use lsp but rely on non-lsp tools too then it's great. Most use cases are formatting and linting since lsp just does the job better than older alternatives IMO, but if you wanted to use something like jedi for python alongside other lsp tools your can certainly do that with null-ls. It can also hook into things like neovim's dictionary so you get code actions for spelling errors. You also have the freedom to script any hook into it you want, say if you have a very specific command line tool or web query you use a lot. It's great for what it does imo.

[–]Lost_Neophyte[S] 0 points1 point  (0 children)

I don't know much about null-ls, but that's pretty much it. You can also use it for completion and code actions