docs(lsp): fix resolve_capabilities docstring (#16580)

This commit is contained in:
github-actions[bot] 2021-12-08 11:02:14 -07:00 committed by GitHub
parent 270f71b571
commit ce4c8010cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 151 deletions

View File

@ -1909,14 +1909,14 @@ make_client_capabilities()
*vim.lsp.protocol.resolve_capabilities()*
resolve_capabilities({server_capabilities})
`*` to match one or more characters in a path segment `?` to
match on one character in a path segment `**` to match any
number of path segments, including none `{}` to group
conditions (e.g. `**/*.{ts,js}` matches all TypeScript and
JavaScript files) `[]` to declare a range of characters to
match in a path segment (e.g., `example.[0-9]` to match on
`example.0` , `example.1` , …) `[!...]` to negate a range of
characters to match in a path segment (e.g., `example.[!0-9]`
to match on `example.a` , `example.b` , but not `example.0` )
Creates a normalized object describing LSP server
capabilities.
Parameters: ~
{server_capabilities} table Table of capabilities
supported by the server
Return: ~
table Normalized table of capabilities
vim:tw=78:ts=8:ft=help:norl:

View File

@ -776,149 +776,9 @@ function protocol.make_client_capabilities()
}
end
--[=[
export interface DocumentFilter {
--A language id, like `typescript`.
language?: string;
--A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
scheme?: string;
--A glob pattern, like `*.{ts,js}`.
--
--Glob patterns can have the following syntax:
--- `*` to match one or more characters in a path segment
--- `?` to match on one character in a path segment
--- `**` to match any number of path segments, including none
--- `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
--- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
--- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
pattern?: string;
}
--]=]
--[[
--Static registration options to be returned in the initialize request.
interface StaticRegistrationOptions {
--The id used to register the request. The id can be used to deregister
--the request again. See also Registration#id.
id?: string;
}
export interface DocumentFilter {
--A language id, like `typescript`.
language?: string;
--A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
scheme?: string;
--A glob pattern, like `*.{ts,js}`.
--
--Glob patterns can have the following syntax:
--- `*` to match one or more characters in a path segment
--- `?` to match on one character in a path segment
--- `**` to match any number of path segments, including none
--- `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
--- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
--- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
pattern?: string;
}
export type DocumentSelector = DocumentFilter[];
export interface TextDocumentRegistrationOptions {
--A document selector to identify the scope of the registration. If set to null
--the document selector provided on the client side will be used.
documentSelector: DocumentSelector | null;
}
--Code Action options.
export interface CodeActionOptions {
--CodeActionKinds that this server may return.
--
--The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
--may list out every specific kind they provide.
codeActionKinds?: CodeActionKind[];
}
interface ServerCapabilities {
--Defines how text documents are synced. Is either a detailed structure defining each notification or
--for backwards compatibility the TextDocumentSyncKind number. If omitted it defaults to `TextDocumentSyncKind.None`.
textDocumentSync?: TextDocumentSyncOptions | number;
--The server provides hover support.
hoverProvider?: boolean;
--The server provides completion support.
completionProvider?: CompletionOptions;
--The server provides signature help support.
signatureHelpProvider?: SignatureHelpOptions;
--The server provides goto definition support.
definitionProvider?: boolean;
--The server provides Goto Type Definition support.
--
--Since 3.6.0
typeDefinitionProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
--The server provides Goto Implementation support.
--
--Since 3.6.0
implementationProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
--The server provides find references support.
referencesProvider?: boolean;
--The server provides document highlight support.
documentHighlightProvider?: boolean;
--The server provides document symbol support.
documentSymbolProvider?: boolean;
--The server provides workspace symbol support.
workspaceSymbolProvider?: boolean;
--The server provides code actions. The `CodeActionOptions` return type is only
--valid if the client signals code action literal support via the property
--`textDocument.codeAction.codeActionLiteralSupport`.
codeActionProvider?: boolean | CodeActionOptions;
--The server provides code lens.
codeLensProvider?: CodeLensOptions;
--The server provides document formatting.
documentFormattingProvider?: boolean;
--The server provides document range formatting.
documentRangeFormattingProvider?: boolean;
--The server provides document formatting on typing.
documentOnTypeFormattingProvider?: DocumentOnTypeFormattingOptions;
--The server provides rename support. RenameOptions may only be
--specified if the client states that it supports
--`prepareSupport` in its initial `initialize` request.
renameProvider?: boolean | RenameOptions;
--The server provides document link support.
documentLinkProvider?: DocumentLinkOptions;
--The server provides color provider support.
--
--Since 3.6.0
colorProvider?: boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
--The server provides folding provider support.
--
--Since 3.10.0
foldingRangeProvider?: boolean | FoldingRangeProviderOptions | (FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
--The server provides go to declaration support.
--
--Since 3.14.0
declarationProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
--The server provides execute command support.
executeCommandProvider?: ExecuteCommandOptions;
--Workspace specific server capabilities
workspace?: {
--The server supports workspace folder.
--
--Since 3.6.0
workspaceFolders?: {
* The server has support for workspace folders
supported?: boolean;
* Whether the server wants to receive workspace folder
* change notifications.
*
* If a strings is provided the string is treated as a ID
* under which the notification is registered on the client
* side. The ID can be used to unregister for these events
* using the `client/unregisterCapability` request.
changeNotifications?: string | boolean;
}
}
--Experimental server capabilities.
experimental?: any;
}
--]]
--- Creates a normalized object describing LSP server capabilities.
---@param server_capabilities table Table of capabilities supported by the server
---@return table Normalized table of capabilities
function protocol.resolve_capabilities(server_capabilities)
local general_properties = {}
local text_document_sync_properties