add none-ls
This commit is contained in:
7
.luarc.json
Normal file
7
.luarc.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"diagnostics.disable": [
|
||||
"undefined-global",
|
||||
"unused-local"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -4,4 +4,5 @@ require("crentist.autocmd")
|
||||
require("crentist.lazy_init")
|
||||
require("crentist.filetype")
|
||||
require("crentist.luasnip")
|
||||
require("crentist.null-ls")
|
||||
|
||||
|
||||
11
lua/crentist/lazy/none-ls.lua
Normal file
11
lua/crentist/lazy/none-ls.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
'nvimtools/none-ls.nvim',
|
||||
-- Optional dependencies
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {},
|
||||
config = function()
|
||||
local null_ls = require('null-ls')
|
||||
null_ls.setup({})
|
||||
end
|
||||
}
|
||||
|
||||
51
lua/crentist/null-ls.lua
Normal file
51
lua/crentist/null-ls.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
-- https://www.youtube.com/watch?v=q-oBU2fO1H4&t=189s
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
-- local function check_if_comment(node, params)
|
||||
-- if node == 'nil' then return false
|
||||
-- if node:type() ~= 'comment' or node:type() ~= 'comment_content' then return false end
|
||||
--
|
||||
-- if node:type() == 'comment' then
|
||||
-- local child = node:child()
|
||||
--
|
||||
-- if child == 'nil' then return false end
|
||||
-- end
|
||||
--
|
||||
-- -- node exists and is a part of comment
|
||||
-- if node == 'nil' or node:type() ~= 'comment' or node:type() ~= 'comment_content' then return false end
|
||||
--
|
||||
-- local parent = node:parent()
|
||||
-- if parent == 'nil' or parent:type() ~= 'comment' then return false end
|
||||
--
|
||||
-- local text = vim.treesitter.get_node_text(node, )
|
||||
-- end
|
||||
|
||||
-- null_ls.register({
|
||||
-- name = 'Comment actions',
|
||||
-- method = null_ls.methods.CODE_ACTION,
|
||||
-- filetypes = {},
|
||||
-- generator = {
|
||||
-- fn = function(params)
|
||||
-- local out = {}
|
||||
--
|
||||
-- table.insert(out,
|
||||
-- {
|
||||
-- title = 'Test',
|
||||
-- action = function()
|
||||
-- print(vim.treesitter.get_node())
|
||||
-- end
|
||||
-- })
|
||||
-- return out
|
||||
-- end
|
||||
-- }
|
||||
-- })
|
||||
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<C-a>", function()
|
||||
vim.lsp.buf.code_action()
|
||||
end, { desc = "Snippet next argument", silent = true })
|
||||
|
||||
vim.keymap.set("n", "gra", function()
|
||||
vim.lsp.buf.code_action()
|
||||
end, { desc = "Snippet next argument", silent = true })
|
||||
|
||||
Reference in New Issue
Block a user