mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
linting fixes
This commit is contained in:
parent
6ae28327e0
commit
b2892fa855
5 changed files with 24 additions and 7 deletions
|
|
@ -1,7 +1,13 @@
|
|||
{
|
||||
"runtime.version": "LuaJIT",
|
||||
"runtime.path": ["lua/?.lua", "lua/?/init.lua"],
|
||||
"diagnostics.globals": ["vim"],
|
||||
"diagnostics.globals": ["vim",
|
||||
"ipairs",
|
||||
"require",
|
||||
"pairs",
|
||||
"type",
|
||||
"unpack",
|
||||
"table"],
|
||||
"workspace.checkThirdParty": false,
|
||||
"workspace.library": ["$VIMRUNTIME", "./lua"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ return {
|
|||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||
range = {
|
||||
start = { args.line1, 0 },
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
["end"] = { args.line2, end_line:len() },
|
||||
}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
-- Helper functions for dealing with buffers
|
||||
local M = {}
|
||||
|
||||
-- Close all but current buffer
|
||||
function M.CloseOthers()
|
||||
for _, i in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if i ~= vim.api.nvim_get_current_buf() then
|
||||
|
|
@ -8,6 +10,7 @@ function M.CloseOthers()
|
|||
end
|
||||
end
|
||||
|
||||
-- Close all open buffers
|
||||
function M.CloseAll()
|
||||
for _, i in ipairs(vim.api.nvim_list_bufs()) do
|
||||
vim.api.nvim_buf_delete(i, {})
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
local ls = require('luasnip')
|
||||
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
|
||||
return {
|
||||
s("ternary", {
|
||||
i(1, "cond"), t(" ? "), i(2, "true"), t(" : "), i(3, "false")
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ local f = ls.function_node
|
|||
local c = ls.choice_node
|
||||
-- local d = ls.dynamic_node
|
||||
-- local r = ls.restore_node
|
||||
local events = require('luasnip.util.events')
|
||||
local ai = require('luasnip.nodes.absolute_indexer')
|
||||
-- local events = require('luasnip.util.events')
|
||||
-- local ai = require('luasnip.nodes.absolute_indexer')
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local m = require('luasnip.extras').m
|
||||
local lambda = require('luasnip.extras').l
|
||||
-- local m = require('luasnip.extras').m
|
||||
-- local lambda = require('luasnip.extras').l
|
||||
local rep = require('luasnip.extras').rep
|
||||
local postfix = require('luasnip.extras.postfix').postfix
|
||||
-- local postfix = require('luasnip.extras.postfix').postfix
|
||||
|
||||
local visibility_modifiers = {
|
||||
t('public'),
|
||||
|
|
@ -65,11 +65,13 @@ return {
|
|||
{
|
||||
i(1, 'Class description'),
|
||||
i(2, 'Classname'),
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
f(function(args, snip, user_arg)
|
||||
-- TODO: generate namespace using parent directories
|
||||
return 'namespace ' .. args[1][1] .. ';'
|
||||
end, { 2 }),
|
||||
rep(2),
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
f(function(args, snip, user_arg)
|
||||
local parser = vim.treesitter.get_parser(0, 'php')
|
||||
local syntax_tree = parser:parse()
|
||||
|
|
@ -92,7 +94,6 @@ return {
|
|||
c(3, visibility_modifiers),
|
||||
i(4, '/* Constructor parameters */'),
|
||||
f(function()
|
||||
local fields = { '' }
|
||||
local parser = vim.treesitter.get_parser(0, 'php')
|
||||
local syntax_tree = parser:parse()
|
||||
local root = syntax_tree[1]:root()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue