feat: luacats annotations
This commit is contained in:
parent
21b8cfb470
commit
29f9a5f7e4
2 changed files with 7 additions and 0 deletions
|
|
@ -16,8 +16,11 @@ function M.check()
|
||||||
vim.health.warn('vim-fugitive not detected (required for this plugin to be useful)')
|
vim.health.warn('vim-fugitive not detected (required for this plugin to be useful)')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@type string[]
|
||||||
local common_langs = { 'lua', 'python', 'javascript', 'typescript', 'rust', 'go', 'c', 'cpp' }
|
local common_langs = { 'lua', 'python', 'javascript', 'typescript', 'rust', 'go', 'c', 'cpp' }
|
||||||
|
---@type string[]
|
||||||
local available = {}
|
local available = {}
|
||||||
|
---@type string[]
|
||||||
local missing = {}
|
local missing = {}
|
||||||
|
|
||||||
for _, lang in ipairs(common_langs) do
|
for _, lang in ipairs(common_langs) do
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
---@param bufnr integer
|
||||||
|
---@param ns integer
|
||||||
|
---@param hunk fugitive-ts.Hunk
|
||||||
function M.highlight_hunk(bufnr, ns, hunk)
|
function M.highlight_hunk(bufnr, ns, hunk)
|
||||||
local lang = hunk.lang
|
local lang = hunk.lang
|
||||||
if not lang then
|
if not lang then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@type string[]
|
||||||
local code_lines = {}
|
local code_lines = {}
|
||||||
for _, line in ipairs(hunk.lines) do
|
for _, line in ipairs(hunk.lines) do
|
||||||
table.insert(code_lines, line:sub(2))
|
table.insert(code_lines, line:sub(2))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue