diff options
author | Jongwook Choi <wookayin@gmail.com> | 2024-01-28 20:53:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-28 17:53:14 -0800 |
commit | 5b1b765610ae12ebd6400aafd068903569ee441a (patch) | |
tree | ab2372e5d076ed31472e4be2f03117f8fe87c1d3 | |
parent | b0e85010fe8128a73d6aeae1af3a308d3791140f (diff) | |
download | rneovim-5b1b765610ae12ebd6400aafd068903569ee441a.tar.gz rneovim-5b1b765610ae12ebd6400aafd068903569ee441a.tar.bz2 rneovim-5b1b765610ae12ebd6400aafd068903569ee441a.zip |
docs: enforce "treesitter" spelling #27110
It's the "tree-sitter" project, but "treesitter" in our code and docs.
-rw-r--r-- | runtime/doc/filetype.txt | 2 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 2 | ||||
-rw-r--r-- | runtime/doc/treesitter.txt | 14 | ||||
-rw-r--r-- | runtime/ftplugin/query.lua | 2 | ||||
-rw-r--r-- | runtime/indent/query.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/highlight.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/dev.lua | 2 | ||||
-rw-r--r-- | runtime/syntax/query.lua | 2 | ||||
-rw-r--r-- | scripts/gen_help_html.lua | 19 | ||||
-rw-r--r-- | src/nvim/buffer_defs.h | 2 | ||||
-rw-r--r-- | src/nvim/lua/treesitter.c | 4 |
12 files changed, 33 insertions, 22 deletions
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 29b929b8a5..97ebdf48c1 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -687,7 +687,7 @@ To disable this behavior, set the following variable in your vimrc: > QUERY *ft-query-plugin* -Linting of tree-sitter queries for installed parsers using +Linting of treesitter queries for installed parsers using |vim.treesitter.query.lint()| is enabled by default on `BufEnter` and `BufWrite`. To change the events that trigger linting, use >lua diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 7aa2fd5a6f..c2f5941a5c 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -619,7 +619,7 @@ vim.highlight.on_yank({opts}) *vim.highlight.on_yank()* vim.highlight.priorities *vim.highlight.priorities* Table with default priorities used for highlighting: • `syntax`: `50`, used for standard syntax highlighting - • `treesitter`: `100`, used for tree-sitter-based highlighting + • `treesitter`: `100`, used for treesitter-based highlighting • `semantic_tokens`: `125`, used for LSP semantic token highlighting • `diagnostics`: `150`, used for code analysis such as diagnostics • `user`: `200`, used for user-triggered highlights such as LSP document diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 0f4462b109..2755cd421b 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -17,7 +17,7 @@ changes. This documentation may also not fully reflect the latest changes. ============================================================================== PARSER FILES *treesitter-parsers* -Parsers are the heart of tree-sitter. They are libraries that tree-sitter will +Parsers are the heart of treesitter. They are libraries that treesitter will search for in the `parser` runtime directory. By default, Nvim bundles parsers for C, Lua, Vimscript, Vimdoc and Treesitter query files, but parsers can be installed via a plugin like https://github.com/nvim-treesitter/nvim-treesitter @@ -43,7 +43,7 @@ TREESITTER TREES *treesitter-tree* A "treesitter tree" represents the parsed contents of a buffer, which can be used to perform further analysis. It is a |userdata| reference to an object -held by the tree-sitter library. +held by the treesitter library. An instance `TSTree` of a treesitter tree supports the following methods. @@ -59,7 +59,7 @@ TREESITTER NODES *treesitter-node* A "treesitter node" represents one specific element of the parsed contents of a buffer, which can be captured by a |Query| for, e.g., highlighting. It is -a |userdata| reference to an object held by the tree-sitter library. +a |userdata| reference to an object held by the treesitter library. An instance `TSNode` of a treesitter node supports the following methods. @@ -563,7 +563,7 @@ Conceals specified in this way respect 'conceallevel'. *treesitter-highlight-priority* Treesitter uses |nvim_buf_set_extmark()| to set highlights with a default priority of 100. This enables plugins to set a highlighting priority lower or -higher than tree-sitter. It is also possible to change the priority of an +higher than treesitter. It is also possible to change the priority of an individual query pattern manually by setting its `"priority"` metadata attribute: >query @@ -624,17 +624,17 @@ associated with patterns: VIM.TREESITTER *lua-treesitter* The remainder of this document is a reference manual for the `vim.treesitter` -Lua module, which is the main interface for Nvim's tree-sitter integration. +Lua module, which is the main interface for Nvim's treesitter integration. Most of the following content is automatically generated from the function documentation. *vim.treesitter.language_version* -The latest parser ABI version that is supported by the bundled tree-sitter +The latest parser ABI version that is supported by the bundled treesitter library. *vim.treesitter.minimum_language_version* -The earliest parser ABI version that is supported by the bundled tree-sitter +The earliest parser ABI version that is supported by the bundled treesitter library. ============================================================================== diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index 964c221ad4..c75dc30430 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -1,5 +1,5 @@ -- Neovim filetype plugin file --- Language: Tree-sitter query +-- Language: Treesitter query -- Last Change: 2023 Aug 23 if vim.b.did_ftplugin == 1 then diff --git a/runtime/indent/query.lua b/runtime/indent/query.lua index c86948e95e..3261376d87 100644 --- a/runtime/indent/query.lua +++ b/runtime/indent/query.lua @@ -1,5 +1,5 @@ -- Neovim indent file --- Language: Tree-sitter query +-- Language: Treesitter query -- Last Change: 2022 Mar 29 -- it's a lisp! diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 7e1803f640..fbcca2dcfd 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1909,7 +1909,7 @@ local pattern = { ['.*baseq[2-3]/.*%.cfg'] = 'quake', ['.*quake[1-3]/.*%.cfg'] = 'quake', ['.*id1/.*%.cfg'] = 'quake', - ['.*/queries/.*%.scm'] = 'query', -- tree-sitter queries (Neovim only) + ['.*/queries/.*%.scm'] = 'query', -- treesitter queries (Neovim only) ['.*,v'] = 'rcs', ['%.reminders.*'] = starsetf('remind'), ['[rR]akefile.*'] = starsetf('ruby'), diff --git a/runtime/lua/vim/highlight.lua b/runtime/lua/vim/highlight.lua index fc2fd43c97..1d04f95d2d 100644 --- a/runtime/lua/vim/highlight.lua +++ b/runtime/lua/vim/highlight.lua @@ -26,7 +26,7 @@ local M = {} --- Table with default priorities used for highlighting: --- - `syntax`: `50`, used for standard syntax highlighting ---- - `treesitter`: `100`, used for tree-sitter-based highlighting +--- - `treesitter`: `100`, used for treesitter-based highlighting --- - `semantic_tokens`: `125`, used for LSP semantic token highlighting --- - `diagnostics`: `150`, used for code analysis such as diagnostics --- - `user`: `200`, used for user-triggered highlights such as LSP document diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index 399d0ef03e..5020dd87e7 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -14,7 +14,7 @@ local M = {} local TSTreeView = {} ---@class TSP.Node ----@field node TSNode Tree-sitter node +---@field node TSNode Treesitter node ---@field field string? Node field ---@field depth integer Depth of this node in the tree ---@field text string? Text displayed in the inspector for this node. Not computed until the diff --git a/runtime/syntax/query.lua b/runtime/syntax/query.lua index 8f40b1cb8a..1e129dbeff 100644 --- a/runtime/syntax/query.lua +++ b/runtime/syntax/query.lua @@ -1,5 +1,5 @@ -- Neovim syntax file --- Language: Tree-sitter query +-- Language: Treesitter query -- Last Change: 2022 Apr 13 -- it's a lisp! diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 20174bab97..8bc7d99985 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -42,9 +42,14 @@ local spell_dict = { VimL = 'Vimscript', vimL = 'Vimscript', viml = 'Vimscript', + ['tree-sitter'] = 'treesitter', + ['Tree-sitter'] = 'Treesitter', } +--- specify the list of keywords to ignore (i.e. allow), or true to disable spell check completely. +--- @type table<string, true|string[]> local spell_ignore_files = { - ['backers.txt'] = 'true', + ['backers.txt'] = true, + ['news.txt'] = { 'tree-sitter' }, -- in news, may refer to the upstream "tree-sitter" library } local language = nil @@ -398,9 +403,15 @@ local function visit_validate(root, level, lang_tree, opt, stats) then local text_nopunct = vim.fn.trim(text, '.,', 0) -- Ignore some punctuation. local fname_basename = assert(vim.fs.basename(opt.fname)) - if spell_dict[text_nopunct] and not spell_ignore_files[fname_basename] then - invalid_spelling[text_nopunct] = invalid_spelling[text_nopunct] or {} - invalid_spelling[text_nopunct][fname_basename] = node_text(root:parent()) + if spell_dict[text_nopunct] then + local should_ignore = ( + spell_ignore_files[fname_basename] == true + or vim.tbl_contains(spell_ignore_files[fname_basename] --[[ @as string[] ]], text_nopunct) + ) + if not should_ignore then + invalid_spelling[text_nopunct] = invalid_spelling[text_nopunct] or {} + invalid_spelling[text_nopunct][fname_basename] = node_text(root:parent()) + end end elseif node_name == 'url' then local fixed_url, _ = fix_url(trim(text)) diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 79527176ab..24f97dd92c 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -713,7 +713,7 @@ struct file_buffer { // Measurements of the deleted or replaced region since the last update // event. Some consumers of buffer changes need to know the byte size (like - // tree-sitter) or the corresponding UTF-32/UTF-16 size (like LSP) of the + // treesitter) or the corresponding UTF-32/UTF-16 size (like LSP) of the // deleted text. size_t deleted_bytes; size_t deleted_bytes2; diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 8b62bff496..de17aabca2 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -1,5 +1,5 @@ -// lua bindings for tree-sitter. -// NB: this file mostly contains a generic lua interface for tree-sitter +// lua bindings for treesitter. +// NB: this file mostly contains a generic lua interface for treesitter // trees and nodes, and could be broken out as a reusable lua package #include <assert.h> |