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

execute :Format error #42

Open
BacteriaZHANG opened this issue Jul 10, 2022 · 0 comments
Open

execute :Format error #42

BacteriaZHANG opened this issue Jul 10, 2022 · 0 comments

Comments

@BacteriaZHANG
Copy link

BacteriaZHANG commented Jul 10, 2022

E5108: Error executing lua [string ":lua"]:1: attempt to call field 'format' (a nil value)
stack traceback:
[string ":lua"]:1: in main chunk

==========================
my null-ls.lua file

local null_ls_status_ok, null_ls = pcall(require, "null-ls")
if not null_ls_status_ok then
return
end

-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
local formatting = null_ls.builtins.formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local diagnostics = null_ls.builtins.diagnostics

-- https://github.com/prettier-solidity/prettier-plugin-solidity
-- npm install --save-dev prettier prettier-plugin-solidity
null_ls.setup {
debug = false,
sources = {
formatting.stylelint.with {
filetypes = { "css", "sass", "scss", "less" },
},
formatting.prettier.with {
extra_filetypes = { "toml", "solidity" },
},
formatting.black.with { extra_args = { "--fast" } },
formatting.stylua,
formatting.google_java_format,
diagnostics.flake8,
},
}

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

1 participant