Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:Prettier doesn't do anything without null-ls integrated #29

Open
ayroblu opened this issue Jun 19, 2023 · 7 comments
Open

:Prettier doesn't do anything without null-ls integrated #29

ayroblu opened this issue Jun 19, 2023 · 7 comments

Comments

@ayroblu
Copy link

ayroblu commented Jun 19, 2023

Hi, as per the title running :Prettier doesn't seem to do anything without null-ls integration
I don't want prettier integrated in to lsp, I just want it separately. Is it possible to make it work without lsp integration?

@MunifTanjim
Copy link
Owner

Can you share a minimal reproducible example?

@ayroblu
Copy link
Author

ayroblu commented Jul 18, 2023

temp.vim

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath=&runtimepath

call plug#begin()
Plug 'nvim-lua/plenary.nvim' "null-ls depends on this
Plug 'neovim/nvim-lspconfig' "prettier depends on this
Plug 'jose-elias-alvarez/null-ls.nvim' "comment out this one and it doesn't work
Plug 'MunifTanjim/prettier.nvim'
call plug#end()

lua <<EOF
local prettier = require("prettier")

prettier.setup({
  bin = 'prettier', -- or `'prettierd'` (v0.23.3+)
  filetypes = {
    "css",
    "graphql",
    "javascript",
    "javascriptreact",
    "json",
    "less",
    "scss",
    "typescript",
    "typescriptreact",
  },
})
EOF

And then I run:

nvim -u temp.vim index.js

@MunifTanjim
Copy link
Owner

jose-elias-alvarez/null-ls.nvim is a dependency for this plugin. Even if you're not using LSP stuffs, you need to have jose-elias-alvarez/null-ls.nvim installed. Because prettier.nvim uses some functions from jose-elias-alvarez/null-ls.nvim when you run :Prettier.

@ayroblu
Copy link
Author

ayroblu commented Jul 19, 2023

I see. Do you want to keep it that way? null-ls is gonna be archived soon too.
If you do, feel free to close this

@MunifTanjim
Copy link
Owner

We would eventually move away from null-ls. But I haven't got the time to do that yet.

@Cheezmeister
Copy link

In the meantime, I suggest that :Prettier ought to vocally fail if (a) null-ls is not detected, and/or (b) the necessary functions cannot be called. By "vocally", I mean simply print out something like null-ls is required, see https://github.com/MunifTanjim/prettier.nvim/issues/29.

For me, right now, it fails silently, and that's one of the worst ways to fail 😄

@tesioai
Copy link

tesioai commented Mar 10, 2024

doesnt do anything for me with null-ls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants