mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 17:41:48 +00:00
docs: dev, lsp, indent-guides #39756
- document "indent guides" https://github.com/neovim/neovim/issues/39726 - document guidance for "subcommands" https://github.com/neovim/neovim/issues/32263#issuecomment-4436002808 Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com>
This commit is contained in:
12
runtime/lua/vim/_meta/options.gen.lua
generated
12
runtime/lua/vim/_meta/options.gen.lua
generated
@@ -4158,7 +4158,7 @@ vim.wo.list = vim.o.list
|
||||
--- set listchars+=tab:>-,lead:.
|
||||
--- ```
|
||||
---
|
||||
--- *lcs-leadmultispace*
|
||||
--- *lcs-leadmultispace* *indent-guides*
|
||||
--- leadmultispace:c...
|
||||
--- Like the `lcs-multispace` value, but for leading
|
||||
--- spaces only. Also overrides `lcs-lead` for leading
|
||||
@@ -4171,6 +4171,16 @@ vim.wo.list = vim.o.list
|
||||
---
|
||||
--- Where "XXX" denotes the first non-blank characters in
|
||||
--- the line.
|
||||
---
|
||||
--- Combined with `lcs-leadtab`, this can be used to show
|
||||
--- "indentation guides" (vertical lines).
|
||||
--- For example, with 'shiftwidth' 2:
|
||||
---
|
||||
--- ```vim
|
||||
--- set list listchars=leadtab:\ \ │,tab:\ \ │,leadmultispace:\ \ │
|
||||
--- ```
|
||||
--- For richer rendering (per-level colors, treesitter-aware
|
||||
--- scopes, etc.) use a third-party plugin.
|
||||
--- *lcs-leadtab*
|
||||
--- leadtab:xy[z]
|
||||
--- Like `lcs-tab`, but only for leading tabs. When
|
||||
|
||||
@@ -274,9 +274,9 @@ end
|
||||
--- filetypes = { 'c', 'cpp' },
|
||||
--- }
|
||||
--- ```
|
||||
--- - Get the resolved configuration for "lua_ls":
|
||||
--- - Get the resolved configuration for "emmylua_ls":
|
||||
--- ```lua
|
||||
--- local cfg = vim.lsp.config.lua_ls
|
||||
--- local cfg = vim.lsp.config.emmylua_ls
|
||||
--- ```
|
||||
---
|
||||
---@since 13
|
||||
@@ -589,14 +589,14 @@ end
|
||||
---
|
||||
--- ```lua
|
||||
--- vim.lsp.enable('clangd')
|
||||
--- vim.lsp.enable({'lua_ls', 'pyright'})
|
||||
--- vim.lsp.enable({'emmylua_ls', 'pyright'})
|
||||
--- ```
|
||||
---
|
||||
--- Example: To _dynamically_ decide whether LSP is activated, define a |lsp-root_dir()| function
|
||||
--- which calls `on_dir()` only when you want that config to activate:
|
||||
---
|
||||
--- ```lua
|
||||
--- vim.lsp.config('lua_ls', {
|
||||
--- vim.lsp.config('emmylua_ls', {
|
||||
--- root_dir = function(bufnr, on_dir)
|
||||
--- if vim.fs.ext(vim.fn.bufname(bufnr)) ~= 'txt' then
|
||||
--- on_dir(vim.fn.getcwd())
|
||||
|
||||
@@ -1077,7 +1077,7 @@ end
|
||||
|
||||
--- Request workspace-wide diagnostics.
|
||||
--- @param opts? vim.lsp.WorkspaceDiagnosticsOpts
|
||||
--- @see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_dagnostics
|
||||
--- @see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_diagnostic
|
||||
function M.workspace_diagnostics(opts)
|
||||
validate('opts', opts, 'table', true)
|
||||
|
||||
|
||||
@@ -923,7 +923,7 @@ end
|
||||
--- - start_col (integer) Starting column for the search.
|
||||
---
|
||||
---@return (fun(end_line: integer|nil, end_col: integer|nil): integer, TSNode, vim.treesitter.query.TSMetadata, TSQueryMatch, TSTree):
|
||||
--- capture id, capture node, metadata, match, tree
|
||||
--- capture-id, capture-node, metadata, match, tree
|
||||
---
|
||||
---@note Captures are only returned if the query pattern of a specific capture contained predicates.
|
||||
function Query:iter_captures(node, source, start_row, end_row, opts)
|
||||
@@ -1040,7 +1040,7 @@ end
|
||||
--- - max_start_depth (integer) if non-zero, sets the maximum start depth
|
||||
--- for each match. This is used to prevent traversing too deep into a tree.
|
||||
---
|
||||
---@return (fun(): integer, table<integer, TSNode[]>, vim.treesitter.query.TSMetadata, TSTree): pattern id, match, metadata, tree
|
||||
---@return (fun(): integer, table<integer, TSNode[]>, vim.treesitter.query.TSMetadata, TSTree): pattern-id, match, metadata, tree
|
||||
function Query:iter_matches(node, source, start, stop, opts)
|
||||
opts = opts or {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user