Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@qualified/lsp-connection

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qualified/lsp-connection - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

44

lib/cjs/connection.d.ts

@@ -1,2 +0,2 @@

import type { Message, MessageConnection, NotificationHandler } from "vscode-jsonrpc";
import type { Message, MessageConnection, NotificationHandler, CancellationToken } from "vscode-jsonrpc";
import type { InitializeParams, ProtocolRequestType } from "vscode-languageserver-protocol";

@@ -67,3 +67,3 @@ export declare type LspConnection = ReturnType<typeof createLspConnection>;

*/
getEditsBeforeSave: (params: import("vscode-languageserver-protocol").WillSaveTextDocumentParams) => Promise<import("vscode-languageserver-protocol").TextEdit[] | null>;
getEditsBeforeSave: (params: import("vscode-languageserver-protocol").WillSaveTextDocumentParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").TextEdit[] | null>;
/**

@@ -82,41 +82,41 @@ * Notify that the text document got saved in the client.

/** If supported, request completion at a given text document position. */
getCompletion: (params: import("vscode-languageserver-protocol").CompletionParams) => Promise<import("vscode-languageserver-protocol").CompletionList | import("vscode-languageserver-protocol").CompletionItem[] | null>;
getCompletion: (params: import("vscode-languageserver-protocol").CompletionParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CompletionList | import("vscode-languageserver-protocol").CompletionItem[] | null>;
/** If supported, resolve additional information for a given completion item. */
getCompletionItemDetails: (params: import("vscode-languageserver-protocol").CompletionItem) => Promise<import("vscode-languageserver-protocol").CompletionItem | null>;
getCompletionItemDetails: (params: import("vscode-languageserver-protocol").CompletionItem, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CompletionItem | null>;
/** If supported, request hover information at a given text document position. */
getHoverInfo: (params: import("vscode-languageserver-protocol").HoverParams) => Promise<import("vscode-languageserver-protocol").Hover | null>;
getHoverInfo: (params: import("vscode-languageserver-protocol").HoverParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Hover | null>;
/** If supported, request signature information at a given text document position. */
getSignatureHelp: (params: import("vscode-languageserver-protocol").SignatureHelpParams) => Promise<import("vscode-languageserver-protocol").SignatureHelp | null>;
getSignatureHelp: (params: import("vscode-languageserver-protocol").SignatureHelpParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").SignatureHelp | null>;
/** If supported, resolve the type definition locations of a symbol at a given text document position. */
getDeclaration: (params: import("vscode-languageserver-protocol").DeclarationParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getDeclaration: (params: import("vscode-languageserver-protocol").DeclarationParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve the definition location of a symbol at a given text document position. */
getDefinition: (params: import("vscode-languageserver-protocol").DefinitionParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getDefinition: (params: import("vscode-languageserver-protocol").DefinitionParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve the type definition locations of a symbol at a given text document position. */
getTypeDefinition: (params: import("vscode-languageserver-protocol").TypeDefinitionParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getTypeDefinition: (params: import("vscode-languageserver-protocol").TypeDefinitionParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve the implementation locations of a symbol at a given text document position. */
getImplementation: (params: import("vscode-languageserver-protocol").ImplementationParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getImplementation: (params: import("vscode-languageserver-protocol").ImplementationParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve project-wide references for the symbol denoted by the given text document position. */
getReferences: (params: import("vscode-languageserver-protocol").ReferenceParams) => Promise<import("vscode-languageserver-protocol").Location[] | null>;
getReferences: (params: import("vscode-languageserver-protocol").ReferenceParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location[] | null>;
/** If supported, resolve a DocumentHighlight for a given text document position. */
getDocumentHighlight: (params: import("vscode-languageserver-protocol").DocumentHighlightParams) => Promise<import("vscode-languageserver-protocol").DocumentHighlight[] | null>;
getDocumentHighlight: (params: import("vscode-languageserver-protocol").DocumentHighlightParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentHighlight[] | null>;
/** If supported, list all symbols found in a given text document. */
getDocumentSymbol: (params: import("vscode-languageserver-protocol").DocumentSymbolParams) => Promise<import("vscode-languageserver-protocol").DocumentSymbol[] | import("vscode-languageserver-protocol").SymbolInformation[] | null>;
getDocumentSymbol: (params: import("vscode-languageserver-protocol").DocumentSymbolParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentSymbol[] | import("vscode-languageserver-protocol").SymbolInformation[] | null>;
/** If supported, get commands for the given text document and range. */
getCodeAction: (params: import("vscode-languageserver-protocol").CodeActionParams) => Promise<(import("vscode-languageserver-protocol").Command | import("vscode-languageserver-protocol").CodeAction)[] | null>;
getCodeAction: (params: import("vscode-languageserver-protocol").CodeActionParams, token?: CancellationToken | undefined) => Promise<(import("vscode-languageserver-protocol").Command | import("vscode-languageserver-protocol").CodeAction)[] | null>;
/** If supported, get code lens for the given text document. */
getCodeLens: (params: import("vscode-languageserver-protocol").CodeLensParams) => Promise<import("vscode-languageserver-protocol").CodeLens[] | null>;
getCodeLens: (params: import("vscode-languageserver-protocol").CodeLensParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CodeLens[] | null>;
/** If supported, resolve a command for a given code lens. */
resolveCodeLens: (params: import("vscode-languageserver-protocol").CodeLens) => Promise<import("vscode-languageserver-protocol").CodeLens | null>;
resolveCodeLens: (params: import("vscode-languageserver-protocol").CodeLens, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CodeLens | null>;
/** If supported, get document links. */
getDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLinkParams) => Promise<import("vscode-languageserver-protocol").DocumentLink[] | null>;
getDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLinkParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentLink[] | null>;
/** If supported, resolve additional information for a given document link. */
resolveDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLink) => Promise<import("vscode-languageserver-protocol").DocumentLink | null>;
resolveDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLink, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentLink | null>;
/** If supported, list all color symbols found in a given text document. */
getColorSymbols: (params: import("vscode-languageserver-protocol").DocumentColorParams) => Promise<import("vscode-languageserver-protocol").ColorInformation[] | null>;
getColorSymbols: (params: import("vscode-languageserver-protocol").DocumentColorParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").ColorInformation[] | null>;
/** If supported, get folding ranges in a document. */
getFoldingRanges: (params: import("vscode-languageserver-protocol").FoldingRangeParams) => Promise<import("vscode-languageserver-protocol").FoldingRange[] | null>;
getFoldingRanges: (params: import("vscode-languageserver-protocol").FoldingRangeParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").FoldingRange[] | null>;
/** If supported, get selection ranges in a document. */
getSelectionRanges: (params: import("vscode-languageserver-protocol").SelectionRangeParams) => Promise<import("vscode-languageserver-protocol").SelectionRange[] | null>;
getSelectionRanges: (params: import("vscode-languageserver-protocol").SelectionRangeParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").SelectionRange[] | null>;
/** If supported, list project-wide symbols matching the query string in params. */
getWorkspaceSymbols: (params: import("vscode-languageserver-protocol").WorkspaceSymbolParams) => Promise<import("vscode-languageserver-protocol").SymbolInformation[] | null>;
getWorkspaceSymbols: (params: import("vscode-languageserver-protocol").WorkspaceSymbolParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").SymbolInformation[] | null>;
readonly syncsIncrementally: boolean;

@@ -123,0 +123,0 @@ readonly completionTriggers: string[];

@@ -26,3 +26,3 @@ "use strict";

});
const maybeReq = (cond, type) => (params) => cond() ? conn.sendRequest(type, params) : Promise.resolve(null);
const maybeReq = (cond, type) => (params, token) => cond() ? conn.sendRequest(type, params, token) : Promise.resolve(null);
const maybeNotify = (cond, type) => (params) => cond() ? conn.sendNotification(type, params) : undefined;

@@ -29,0 +29,0 @@ const notifier = (type) => (params) => conn.sendNotification(type, params);

@@ -1,2 +0,2 @@

import type { Message, MessageConnection, NotificationHandler } from "vscode-jsonrpc";
import type { Message, MessageConnection, NotificationHandler, CancellationToken } from "vscode-jsonrpc";
import type { InitializeParams, ProtocolRequestType } from "vscode-languageserver-protocol";

@@ -67,3 +67,3 @@ export declare type LspConnection = ReturnType<typeof createLspConnection>;

*/
getEditsBeforeSave: (params: import("vscode-languageserver-protocol").WillSaveTextDocumentParams) => Promise<import("vscode-languageserver-protocol").TextEdit[] | null>;
getEditsBeforeSave: (params: import("vscode-languageserver-protocol").WillSaveTextDocumentParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").TextEdit[] | null>;
/**

@@ -82,41 +82,41 @@ * Notify that the text document got saved in the client.

/** If supported, request completion at a given text document position. */
getCompletion: (params: import("vscode-languageserver-protocol").CompletionParams) => Promise<import("vscode-languageserver-protocol").CompletionList | import("vscode-languageserver-protocol").CompletionItem[] | null>;
getCompletion: (params: import("vscode-languageserver-protocol").CompletionParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CompletionList | import("vscode-languageserver-protocol").CompletionItem[] | null>;
/** If supported, resolve additional information for a given completion item. */
getCompletionItemDetails: (params: import("vscode-languageserver-protocol").CompletionItem) => Promise<import("vscode-languageserver-protocol").CompletionItem | null>;
getCompletionItemDetails: (params: import("vscode-languageserver-protocol").CompletionItem, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CompletionItem | null>;
/** If supported, request hover information at a given text document position. */
getHoverInfo: (params: import("vscode-languageserver-protocol").HoverParams) => Promise<import("vscode-languageserver-protocol").Hover | null>;
getHoverInfo: (params: import("vscode-languageserver-protocol").HoverParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Hover | null>;
/** If supported, request signature information at a given text document position. */
getSignatureHelp: (params: import("vscode-languageserver-protocol").SignatureHelpParams) => Promise<import("vscode-languageserver-protocol").SignatureHelp | null>;
getSignatureHelp: (params: import("vscode-languageserver-protocol").SignatureHelpParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").SignatureHelp | null>;
/** If supported, resolve the type definition locations of a symbol at a given text document position. */
getDeclaration: (params: import("vscode-languageserver-protocol").DeclarationParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getDeclaration: (params: import("vscode-languageserver-protocol").DeclarationParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve the definition location of a symbol at a given text document position. */
getDefinition: (params: import("vscode-languageserver-protocol").DefinitionParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getDefinition: (params: import("vscode-languageserver-protocol").DefinitionParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve the type definition locations of a symbol at a given text document position. */
getTypeDefinition: (params: import("vscode-languageserver-protocol").TypeDefinitionParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getTypeDefinition: (params: import("vscode-languageserver-protocol").TypeDefinitionParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve the implementation locations of a symbol at a given text document position. */
getImplementation: (params: import("vscode-languageserver-protocol").ImplementationParams) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
getImplementation: (params: import("vscode-languageserver-protocol").ImplementationParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location | import("vscode-languageserver-protocol").Location[] | import("vscode-languageserver-protocol").LocationLink[] | null>;
/** If supported, resolve project-wide references for the symbol denoted by the given text document position. */
getReferences: (params: import("vscode-languageserver-protocol").ReferenceParams) => Promise<import("vscode-languageserver-protocol").Location[] | null>;
getReferences: (params: import("vscode-languageserver-protocol").ReferenceParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").Location[] | null>;
/** If supported, resolve a DocumentHighlight for a given text document position. */
getDocumentHighlight: (params: import("vscode-languageserver-protocol").DocumentHighlightParams) => Promise<import("vscode-languageserver-protocol").DocumentHighlight[] | null>;
getDocumentHighlight: (params: import("vscode-languageserver-protocol").DocumentHighlightParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentHighlight[] | null>;
/** If supported, list all symbols found in a given text document. */
getDocumentSymbol: (params: import("vscode-languageserver-protocol").DocumentSymbolParams) => Promise<import("vscode-languageserver-protocol").DocumentSymbol[] | import("vscode-languageserver-protocol").SymbolInformation[] | null>;
getDocumentSymbol: (params: import("vscode-languageserver-protocol").DocumentSymbolParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentSymbol[] | import("vscode-languageserver-protocol").SymbolInformation[] | null>;
/** If supported, get commands for the given text document and range. */
getCodeAction: (params: import("vscode-languageserver-protocol").CodeActionParams) => Promise<(import("vscode-languageserver-protocol").Command | import("vscode-languageserver-protocol").CodeAction)[] | null>;
getCodeAction: (params: import("vscode-languageserver-protocol").CodeActionParams, token?: CancellationToken | undefined) => Promise<(import("vscode-languageserver-protocol").Command | import("vscode-languageserver-protocol").CodeAction)[] | null>;
/** If supported, get code lens for the given text document. */
getCodeLens: (params: import("vscode-languageserver-protocol").CodeLensParams) => Promise<import("vscode-languageserver-protocol").CodeLens[] | null>;
getCodeLens: (params: import("vscode-languageserver-protocol").CodeLensParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CodeLens[] | null>;
/** If supported, resolve a command for a given code lens. */
resolveCodeLens: (params: import("vscode-languageserver-protocol").CodeLens) => Promise<import("vscode-languageserver-protocol").CodeLens | null>;
resolveCodeLens: (params: import("vscode-languageserver-protocol").CodeLens, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").CodeLens | null>;
/** If supported, get document links. */
getDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLinkParams) => Promise<import("vscode-languageserver-protocol").DocumentLink[] | null>;
getDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLinkParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentLink[] | null>;
/** If supported, resolve additional information for a given document link. */
resolveDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLink) => Promise<import("vscode-languageserver-protocol").DocumentLink | null>;
resolveDocumentLink: (params: import("vscode-languageserver-protocol").DocumentLink, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").DocumentLink | null>;
/** If supported, list all color symbols found in a given text document. */
getColorSymbols: (params: import("vscode-languageserver-protocol").DocumentColorParams) => Promise<import("vscode-languageserver-protocol").ColorInformation[] | null>;
getColorSymbols: (params: import("vscode-languageserver-protocol").DocumentColorParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").ColorInformation[] | null>;
/** If supported, get folding ranges in a document. */
getFoldingRanges: (params: import("vscode-languageserver-protocol").FoldingRangeParams) => Promise<import("vscode-languageserver-protocol").FoldingRange[] | null>;
getFoldingRanges: (params: import("vscode-languageserver-protocol").FoldingRangeParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").FoldingRange[] | null>;
/** If supported, get selection ranges in a document. */
getSelectionRanges: (params: import("vscode-languageserver-protocol").SelectionRangeParams) => Promise<import("vscode-languageserver-protocol").SelectionRange[] | null>;
getSelectionRanges: (params: import("vscode-languageserver-protocol").SelectionRangeParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").SelectionRange[] | null>;
/** If supported, list project-wide symbols matching the query string in params. */
getWorkspaceSymbols: (params: import("vscode-languageserver-protocol").WorkspaceSymbolParams) => Promise<import("vscode-languageserver-protocol").SymbolInformation[] | null>;
getWorkspaceSymbols: (params: import("vscode-languageserver-protocol").WorkspaceSymbolParams, token?: CancellationToken | undefined) => Promise<import("vscode-languageserver-protocol").SymbolInformation[] | null>;
readonly syncsIncrementally: boolean;

@@ -123,0 +123,0 @@ readonly completionTriggers: string[];

@@ -23,3 +23,3 @@ import { CodeActionRequest, CodeLensRequest, CodeLensResolveRequest, CompletionRequest, CompletionResolveRequest, DeclarationRequest, DefinitionRequest, DidChangeConfigurationNotification, DidChangeTextDocumentNotification, DidChangeWatchedFilesNotification, DidCloseTextDocumentNotification, DidOpenTextDocumentNotification, DidSaveTextDocumentNotification, DocumentColorRequest, DocumentHighlightRequest, DocumentLinkRequest, DocumentLinkResolveRequest, DocumentSymbolRequest, ExitNotification, FoldingRangeRequest, HoverRequest, ImplementationRequest, InitializeRequest, InitializedNotification, LogMessageNotification, PublishDiagnosticsNotification, ReferencesRequest, RegistrationRequest, SelectionRangeRequest, ShowMessageNotification, ShutdownRequest, SignatureHelpRequest, TextDocumentSyncKind, TypeDefinitionRequest, UnregistrationRequest, WillSaveTextDocumentNotification, WillSaveTextDocumentWaitUntilRequest, WorkspaceSymbolRequest, } from "vscode-languageserver-protocol";

});
const maybeReq = (cond, type) => (params) => cond() ? conn.sendRequest(type, params) : Promise.resolve(null);
const maybeReq = (cond, type) => (params, token) => cond() ? conn.sendRequest(type, params, token) : Promise.resolve(null);
const maybeNotify = (cond, type) => (params) => cond() ? conn.sendNotification(type, params) : undefined;

@@ -26,0 +26,0 @@ const notifier = (type) => (params) => conn.sendNotification(type, params);

@@ -10,3 +10,3 @@ {

],
"version": "0.2.1",
"version": "0.2.2",
"license": "MIT",

@@ -13,0 +13,0 @@ "homepage": "https://github.com/qualified/lsps#readme",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc