diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-03-31 17:09:00 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2023-04-01 15:07:16 +0200 |
commit | d7f7450017b9b05303698a6cda54303ef22c63b3 (patch) | |
tree | e6b48fffc27a65f3cb4389741926933e4dec81d3 | |
parent | 2a298f2e48eb081f2e3b58068af589b82fe76a18 (diff) | |
download | rneovim-d7f7450017b9b05303698a6cda54303ef22c63b3.tar.gz rneovim-d7f7450017b9b05303698a6cda54303ef22c63b3.tar.bz2 rneovim-d7f7450017b9b05303698a6cda54303ef22c63b3.zip |
refactor(treesitter)!: rename help parser to vimdoc
-rw-r--r-- | cmake.deps/CMakeLists.txt | 4 | ||||
-rw-r--r-- | cmake.deps/cmake/BuildTreesitterParsers.cmake | 6 | ||||
-rw-r--r-- | runtime/doc/news.txt | 4 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/language.lua | 4 | ||||
-rw-r--r-- | runtime/queries/vimdoc/highlights.scm (renamed from runtime/queries/help/highlights.scm) | 0 | ||||
-rw-r--r-- | runtime/queries/vimdoc/injections.scm (renamed from runtime/queries/help/injections.scm) | 0 | ||||
-rw-r--r-- | scripts/gen_help_html.lua | 6 |
7 files changed, 15 insertions, 9 deletions
diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt index d2cdf700d0..bc13ab185f 100644 --- a/cmake.deps/CMakeLists.txt +++ b/cmake.deps/CMakeLists.txt @@ -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_SHA256 7ca85fa1a5a9e4d057ff3b7ae53d13d31371973e734ada87a83f3f6cbe9c0e32) -set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.3.0.tar.gz) -set(TREESITTER_HELP_SHA256 f33f6d49c7d71feb2fd68ef2b2684da150f9f8e486ad9726213631d673942331) +set(TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/b2ec4ec5f7be24cb6f7ccffafd7204477fe5784a.tar.gz) +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_SHA256 e2b806f80e8bf1c4f4e5a96248393fe6622fc1fc6189d6896d269658f67f914c) diff --git a/cmake.deps/cmake/BuildTreesitterParsers.cmake b/cmake.deps/cmake/BuildTreesitterParsers.cmake index 1202e4f7a4..ef7d521249 100644 --- a/cmake.deps/cmake/BuildTreesitterParsers.cmake +++ b/cmake.deps/cmake/BuildTreesitterParsers.cmake @@ -38,9 +38,9 @@ BuildTSParser( CMAKE_FILE TreesitterParserCMakeLists.txt) BuildTSParser( - LANG help - URL ${TREESITTER_HELP_URL} - SHA256 ${TREESITTER_HELP_SHA256} + LANG vimdoc + URL ${TREESITTER_VIMDOC_URL} + SHA256 ${TREESITTER_VIMDOC_SHA256} CMAKE_FILE TreesitterParserCMakeLists.txt) BuildTSParser( diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 401719b432..671bdee31b 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -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()|. +• `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* diff --git a/runtime/lua/vim/treesitter/language.lua b/runtime/lua/vim/treesitter/language.lua index b1c788e6ba..5b74bb6200 100644 --- a/runtime/lua/vim/treesitter/language.lua +++ b/runtime/lua/vim/treesitter/language.lua @@ -4,7 +4,9 @@ local a = vim.api local M = {} ---@type table<string,string> -local ft_to_lang = {} +local ft_to_lang = { + help = 'vimdoc', +} --- Get the filetypes associated with the parser named {lang}. --- @param lang string Name of parser diff --git a/runtime/queries/help/highlights.scm b/runtime/queries/vimdoc/highlights.scm index c0d88301bc..c0d88301bc 100644 --- a/runtime/queries/help/highlights.scm +++ b/runtime/queries/vimdoc/highlights.scm diff --git a/runtime/queries/help/injections.scm b/runtime/queries/vimdoc/injections.scm index 260a05d863..260a05d863 100644 --- a/runtime/queries/help/injections.scm +++ b/runtime/queries/vimdoc/injections.scm diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 2563f2f410..367ce60765 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -624,7 +624,7 @@ local function get_helptags(help_dir) return m 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() if not vim.o.runtimepath:find('build/lib/nvim/') then vim.cmd[[set runtimepath^=./build/lib/nvim/]] @@ -643,8 +643,8 @@ local function parse_buf(fname) buf = fname vim.cmd('sbuffer '..tostring(fname)) -- Buffer number. end - -- vim.treesitter.require_language('help', './build/lib/nvim/parser/help.so') - local lang_tree = vim.treesitter.get_parser(buf, 'help') + -- vim.treesitter.require_language('help', './build/lib/nvim/parser/vimdoc.so') + local lang_tree = vim.treesitter.get_parser(buf) return lang_tree, buf end |