lspeasy / core/src / getClientCapabilityForNotificationMethod
Function: getClientCapabilityForNotificationMethod()
ts
function getClientCapabilityForNotificationMethod<M, D>(method, _direction?):
| "alwaysOn"
| InternalPaths<Required<ClientCapabilities>, {
bracketNotation: false;
depth: number;
leavesOnly: false;
maxRecursionDepth: 5;
}, 0>;Defined in: packages/core/src/protocol/infer.ts:265
Get the client capability key for a given notification method at runtime.
Type Parameters
| Type Parameter | Default type |
|---|---|
M extends | "initialized" | "exit" | "textDocument/didOpen" | "textDocument/didChange" | "textDocument/didClose" | "textDocument/didSave" | "textDocument/willSave" | "textDocument/publishDiagnostics" | "window/showMessage" | "window/workDoneProgress/cancel" | "window/logMessage" | "workspace/didChangeWorkspaceFolders" | "workspace/didCreateFiles" | "workspace/didRenameFiles" | "workspace/didDeleteFiles" | "workspace/didChangeConfiguration" | "workspace/didChangeWatchedFiles" | "$/cancelRequest" | "$/progress" | "$/setTrace" | "$/logTrace" | "notebookDocument/didOpen" | "notebookDocument/didChange" | "notebookDocument/didSave" | "notebookDocument/didClose" | "telemetry/event" | - |
D extends "both" | "clientToServer" | "serverToClient" | "both" |
Parameters
| Parameter | Type | Description |
|---|---|---|
method | M | The LSP notification method string to look up. |
_direction | D | Optional direction filter (currently unused). |
Returns
| "alwaysOn" | InternalPaths<Required<ClientCapabilities>, { bracketNotation: false; depth: number; leavesOnly: false; maxRecursionDepth: 5; }, 0>
The dot-notation capability path, or 'alwaysOn' if no capability gate exists.