mirror of
https://github.com/neovim/neovim.git
synced 2026-05-02 20:15:03 +00:00
docs(treesitter): clean up and update treesitter.txt (#20142)
* add type annotations to code * clean up and expand static documentation * consistent use of tags for static and generated docs
This commit is contained in:
@@ -2,14 +2,15 @@ local a = vim.api
|
||||
|
||||
local M = {}
|
||||
|
||||
--- Asserts that the provided language is installed, and optionally provide a path for the parser
|
||||
--- Asserts that a parser for the language {lang} is installed.
|
||||
---
|
||||
--- Parsers are searched in the `parser` runtime directory.
|
||||
--- Parsers are searched in the `parser` runtime directory, or the provided {path}
|
||||
---
|
||||
---@param lang string The language the parser should parse
|
||||
---@param path string|nil Optional path the parser is located at
|
||||
---@param silent boolean|nil Don't throw an error if language not found
|
||||
---@param symbol_name string|nil Internal symbol name for the language to load
|
||||
---@param lang string Language the parser should parse
|
||||
---@param path (string|nil) Optional path the parser is located at
|
||||
---@param silent (boolean|nil) Don't throw an error if language not found
|
||||
---@param symbol_name (string|nil) Internal symbol name for the language to load
|
||||
---@return boolean If the specified language is installed
|
||||
function M.require_language(lang, path, silent, symbol_name)
|
||||
if vim._ts_has_language(lang) then
|
||||
return true
|
||||
@@ -42,7 +43,8 @@ end
|
||||
---
|
||||
--- Inspecting provides some useful information on the language like node names, ...
|
||||
---
|
||||
---@param lang The language.
|
||||
---@param lang string Language
|
||||
---@return table
|
||||
function M.inspect_language(lang)
|
||||
M.require_language(lang)
|
||||
return vim._ts_inspect_language(lang)
|
||||
|
||||
Reference in New Issue
Block a user