mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
refactor(treesitter)!: rename help parser to vimdoc
This commit is contained in:
@@ -194,8 +194,8 @@ set(TREESITTER_LUA_SHA256 930d0370dc15b66389869355c8e14305b9ba7aafd36edbfdb468c8
|
|||||||
set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/e39a7bbcfdcfc7900629962b785c7e14503ae590.tar.gz)
|
set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/e39a7bbcfdcfc7900629962b785c7e14503ae590.tar.gz)
|
||||||
set(TREESITTER_VIM_SHA256 7ca85fa1a5a9e4d057ff3b7ae53d13d31371973e734ada87a83f3f6cbe9c0e32)
|
set(TREESITTER_VIM_SHA256 7ca85fa1a5a9e4d057ff3b7ae53d13d31371973e734ada87a83f3f6cbe9c0e32)
|
||||||
|
|
||||||
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.3.0.tar.gz)
|
set(TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/b2ec4ec5f7be24cb6f7ccffafd7204477fe5784a.tar.gz)
|
||||||
set(TREESITTER_HELP_SHA256 f33f6d49c7d71feb2fd68ef2b2684da150f9f8e486ad9726213631d673942331)
|
set(TREESITTER_VIMDOC_SHA256 0689a57d455243de6c6a6c8737a8ce137e225eb8f32676a7037f7dd13dfaec5d)
|
||||||
|
|
||||||
set(TREESITTER_QUERY_URL https://github.com/nvim-treesitter/tree-sitter-query/archive/v0.1.0.tar.gz)
|
set(TREESITTER_QUERY_URL https://github.com/nvim-treesitter/tree-sitter-query/archive/v0.1.0.tar.gz)
|
||||||
set(TREESITTER_QUERY_SHA256 e2b806f80e8bf1c4f4e5a96248393fe6622fc1fc6189d6896d269658f67f914c)
|
set(TREESITTER_QUERY_SHA256 e2b806f80e8bf1c4f4e5a96248393fe6622fc1fc6189d6896d269658f67f914c)
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ BuildTSParser(
|
|||||||
CMAKE_FILE TreesitterParserCMakeLists.txt)
|
CMAKE_FILE TreesitterParserCMakeLists.txt)
|
||||||
|
|
||||||
BuildTSParser(
|
BuildTSParser(
|
||||||
LANG help
|
LANG vimdoc
|
||||||
URL ${TREESITTER_HELP_URL}
|
URL ${TREESITTER_VIMDOC_URL}
|
||||||
SHA256 ${TREESITTER_HELP_SHA256}
|
SHA256 ${TREESITTER_VIMDOC_SHA256}
|
||||||
CMAKE_FILE TreesitterParserCMakeLists.txt)
|
CMAKE_FILE TreesitterParserCMakeLists.txt)
|
||||||
|
|
||||||
BuildTSParser(
|
BuildTSParser(
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ The following changes may require adaptations in user config or plugins.
|
|||||||
|
|
||||||
• |nvim_exec()| is now deprecated in favor of |nvim_exec2()|.
|
• |nvim_exec()| is now deprecated in favor of |nvim_exec2()|.
|
||||||
|
|
||||||
|
• `help` treesitter parser was renamed to `vimdoc`. The only user-visible
|
||||||
|
change is that language-specific highlight groups need to be renamed from
|
||||||
|
`@foo.help` to `@foo.vimdoc`.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
NEW FEATURES *news-features*
|
NEW FEATURES *news-features*
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ local a = vim.api
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@type table<string,string>
|
---@type table<string,string>
|
||||||
local ft_to_lang = {}
|
local ft_to_lang = {
|
||||||
|
help = 'vimdoc',
|
||||||
|
}
|
||||||
|
|
||||||
--- Get the filetypes associated with the parser named {lang}.
|
--- Get the filetypes associated with the parser named {lang}.
|
||||||
--- @param lang string Name of parser
|
--- @param lang string Name of parser
|
||||||
|
|||||||
@@ -624,7 +624,7 @@ local function get_helptags(help_dir)
|
|||||||
return m
|
return m
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use the help.so parser defined in the build, not whatever happens to be installed on the system.
|
-- Use the vimdoc parser defined in the build, not whatever happens to be installed on the system.
|
||||||
local function ensure_runtimepath()
|
local function ensure_runtimepath()
|
||||||
if not vim.o.runtimepath:find('build/lib/nvim/') then
|
if not vim.o.runtimepath:find('build/lib/nvim/') then
|
||||||
vim.cmd[[set runtimepath^=./build/lib/nvim/]]
|
vim.cmd[[set runtimepath^=./build/lib/nvim/]]
|
||||||
@@ -643,8 +643,8 @@ local function parse_buf(fname)
|
|||||||
buf = fname
|
buf = fname
|
||||||
vim.cmd('sbuffer '..tostring(fname)) -- Buffer number.
|
vim.cmd('sbuffer '..tostring(fname)) -- Buffer number.
|
||||||
end
|
end
|
||||||
-- vim.treesitter.require_language('help', './build/lib/nvim/parser/help.so')
|
-- vim.treesitter.require_language('help', './build/lib/nvim/parser/vimdoc.so')
|
||||||
local lang_tree = vim.treesitter.get_parser(buf, 'help')
|
local lang_tree = vim.treesitter.get_parser(buf)
|
||||||
return lang_tree, buf
|
return lang_tree, buf
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user