add none-ls
This commit is contained in:
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