mirror of
https://github.com/neovim/neovim.git
synced 2026-11-06 05:16:52 +00:00
fix(help): resolve generic and nullable type references
Problem: K on generic and nullable type annotations can jump to the wrong help tag. Generated See references repeat the type names. Solution: Strip generic arguments and nullable suffixes when resolving help tags. Remove the redundant generated See references. AI-assisted
This commit is contained in:
1 parent
937f835a3e
commit
cd52c77cd5
8 files changed
+117
-114
No files matched your search
+20
-25
@@ -506,7 +506,6 @@ Lua module: vim.diagnostic *diagnostic-api*
|
||||
with {diagnostic}.
|
||||
• {diagnostic}? (`vim.Diagnostic`) The diagnostic to jump to. Mutually
|
||||
exclusive with {count}, {namespace}, and {severity}.
|
||||
See |vim.Diagnostic|.
|
||||
• {on_jump}? (`fun(diagnostic:vim.Diagnostic?, bufnr:integer)`)
|
||||
Optional callback invoked with the diagnostic that was
|
||||
jumped to.
|
||||
@@ -526,7 +525,7 @@ Lua module: vim.diagnostic *diagnostic-api*
|
||||
Fields: ~
|
||||
• {disabled}? (`boolean`)
|
||||
• {name} (`string`)
|
||||
• {opts} (`vim.diagnostic.Opts`) See |vim.diagnostic.Opts|.
|
||||
• {opts} (`vim.diagnostic.Opts`)
|
||||
• {user_data} (`table`)
|
||||
|
||||
*vim.diagnostic.Opts*
|
||||
@@ -555,8 +554,7 @@ Lua module: vim.diagnostic *diagnostic-api*
|
||||
• {signs}? (`boolean|vim.diagnostic.Opts.Signs|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.Signs`, default: `true`)
|
||||
Use signs for diagnostics |diagnostic-signs|.
|
||||
• {status}? (`vim.diagnostic.Opts.Status`) Options for the
|
||||
statusline component. See
|
||||
|vim.diagnostic.Opts.Status|.
|
||||
statusline component.
|
||||
• {underline}? (`boolean|vim.diagnostic.Opts.Underline|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.Underline`, default: `true`)
|
||||
Used to call attention to a diagnostic
|
||||
("underline" is a misnomer). Controls the
|
||||
@@ -807,7 +805,7 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
|
||||
|
||||
Return: ~
|
||||
(`vim.diagnostic.Opts?`) Current diagnostic config if {opts} is
|
||||
omitted. See |vim.diagnostic.Opts|.
|
||||
omitted.
|
||||
|
||||
count({buf}, {opts}) *vim.diagnostic.count()*
|
||||
Get current diagnostics count.
|
||||
@@ -815,7 +813,7 @@ count({buf}, {opts}) *vim.diagnostic.count()*
|
||||
Parameters: ~
|
||||
• {buf} (`integer?`) Buffer number to get diagnostics from. Use 0 for
|
||||
current buffer or nil for all buffers.
|
||||
• {opts} (`vim.diagnostic.GetOpts?`) See |vim.diagnostic.GetOpts|.
|
||||
• {opts} (`vim.diagnostic.GetOpts?`)
|
||||
|
||||
Return: ~
|
||||
(`table<integer, integer>`) Table with actually present severity
|
||||
@@ -849,7 +847,7 @@ fromqflist({list}, {opts}) *vim.diagnostic.fromqflist()*
|
||||
newline. (default: false)
|
||||
|
||||
Return: ~
|
||||
(`vim.Diagnostic[]`) See |vim.Diagnostic|.
|
||||
(`vim.Diagnostic[]`)
|
||||
|
||||
get({buf}, {opts}) *vim.diagnostic.get()*
|
||||
Get current diagnostics.
|
||||
@@ -860,11 +858,11 @@ get({buf}, {opts}) *vim.diagnostic.get()*
|
||||
Parameters: ~
|
||||
• {buf} (`integer?`) Buffer number to get diagnostics from. Use 0 for
|
||||
current buffer or nil for all buffers.
|
||||
• {opts} (`vim.diagnostic.GetOpts?`) See |vim.diagnostic.GetOpts|.
|
||||
• {opts} (`vim.diagnostic.GetOpts?`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Diagnostic[]`) Fields `buf`, `end_lnum`, `end_col`, and
|
||||
`severity` are guaranteed to be present. See |vim.Diagnostic|.
|
||||
`severity` are guaranteed to be present.
|
||||
|
||||
get_namespace({namespace}) *vim.diagnostic.get_namespace()*
|
||||
Get namespace metadata.
|
||||
@@ -873,7 +871,7 @@ get_namespace({namespace}) *vim.diagnostic.get_namespace()*
|
||||
• {namespace} (`integer`) Diagnostic namespace
|
||||
|
||||
Return: ~
|
||||
(`vim.diagnostic.NS`) Namespace metadata. See |vim.diagnostic.NS|.
|
||||
(`vim.diagnostic.NS`) Namespace metadata
|
||||
|
||||
get_namespaces() *vim.diagnostic.get_namespaces()*
|
||||
Get current diagnostic namespaces.
|
||||
@@ -886,19 +884,19 @@ get_next({opts}) *vim.diagnostic.get_next()*
|
||||
Get the next diagnostic closest to the cursor position.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.diagnostic.JumpOpts?`) See |vim.diagnostic.JumpOpts|.
|
||||
• {opts} (`vim.diagnostic.JumpOpts?`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Diagnostic?`) Next diagnostic. See |vim.Diagnostic|.
|
||||
(`vim.Diagnostic?`) Next diagnostic
|
||||
|
||||
get_prev({opts}) *vim.diagnostic.get_prev()*
|
||||
Get the previous diagnostic closest to the cursor position.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.diagnostic.JumpOpts?`) See |vim.diagnostic.JumpOpts|.
|
||||
• {opts} (`vim.diagnostic.JumpOpts?`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Diagnostic?`) Previous diagnostic. See |vim.Diagnostic|.
|
||||
(`vim.Diagnostic?`) Previous diagnostic
|
||||
|
||||
hide({namespace}, {buf}) *vim.diagnostic.hide()*
|
||||
Hide currently displayed diagnostics.
|
||||
@@ -936,11 +934,10 @@ jump({opts}) *vim.diagnostic.jump()*
|
||||
Move to a diagnostic.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.diagnostic.JumpOpts`) See |vim.diagnostic.JumpOpts|.
|
||||
• {opts} (`vim.diagnostic.JumpOpts`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Diagnostic?`) The diagnostic that was moved to. See
|
||||
|vim.Diagnostic|.
|
||||
(`vim.Diagnostic?`) The diagnostic that was moved to.
|
||||
|
||||
*vim.diagnostic.match()*
|
||||
match({str}, {pat}, {groups}, {severity_map}, {defaults})
|
||||
@@ -976,8 +973,7 @@ open_float({opts}) *vim.diagnostic.open_float()*
|
||||
Show diagnostics in a floating window.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.diagnostic.Opts.Float?`) See
|
||||
|vim.diagnostic.Opts.Float|.
|
||||
• {opts} (`vim.diagnostic.Opts.Float?`)
|
||||
|
||||
Return (multiple): ~
|
||||
(`integer?`) float_bufnr
|
||||
@@ -1003,9 +999,9 @@ set({namespace}, {buf}, {diagnostics}, {opts}) *vim.diagnostic.set()*
|
||||
Parameters: ~
|
||||
• {namespace} (`integer`) The diagnostic namespace
|
||||
• {buf} (`integer`) Buffer number
|
||||
• {diagnostics} (`vim.Diagnostic.Set[]`) See |vim.Diagnostic.Set|.
|
||||
• {diagnostics} (`vim.Diagnostic.Set[]`)
|
||||
• {opts} (`vim.diagnostic.Opts?`) Display options to pass to
|
||||
|vim.diagnostic.show()|. See |vim.diagnostic.Opts|.
|
||||
|vim.diagnostic.show()|
|
||||
|
||||
setloclist({opts}) *vim.diagnostic.setloclist()*
|
||||
Add buffer diagnostics to the location list.
|
||||
@@ -1061,9 +1057,8 @@ show({namespace}, {buf}, {diagnostics}, {opts}) *vim.diagnostic.show()*
|
||||
namespace and buffer. This can be used to display a
|
||||
list of diagnostics without saving them or to display
|
||||
only a subset of diagnostics. May not be used when
|
||||
{namespace} or {buf} is nil. See |vim.Diagnostic|.
|
||||
• {opts} (`vim.diagnostic.Opts?`) Display options. See
|
||||
|vim.diagnostic.Opts|.
|
||||
{namespace} or {buf} is nil.
|
||||
• {opts} (`vim.diagnostic.Opts?`) Display options.
|
||||
|
||||
status({buf}) *vim.diagnostic.status()*
|
||||
Returns formatted string with diagnostics for the current buffer. The
|
||||
@@ -1083,7 +1078,7 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()*
|
||||
passed to |setqflist()| or |setloclist()|.
|
||||
|
||||
Parameters: ~
|
||||
• {diagnostics} (`vim.Diagnostic[]`) See |vim.Diagnostic|.
|
||||
• {diagnostics} (`vim.Diagnostic[]`)
|
||||
|
||||
Return: ~
|
||||
(`table[]`) Quickfix list items |setqflist-what|
|
||||
|
||||
+18
-25
@@ -1153,7 +1153,7 @@ config({name}, {cfg}) *vim.lsp.config()*
|
||||
|
||||
Parameters: ~
|
||||
• {name} (`string`)
|
||||
• {cfg} (`vim.lsp.Config`) See |vim.lsp.Config|.
|
||||
• {cfg} (`vim.lsp.Config`)
|
||||
|
||||
enable({name}, {enable}) *vim.lsp.enable()*
|
||||
Enables a |lsp-config|: automatically attaches the client to any buffer
|
||||
@@ -1284,7 +1284,7 @@ get_client_by_id({client_id}) *vim.lsp.get_client_by_id()*
|
||||
• {client_id} (`integer`) client id
|
||||
|
||||
Return: ~
|
||||
(`vim.lsp.Client?`) client rpc object. See |vim.lsp.Client|.
|
||||
(`vim.lsp.Client?`) client rpc object
|
||||
|
||||
get_clients({filter}) *vim.lsp.get_clients()*
|
||||
Gets active clients.
|
||||
@@ -1398,8 +1398,7 @@ start({config}, {opts}) *vim.lsp.start()*
|
||||
Since: 0.8.0
|
||||
|
||||
Parameters: ~
|
||||
• {config} (`vim.lsp.ClientConfig`) Configuration for the server. See
|
||||
|vim.lsp.ClientConfig|.
|
||||
• {config} (`vim.lsp.ClientConfig`) Configuration for the server.
|
||||
• {opts} (`table?`) Optional keyword arguments.
|
||||
• {attach}? (`boolean`) Whether to attach the client to a
|
||||
buffer (default true). If set to `false`, `reuse_client`
|
||||
@@ -1576,13 +1575,13 @@ declaration({opts}) *vim.lsp.buf.declaration()*
|
||||
|vim.lsp.buf.definition()| instead.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.lsp.ListOpts?`) See |vim.lsp.ListOpts|.
|
||||
• {opts} (`vim.lsp.ListOpts?`)
|
||||
|
||||
definition({opts}) *vim.lsp.buf.definition()*
|
||||
Jumps to the definition of the symbol under the cursor.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.lsp.ListOpts?`) See |vim.lsp.ListOpts|.
|
||||
• {opts} (`vim.lsp.ListOpts?`)
|
||||
|
||||
document_highlight() *vim.lsp.buf.document_highlight()*
|
||||
Send request to the server to resolve document highlights for the current
|
||||
@@ -1602,7 +1601,7 @@ document_symbol({opts}) *vim.lsp.buf.document_symbol()*
|
||||
Lists all symbols in the current buffer in the |location-list|.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.lsp.ListOpts?`) See |vim.lsp.ListOpts|.
|
||||
• {opts} (`vim.lsp.ListOpts?`)
|
||||
|
||||
format({opts}) *vim.lsp.buf.format()*
|
||||
Formats a buffer using the attached (and optionally filtered) language
|
||||
@@ -1663,14 +1662,14 @@ hover({config}) *vim.lsp.buf.hover()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {config} (`vim.lsp.buf.hover.Opts?`) See |vim.lsp.buf.hover.Opts|.
|
||||
• {config} (`vim.lsp.buf.hover.Opts?`)
|
||||
|
||||
implementation({opts}) *vim.lsp.buf.implementation()*
|
||||
Lists all the implementations for the symbol under the cursor in the
|
||||
quickfix window.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.lsp.ListOpts?`) See |vim.lsp.ListOpts|.
|
||||
• {opts} (`vim.lsp.ListOpts?`)
|
||||
|
||||
incoming_calls() *vim.lsp.buf.incoming_calls()*
|
||||
Lists all the call sites of the symbol under the cursor in the |quickfix|
|
||||
@@ -1691,7 +1690,7 @@ references({context}, {opts}) *vim.lsp.buf.references()*
|
||||
|
||||
Parameters: ~
|
||||
• {context} (`lsp.ReferenceContext?`) Context for the request
|
||||
• {opts} (`vim.lsp.ListOpts?`) See |vim.lsp.ListOpts|.
|
||||
• {opts} (`vim.lsp.ListOpts?`)
|
||||
|
||||
See also: ~
|
||||
• https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references
|
||||
@@ -1742,14 +1741,13 @@ signature_help({config}) *vim.lsp.buf.signature_help()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {config} (`vim.lsp.buf.signature_help.Opts?`) See
|
||||
|vim.lsp.buf.signature_help.Opts|.
|
||||
• {config} (`vim.lsp.buf.signature_help.Opts?`)
|
||||
|
||||
type_definition({opts}) *vim.lsp.buf.type_definition()*
|
||||
Jumps to the definition of the type of the symbol under the cursor.
|
||||
|
||||
Parameters: ~
|
||||
• {opts} (`vim.lsp.ListOpts?`) See |vim.lsp.ListOpts|.
|
||||
• {opts} (`vim.lsp.ListOpts?`)
|
||||
|
||||
typehierarchy({kind}) *vim.lsp.buf.typehierarchy()*
|
||||
Lists all the subtypes or supertypes of the symbol under the cursor in the
|
||||
@@ -1780,7 +1778,7 @@ workspace_symbol({query}, {opts}) *vim.lsp.buf.workspace_symbol()*
|
||||
|
||||
Parameters: ~
|
||||
• {query} (`string?`) optional
|
||||
• {opts} (`vim.lsp.ListOpts?`) See |vim.lsp.ListOpts|.
|
||||
• {opts} (`vim.lsp.ListOpts?`)
|
||||
|
||||
|
||||
==============================================================================
|
||||
@@ -1799,8 +1797,7 @@ Lua module: vim.lsp.client *lsp-client*
|
||||
• {commands} (`table<string,fun(command: lsp.Command, ctx: table)>`)
|
||||
Client commands. See |vim.lsp.ClientConfig|.
|
||||
• {config} (`vim.lsp.ClientConfig`) Copy of the config
|
||||
passed to |vim.lsp.start()|. See
|
||||
|vim.lsp.ClientConfig|.
|
||||
passed to |vim.lsp.start()|.
|
||||
• {dynamic_capabilities} (`lsp.DynamicCapabilities`) Capabilities
|
||||
provided at runtime (after startup).
|
||||
• {exec_cmd} (`fun(self: vim.lsp.Client, cmd: lsp.Command, context: {bufnr?: integer}?, handler: lsp.Handler?)`)
|
||||
@@ -1832,8 +1829,7 @@ Lua module: vim.lsp.client *lsp-client*
|
||||
See |Client:on_attach()|.
|
||||
• {progress} (`vim.lsp.Client.Progress`) A ring buffer
|
||||
(|vim.ringbuf()|) containing progress messages
|
||||
sent by the server. See
|
||||
|vim.lsp.Client.Progress|.
|
||||
sent by the server.
|
||||
• {request} (`fun(self: vim.lsp.Client, method: string, params: table?, handler: lsp.Handler?, bufnr: integer?): boolean, integer?`)
|
||||
See |Client:request()|.
|
||||
• {request_sync} (`fun(self: vim.lsp.Client, method: string, params: table, timeout_ms: integer?, bufnr: integer?): {err: lsp.ResponseError?, result:any}?, string?`)
|
||||
@@ -2808,7 +2804,7 @@ start({cmd}, {dispatchers}, {extra_spawn_params}) *vim.lsp.rpc.start()*
|
||||
See |vim.system()|
|
||||
|
||||
Return: ~
|
||||
(`vim.lsp.rpc.Client`) See |vim.lsp.rpc.Client|.
|
||||
(`vim.lsp.rpc.Client`)
|
||||
|
||||
|
||||
==============================================================================
|
||||
@@ -3074,8 +3070,7 @@ make_floating_popup_options({width}, {height}, {opts})
|
||||
Parameters: ~
|
||||
• {width} (`integer`) window width (in character cells)
|
||||
• {height} (`integer`) window height (in character cells)
|
||||
• {opts} (`vim.lsp.util.open_floating_preview.Opts?`) See
|
||||
|vim.lsp.util.open_floating_preview.Opts|.
|
||||
• {opts} (`vim.lsp.util.open_floating_preview.Opts?`)
|
||||
|
||||
Return: ~
|
||||
(`vim.api.keyset.win_config`)
|
||||
@@ -3179,8 +3174,7 @@ open_floating_preview({contents}, {syntax}, {opts})
|
||||
• {opts} (`vim.lsp.util.open_floating_preview.Opts?`) with optional
|
||||
fields (additional keys are filtered with
|
||||
|vim.lsp.util.make_floating_popup_options()| before they
|
||||
are passed on to |nvim_open_win()|). See
|
||||
|vim.lsp.util.open_floating_preview.Opts|.
|
||||
are passed on to |nvim_open_win()|)
|
||||
|
||||
Return (multiple): ~
|
||||
(`integer`) bufnr of newly created float window
|
||||
@@ -3196,8 +3190,7 @@ preview_location({location}, {opts}) *vim.lsp.util.preview_location()*
|
||||
|
||||
Parameters: ~
|
||||
• {location} (`lsp.Location|lsp.LocationLink`)
|
||||
• {opts} (`vim.lsp.util.open_floating_preview.Opts?`) See
|
||||
|vim.lsp.util.open_floating_preview.Opts|.
|
||||
• {opts} (`vim.lsp.util.open_floating_preview.Opts?`)
|
||||
|
||||
Return (multiple): ~
|
||||
(`integer?`) buffer id of float window
|
||||
|
||||
+34
-37
@@ -2034,7 +2034,7 @@ vim.ringbuf({size}) *vim.ringbuf()*
|
||||
• {size} (`integer`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Ringbuf`) ringbuf See |vim.Ringbuf|.
|
||||
(`vim.Ringbuf`) ringbuf
|
||||
|
||||
vim.spairs({t}) *vim.spairs()*
|
||||
Enumerates key-value pairs of a table, ordered by key.
|
||||
@@ -4025,7 +4025,7 @@ get_level({log}) *vim.log.get_level()*
|
||||
Gets the current log level.
|
||||
|
||||
Parameters: ~
|
||||
• {log} (`vim.Log`) See |vim.Log|.
|
||||
• {log} (`vim.Log`)
|
||||
|
||||
Return: ~
|
||||
(`vim.log.levels`)
|
||||
@@ -4050,7 +4050,7 @@ new({opts}) *vim.log.new()*
|
||||
by the logger.
|
||||
|
||||
Return: ~
|
||||
(`vim.Log`) See |vim.Log|.
|
||||
(`vim.Log`)
|
||||
|
||||
set_format_func({log}, {func}) *vim.log.set_format_func()*
|
||||
Sets the formatter used to produce log entries.
|
||||
@@ -4060,7 +4060,7 @@ set_format_func({log}, {func}) *vim.log.set_format_func()*
|
||||
or `nil` to skip it.
|
||||
|
||||
Parameters: ~
|
||||
• {log} (`vim.Log`) See |vim.Log|.
|
||||
• {log} (`vim.Log`)
|
||||
• {func} (`fun(min_level: vim.log.levels, level: vim.log.levels, ...): string?`)
|
||||
|
||||
set_level({log}, {level}) *vim.log.set_level()*
|
||||
@@ -4069,7 +4069,7 @@ set_level({log}, {level}) *vim.log.set_level()*
|
||||
Entries below this level are skipped.
|
||||
|
||||
Parameters: ~
|
||||
• {log} (`vim.Log`) See |vim.Log|.
|
||||
• {log} (`vim.Log`)
|
||||
• {level} (`vim.log.levels`)
|
||||
|
||||
|
||||
@@ -4640,7 +4640,7 @@ cursor({buf}, {pos}) *vim.pos.cursor()*
|
||||
• `fun(win?: integer): vim.Pos`
|
||||
|
||||
Return: ~
|
||||
(`vim.Pos`) See |vim.Pos|.
|
||||
(`vim.Pos`)
|
||||
|
||||
extmark({buf}, {row}, {col}) *vim.pos.extmark()*
|
||||
Creates a new |vim.Pos| from extmark position (see |api-indexing|).
|
||||
@@ -4655,7 +4655,7 @@ extmark({buf}, {row}, {col}) *vim.pos.extmark()*
|
||||
• {col} (`integer`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Pos`) See |vim.Pos|.
|
||||
(`vim.Pos`)
|
||||
|
||||
lsp({buf}, {pos}, {position_encoding}) *vim.pos.lsp()*
|
||||
Creates a new |vim.Pos| from `lsp.Position`.
|
||||
@@ -4675,7 +4675,7 @@ lsp({buf}, {pos}, {position_encoding}) *vim.pos.lsp()*
|
||||
• {position_encoding} (`lsp.PositionEncodingKind`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Pos`) See |vim.Pos|.
|
||||
(`vim.Pos`)
|
||||
|
||||
mark({buf}, {lnum}, {col}) *vim.pos.mark()*
|
||||
Creates a new |vim.Pos| from mark position (see |api-indexing|).
|
||||
@@ -4697,7 +4697,7 @@ mark({buf}, {lnum}, {col}) *vim.pos.mark()*
|
||||
• {col} (`integer`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Pos`) See |vim.Pos|.
|
||||
(`vim.Pos`)
|
||||
|
||||
offset({buf}, {offset}) *vim.pos.offset()*
|
||||
Creates a new |vim.Pos| from buffer (bytes) offset.
|
||||
@@ -4712,7 +4712,7 @@ offset({buf}, {offset}) *vim.pos.offset()*
|
||||
• {offset} (`integer`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Pos`) See |vim.Pos|.
|
||||
(`vim.Pos`)
|
||||
|
||||
to_cursor({pos}) *vim.pos.to_cursor()*
|
||||
Converts |vim.Pos| to cursor position (see |api-indexing|).
|
||||
@@ -4726,7 +4726,7 @@ to_cursor({pos}) *vim.pos.to_cursor()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {pos} (`vim.Pos`) See |vim.Pos|.
|
||||
• {pos} (`vim.Pos`)
|
||||
|
||||
Return: ~
|
||||
(`[integer, integer]`) (lnum, col) tuple
|
||||
@@ -4742,7 +4742,7 @@ to_extmark({pos}) *vim.pos.to_extmark()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {pos} (`vim.Pos`) See |vim.Pos|.
|
||||
• {pos} (`vim.Pos`)
|
||||
|
||||
Return (multiple): ~
|
||||
(`integer`) row
|
||||
@@ -4759,7 +4759,7 @@ to_lsp({pos}, {position_encoding}) *vim.pos.to_lsp()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {pos} (`vim.Pos`) See |vim.Pos|.
|
||||
• {pos} (`vim.Pos`)
|
||||
• {position_encoding} (`lsp.PositionEncodingKind`)
|
||||
|
||||
Return: ~
|
||||
@@ -4777,7 +4777,7 @@ to_mark({pos}) *vim.pos.to_mark()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {pos} (`vim.Pos`) See |vim.Pos|.
|
||||
• {pos} (`vim.Pos`)
|
||||
|
||||
Return (multiple): ~
|
||||
(`integer`) lnum
|
||||
@@ -4798,7 +4798,7 @@ to_offset({pos}) *vim.pos.to_offset()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {pos} (`vim.Pos`) See |vim.Pos|.
|
||||
• {pos} (`vim.Pos`)
|
||||
|
||||
Return: ~
|
||||
(`integer`)
|
||||
@@ -4866,13 +4866,13 @@ extmark({buf}, {start_row}, {start_col}, {end_row}, {end_col})
|
||||
• {end_col} (`integer`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Range`) See |vim.Range|.
|
||||
(`vim.Range`)
|
||||
|
||||
has({outer}, {inner}) *vim.range.has()*
|
||||
Checks whether {outer} range contains {inner} range or position.
|
||||
|
||||
Parameters: ~
|
||||
• {outer} (`vim.Range`) See |vim.Range|.
|
||||
• {outer} (`vim.Range`)
|
||||
• {inner} (`vim.Range|vim.Pos`)
|
||||
|
||||
Return: ~
|
||||
@@ -4883,18 +4883,18 @@ intersect({r1}, {r2}) *vim.range.intersect()*
|
||||
Computes the common range shared by the given ranges.
|
||||
|
||||
Parameters: ~
|
||||
• {r1} (`vim.Range`) First range to intersect. See |vim.Range|.
|
||||
• {r2} (`vim.Range`) Second range to intersect. See |vim.Range|.
|
||||
• {r1} (`vim.Range`) First range to intersect.
|
||||
• {r2} (`vim.Range`) Second range to intersect
|
||||
|
||||
Return: ~
|
||||
(`vim.Range?`) range that is present inside both `r1` and `r2`. `nil`
|
||||
if such range does not exist. See |vim.Range|.
|
||||
if such range does not exist.
|
||||
|
||||
is_empty({range}) *vim.range.is_empty()*
|
||||
Checks whether the given range is empty; i.e., start >= end.
|
||||
|
||||
Parameters: ~
|
||||
• {range} (`vim.Range`) See |vim.Range|.
|
||||
• {range} (`vim.Range`)
|
||||
|
||||
Return: ~
|
||||
(`boolean`) `true` if the given range is empty.
|
||||
@@ -4917,7 +4917,7 @@ lsp({buf}, {range}, {position_encoding}) *vim.range.lsp()*
|
||||
• {position_encoding} (`lsp.PositionEncodingKind`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Range`) See |vim.Range|.
|
||||
(`vim.Range`)
|
||||
|
||||
*vim.range.mark()*
|
||||
mark({buf}, {start_lnum}, {start_col}, {end_lnum}, {end_col})
|
||||
@@ -4940,7 +4940,7 @@ mark({buf}, {start_lnum}, {start_col}, {end_lnum}, {end_col})
|
||||
• {end_col} (`integer`)
|
||||
|
||||
Return: ~
|
||||
(`vim.Range`) See |vim.Range|.
|
||||
(`vim.Range`)
|
||||
|
||||
to_extmark({range}) *vim.range.to_extmark()*
|
||||
Converts |vim.Range| to extmark range (see |api-indexing|).
|
||||
@@ -4953,7 +4953,7 @@ to_extmark({range}) *vim.range.to_extmark()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {range} (`vim.Range`) See |vim.Range|.
|
||||
• {range} (`vim.Range`)
|
||||
|
||||
Return (multiple): ~
|
||||
(`integer`) start_row
|
||||
@@ -4972,7 +4972,7 @@ to_lsp({range}, {position_encoding}) *vim.range.to_lsp()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {range} (`vim.Range`) See |vim.Range|.
|
||||
• {range} (`vim.Range`)
|
||||
• {position_encoding} (`lsp.PositionEncodingKind`)
|
||||
|
||||
Return: ~
|
||||
@@ -4989,7 +4989,7 @@ to_mark({range}) *vim.range.to_mark()*
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
• {range} (`vim.Range`) See |vim.Range|.
|
||||
• {range} (`vim.Range`)
|
||||
|
||||
Return (multiple): ~
|
||||
(`integer`) start_lnum
|
||||
@@ -5206,7 +5206,7 @@ vim.snippet.active({filter}) *vim.snippet.active()*
|
||||
with:
|
||||
• `direction` (vim.snippet.Direction): Navigation direction.
|
||||
Will return `true` if the snippet can be jumped in the
|
||||
given direction. See |vim.snippet.ActiveFilter|.
|
||||
given direction.
|
||||
|
||||
Return: ~
|
||||
(`boolean`)
|
||||
@@ -5350,7 +5350,7 @@ SystemObj:wait({timeout}) *SystemObj:wait()*
|
||||
• {timeout} (`integer?`)
|
||||
|
||||
Return: ~
|
||||
(`vim.SystemCompleted`) See |vim.SystemCompleted|.
|
||||
(`vim.SystemCompleted`)
|
||||
|
||||
SystemObj:write({data}) *SystemObj:write()*
|
||||
Writes data to the stdin of the process or closes stdin.
|
||||
@@ -5438,7 +5438,7 @@ vim.system({cmd}, {opts}, {on_exit}) *vim.system()*
|
||||
• `fun(cmd: string[], on_exit: fun(out: vim.SystemCompleted)): vim.SystemObj`
|
||||
|
||||
Return: ~
|
||||
(`vim.SystemObj`) See |vim.SystemObj|.
|
||||
(`vim.SystemObj`)
|
||||
|
||||
|
||||
==============================================================================
|
||||
@@ -5628,8 +5628,7 @@ vim.ui.open({path}, {opt}) *vim.ui.open()*
|
||||
• {cmd}? (`string[]`) Command used to open the path or URL.
|
||||
|
||||
Return (multiple): ~
|
||||
(`vim.SystemObj?`) Command object, or nil if not found. See
|
||||
|vim.SystemObj|.
|
||||
(`vim.SystemObj?`) Command object, or nil if not found.
|
||||
(`string?`) Error message on failure, or nil on success.
|
||||
|
||||
See also: ~
|
||||
@@ -6013,14 +6012,12 @@ vim.version.intersect({r1}, {r2}) *vim.version.intersect()*
|
||||
Since: 0.12.0
|
||||
|
||||
Parameters: ~
|
||||
• {r1} (`vim.VersionRange`) First range to intersect. See
|
||||
|vim.VersionRange|.
|
||||
• {r2} (`vim.VersionRange`) Second range to intersect. See
|
||||
|vim.VersionRange|.
|
||||
• {r1} (`vim.VersionRange`) First range to intersect.
|
||||
• {r2} (`vim.VersionRange`) Second range to intersect.
|
||||
|
||||
Return: ~
|
||||
(`vim.VersionRange?`) Maximal range that is present inside both `r1`
|
||||
and `r2`. `nil` if such range does not exist. See |vim.VersionRange|.
|
||||
and `r2`. `nil` if such range does not exist.
|
||||
|
||||
vim.version.last({versions}) *vim.version.last()*
|
||||
TODO: generalize this, move to func.lua
|
||||
@@ -6092,7 +6089,7 @@ vim.version.range({spec}) *vim.version.range()*
|
||||
• {spec} (`string`) Version range "spec"
|
||||
|
||||
Return: ~
|
||||
(`vim.VersionRange?`) See |vim.VersionRange|.
|
||||
(`vim.VersionRange?`)
|
||||
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -557,8 +557,7 @@ get({names}, {opts}) *vim.pack.get()*
|
||||
• {branches}? (`string[]`) Available Git branches (first is default).
|
||||
Missing if `info=false`.
|
||||
• {manifest}? (`vim.pack.Manifest`) Data from the |vim.pack-manifest|.
|
||||
Empty in case of reading error. Missing if `info=false`. See
|
||||
|vim.pack.Manifest|.
|
||||
Empty in case of reading error. Missing if `info=false`.
|
||||
• {path} (`string`) Plugin's path on disk.
|
||||
• {rev} (`string`) Current Git revision. Taken from
|
||||
|vim.pack-lockfile| if `info=false`.
|
||||
|
||||
@@ -1630,7 +1630,7 @@ get({lang}, {query_name}) *vim.treesitter.query.get()*
|
||||
|
||||
Return: ~
|
||||
(`vim.treesitter.Query?`) Parsed query. `nil` if no query files are
|
||||
found. See |vim.treesitter.Query|.
|
||||
found.
|
||||
|
||||
*vim.treesitter.query.get_files()*
|
||||
get_files({lang}, {query_name}, {is_included})
|
||||
@@ -1721,7 +1721,7 @@ parse({lang}, {query}) *vim.treesitter.query.parse()*
|
||||
• {query} (`string`) Query text, in s-expr syntax
|
||||
|
||||
Return: ~
|
||||
(`vim.treesitter.Query`) Parsed query . See |vim.treesitter.Query|.
|
||||
(`vim.treesitter.Query`) Parsed query
|
||||
|
||||
See also: ~
|
||||
• |vim.treesitter.query.get()|
|
||||
|
||||
@@ -204,10 +204,13 @@ local function trim_tag(tag, offset)
|
||||
e = e - 1
|
||||
end
|
||||
|
||||
-- Truncate at "(" with args, e.g. "foo('bar')" => "foo".
|
||||
-- Truncate function or generic arguments, e.g. "foo('bar')" => "foo", "Task<R...>" => "Task".
|
||||
-- But keep "()" since it's part of valid tags like "vim.fn.expand()".
|
||||
for i = s, e do
|
||||
if tag:sub(i, i) == '(' and not (i + 1 <= e and tag:sub(i + 1, i + 1) == ')') then
|
||||
if
|
||||
tag:sub(i, i) == '<'
|
||||
or (tag:sub(i, i) == '(' and not (i + 1 <= e and tag:sub(i + 1, i + 1) == ')'))
|
||||
then
|
||||
e = i - 1
|
||||
break
|
||||
end
|
||||
@@ -251,6 +254,12 @@ function M.resolve_tag()
|
||||
return nil
|
||||
end
|
||||
|
||||
-- In type annotations, "?" means nullable rather than a help-search wildcard.
|
||||
local nullable_type = tag:match('^%(`([%w_.]+)[%[%]]*%?`%)$')
|
||||
if nullable_type and #vim.fn.getcompletion(nullable_type, 'help') > 0 then
|
||||
return nullable_type
|
||||
end
|
||||
|
||||
-- Compute cursor offset within <cWORD>.
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
local col = vim.fn.col('.') -- 1-indexed
|
||||
|
||||
+1
-21
@@ -692,27 +692,7 @@ local function inline_type(obj, classes)
|
||||
|
||||
local cls = get_class(ty, classes)
|
||||
|
||||
if not cls or cls.nodoc then
|
||||
return
|
||||
end
|
||||
|
||||
if not cls.inlinedoc then
|
||||
-- Not inlining so just add a: "See |tag|."
|
||||
local tag = fmt('|%s|', cls.name)
|
||||
if obj.desc and obj.desc:find(tag) then
|
||||
-- Tag already there
|
||||
return
|
||||
end
|
||||
|
||||
-- TODO(lewis6991): Aim to remove this. Need this to prevent dead
|
||||
-- references to types defined in runtime/lua/vim/lsp/_meta/protocol.lua
|
||||
if not vim.startswith(cls.name, 'vim.') then
|
||||
return
|
||||
end
|
||||
|
||||
obj.desc = obj.desc or ''
|
||||
local period = (obj.desc == '' or vim.endswith(obj.desc, '.')) and '' or '.'
|
||||
obj.desc = obj.desc .. fmt('%s See %s.', period, tag)
|
||||
if not cls or cls.nodoc or not cls.inlinedoc then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@@ -294,6 +294,36 @@ describe(':help', function()
|
||||
eq({ '*vim.lsp.codelens.run()*', 'lsp.txt' }, buf_word())
|
||||
end)
|
||||
|
||||
it('K resolves generic type names in help', function()
|
||||
command('helptags ++t $VIMRUNTIME/doc')
|
||||
for _, ty in ipairs({
|
||||
'vim.async.Task<R>',
|
||||
'vim.async.Task<R...>',
|
||||
'vim.async.Task<R>[]',
|
||||
}) do
|
||||
command('help lua-async')
|
||||
command('setlocal keywordprg=:help!')
|
||||
assert(fn.search('\\V(`' .. ty .. '`)', 'W') > 0)
|
||||
command('normal! fTK')
|
||||
eq({ '*vim.async.Task*', 'lua-async.txt' }, buf_word())
|
||||
end
|
||||
end)
|
||||
|
||||
it('K resolves nullable type names in help', function()
|
||||
command('helptags ++t $VIMRUNTIME/doc')
|
||||
for _, ref in ipairs({
|
||||
{ 'lsp', 'vim.lsp.Client', '?' },
|
||||
{ 'diagnostic', 'vim.Diagnostic', '?' },
|
||||
{ 'diagnostic', 'vim.Diagnostic', '[]?' },
|
||||
}) do
|
||||
command('help ' .. ref[1])
|
||||
command('setlocal keywordprg=:help!')
|
||||
assert(fn.search('\\V(`' .. ref[2] .. ref[3] .. '`)', 'W') > 0)
|
||||
command('normal! 2lK')
|
||||
eq({ '*' .. ref[2] .. '*', ref[1] .. '.txt' }, buf_word())
|
||||
end
|
||||
end)
|
||||
|
||||
it('window closed makes cursor return to a valid win/buf #9773', function()
|
||||
n.add_builddir_to_rtp()
|
||||
command('help help')
|
||||
|
||||
Reference in new issue
Block a user