Compare commits

...

2 Commits

Author SHA1 Message Date
Yi Ming
79350dd1ed
Merge 52eef14703 into deac7df80a 2024-09-13 01:29:01 +09:00
Yi Ming
52eef14703 docs(treesitter): some functions are only valid for registered parsers 2024-09-12 18:51:06 +08:00
2 changed files with 4 additions and 2 deletions

View File

@ -970,7 +970,7 @@ add({lang}, {opts}) *vim.treesitter.language.add()*
language to load
get_filetypes({lang}) *vim.treesitter.language.get_filetypes()*
Get the filetypes associated with the parser named {lang}.
Get the filetypes associated with the registered parser named {lang}.
Parameters: ~
• {lang} (`string`) Name of parser
@ -979,6 +979,7 @@ get_filetypes({lang}) *vim.treesitter.language.get_filetypes()*
(`string[]`) filetypes
get_lang({filetype}) *vim.treesitter.language.get_lang()*
Get the registered parser name associated with the provided filetype.
Parameters: ~
• {filetype} (`string`)

View File

@ -7,7 +7,7 @@ local ft_to_lang = {
help = 'vimdoc',
}
--- Get the filetypes associated with the parser named {lang}.
--- Get the filetypes associated with the registered parser named {lang}.
--- @param lang string Name of parser
--- @return string[] filetypes
function M.get_filetypes(lang)
@ -20,6 +20,7 @@ function M.get_filetypes(lang)
return r
end
--- Get the registered parser name associated with the provided filetype.
--- @param filetype string
--- @return string|nil
function M.get_lang(filetype)