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

vscode-languageclient

Package Overview
Dependencies
Maintainers
9
Versions
302
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-languageclient - npm Package Compare versions

Comparing version 0.10.5 to 0.10.6

lib/protocolCompletionItem.d.ts

9

lib/codeConverter.js

@@ -7,2 +7,3 @@ /* --------------------------------------------------------------------------------------------

var is = require('./utils/is');
var protocolCompletionItem_1 = require('./protocolCompletionItem');
function asOpenTextDocumentParams(textDocument) {

@@ -96,5 +97,9 @@ return {

set(item.insertText, function () { return result.insertText = item.insertText; });
set(item.kind, function () { return result.kind = item.kind; });
// Protocol item kind is 1 based, codes item kind is zero based.
set(item.kind, function () { return result.kind = item.kind + 1; });
set(item.sortText, function () { return result.sortText = item.sortText; });
set(item.textEdit, function () { return result.textEdit = asTextEdit(item.textEdit); });
if (item instanceof protocolCompletionItem_1.default) {
set(item.data, function () { return result.data = item.data; });
}
return result;

@@ -111,5 +116,5 @@ }

position: asWorkerPosition(position),
options: { includeDeclaration: options.includeDeclaration }
context: { includeDeclaration: options.includeDeclaration }
};
}
exports.asReferenceParams = asReferenceParams;

@@ -79,3 +79,5 @@ import { RequestType, NotificationType } from 'vscode-jsonrpc';

* It is send once as the first method after starting up the
* worker.
* worker. The requests parameter is of type [InitializeParams](#InitializeParams)
* the response if of type [InitializeResult](#InitializeResult) of a Thenable that
* resolves to such.
*/

@@ -122,3 +124,3 @@ export declare namespace InitializeRequest {

* It is send once when the client descides to shutdown the
* server. The only event that is sent after a shudown request
* server. The only notification that is sent after a shudown request
* is the exit event.

@@ -402,2 +404,5 @@ */

}
/**
* The kind of a completion entry.
*/
export declare enum CompletionItemKind {

@@ -423,27 +428,120 @@ Text = 1,

}
/**
* A completion item represents a text snippet that is
* proposed to complete text that is being typed.
*/
export interface CompletionItem {
/**
* The label of this completion item. By default
* also the text that is inserted when selecting
* this completion.
*/
label: string;
/**
* The kind of this completion item. Based of the kind
* an icon is chosen by the editor.
*/
kind?: number;
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
*/
detail?: string;
/**
* A human-readable string that represents a doc-comment.
*/
documentation?: string;
/**
* A string that shoud be used when comparing this item
* with other items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
sortText?: string;
/**
* A string that should be used when filtering a set of
* completion items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
filterText?: string;
/**
* A string that should be inserted a document when selecting
* this completion. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
insertText?: string;
/**
* An [edit](#TextEdit) which is applied to a document when selecting
* this completion. When an edit is provided the value of
* [insertText](#CompletionItem.insertText) is ignored.
*/
textEdit?: TextEdit;
/**
* An data entry field that is preserved on a completion item between
* a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest]
* (#CompletionResolveRequest)
*/
data?: any;
}
/**
* The CompletionItem namespace provides functions to deal with
* completion items.
*/
export declare namespace CompletionItem {
/**
* Create a completion item and seed it with a label.
* @param label The completion item's label
*/
function create(label: string): CompletionItem;
}
/**
* A text edit applicable to a text document.
*/
export interface TextEdit {
/**
* The range of the text document to be manipulated. To insert
* text into a document create a range where start === end.
*/
range: Range;
/**
* The string to be inserted. For delete operations use an
* empty string.
*/
newText: string;
}
/**
* The TextEdit namespace provides helper function to create replace,
* insert and delete edits more easily.
*/
export declare namespace TextEdit {
/**
* Creates a replace text edit.
* @param range The range of text to be replaced.
* @param newText The new text.
*/
function replace(range: Range, newText: string): TextEdit;
/**
* Creates a insert text edit.
* @param psotion The position to insert the text at.
* @param newText The text to be inserted.
*/
function insert(position: Position, newText: string): TextEdit;
/**
* Creates a delete text edit.
* @param range The range of text to be deleted.
*/
function del(range: Range): TextEdit;
}
/**
* Request to request completion at a given text document position. The request's
* parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response
* is of type [CompletionItem[]](#CompletionItem) or a Thenable that resolves to such.
*/
export declare namespace CompletionRequest {
const type: RequestType<TextDocumentPosition, CompletionItem[], void>;
}
/**
* Request to resolve additional information for a given completion item.The request's
* parameter is of type [CompletionItem](#CompletionItem) the response
* is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such.
*/
export declare namespace CompletionResolveRequest {

@@ -469,23 +567,84 @@ const type: RequestType<CompletionItem, CompletionItem, void>;

}
/**
* Request to request hover information at a given text document position. The request's
* parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of
* type [Hover](#Hover) or a Thenable that resolves to such.
*/
export declare namespace HoverRequest {
const type: RequestType<TextDocumentPosition, Hover, void>;
}
/**
* Represents a parameter of a callable-signature. A parameter can
* have a label and a doc-comment.
*/
export interface ParameterInformation {
/**
* The label of this signature. Will be shown in
* the UI.
*/
label: string;
/**
* The human-readable doc-comment of this signature. Will be shown
* in the UI but can be omitted.
*/
documentation?: string;
}
/**
* The ParameterInformation namespace provides helper functions to work with
* [ParameterInformation](#ParameterInformation) literals.
*/
export declare namespace ParameterInformation {
/**
* Creates a new parameter information literal.
*
* @param label A label string.
* @param documentation A doc string.
*/
function create(label: string, documentation?: string): ParameterInformation;
}
/**
* Represents the signature of something callable. A signature
* can have a label, like a function-name, a doc-comment, and
* a set of parameters.
*/
export interface SignatureInformation {
/**
* The label of this signature. Will be shown in
* the UI.
*/
label: string;
/**
* The human-readable doc-comment of this signature. Will be shown
* in the UI but can be omitted.
*/
documentation?: string;
/**
* The parameters of this signature.
*/
parameters?: ParameterInformation[];
}
/**
* The SignatureInformation namespace provides helper functions to work with
* [SignatureInformation](#SignatureInformation) literals.
*/
export declare namespace SignatureInformation {
function create(label: string, documentation?: string): SignatureInformation;
function create(label: string, documentation?: string, ...parameters: ParameterInformation[]): SignatureInformation;
}
/**
* Signature help represents the signature of something
* callable. There can be multiple signature but only one
* active and only one active parameter.
*/
export interface SignatureHelp {
signatures?: SignatureInformation[];
/**
* One or more signatures.
*/
signatures: SignatureInformation[];
/**
* The active signature.
*/
activeSignature?: number;
/**
* The active parameter of the active signature.
*/
activeParameter?: number;

@@ -497,28 +656,96 @@ }

/**
* The definition of a symbol is one or many [locations](#Location)
* The definition of a symbol represented as one or many [locations](#Location).
* For most programming languages there is only one location at which a symbol is
* defined.
*/
export declare type Definition = Location | Location[];
/**
* A request to resolve the defintion location of a symbol at a given text
* document position. The request's parameter is of type [TextDocumentPosition]
* (#TextDocumentPosition) the response is of type [Definition](#Definition) or a
* Thenable that resolves to such.
*/
export declare namespace DefinitionRequest {
const type: RequestType<TextDocumentPosition, Definition, void>;
}
/**
* Value-object that contains additional information when
* requesting references.
*/
export interface ReferenceContext {
/**
* Include the declaration of the current symbol.
*/
includeDeclaration: boolean;
}
/**
* Parameters for a [ReferencesRequest](#ReferencesRequest).
*/
export interface ReferenceParams extends TextDocumentPosition {
options: {
includeDeclaration: boolean;
};
context: ReferenceContext;
}
/**
* A request to resolve project-wide references for the symbol denoted
* by the given text document position. The request's parameter is of
* type [ReferenceParams](#ReferenceParams) the response is of type
* [Location[]](#Location) or a Thenable that resolves to such.
*/
export declare namespace ReferencesRequest {
const type: RequestType<ReferenceParams, Location[], void>;
}
/**
* A document highlight kind.
*/
export declare enum DocumentHighlightKind {
/**
* A textual occurrance.
*/
Text = 1,
/**
* Read-access of a symbol, like reading a variable.
*/
Read = 2,
/**
* Write-access of a symbol, like writing to a variable.
*/
Write = 3,
}
/**
* A document highlight is a range inside a text document which deserves
* special attention. Usually a document highlight is visualized by changing
* the background color of its range.
*/
export interface DocumentHighlight {
/**
* The range this highlight applies to.
*/
range: Range;
/**
* The highlight kind, default is [text](#DocumentHighlightKind.Text).
*/
kind?: number;
}
/**
* DocumentHighlight namespace to provide helper functions to work with
* [DocumentHighlight](#DocumentHighlight) literals.
*/
export declare namespace DocumentHighlight {
/**
* Create a DocumentHighlight object.
* @param range The range the highlight applies to.
*/
function create(range: Range, kind?: number): DocumentHighlight;
}
/**
* Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given
* text document position. The request's parameter is of type [TextDocumentPosition]
* (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]]
* (#DocumentHighlight) or a Thenable that resolves to such.
*/
export declare namespace DocumentHighlightRequest {
const type: RequestType<TextDocumentPosition, DocumentHighlight[], void>;
}
/**
* A symbol kind.
*/
export declare enum SymbolKind {

@@ -544,16 +771,62 @@ File = 1,

}
/**
* Represents information about programming constructs like variables, classes,
* interfaces etc.
*/
export interface SymbolInformation {
/**
* The name of this symbol.
*/
name: string;
/**
* The kind of this symbol.
*/
kind: number;
/**
* The location of this symbol.
*/
location: Location;
/**
* The name of the symbol containing this symbol.
*/
containerName?: string;
}
export declare namespace SymbolInformation {
/**
* Creates a new symbol information literal.
*
* @param name The name of the symbol.
* @param kind The kind of the symbol.
* @param range The range of the location of the symbol.
* @param uri The resource of the location of symbol, defaults to the current document.
* @param containerName The name of the symbol containg the symbol.
*/
function create(name: string, kind: SymbolKind, range: Range, uri?: string, containerName?: string): SymbolInformation;
}
/**
* A request to list all symbols found in a given text document. The request's
* parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the
* response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable
* that resolves to such.
*/
export declare namespace DocumentSymbolRequest {
const type: RequestType<TextDocumentIdentifier, SymbolInformation[], void>;
}
/**
* The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).
*/
export interface WorkspaceSymbolParams {
/**
* A non-empty query string
*/
query: string;
}
/**
* A request to list project-wide symbols matching the query string given
* by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is
* of type [SymbolInformation[]](#SymbolInformation) or a Thenable that
* resolves to such.
*/
export declare namespace WorkspaceSymbolRequest {
const type: RequestType<WorkspaceSymbolParams, SymbolInformation[], void>;
}

@@ -6,2 +6,3 @@ /* --------------------------------------------------------------------------------------------

'use strict';
var is = require('./utils/is');
/**

@@ -33,3 +34,5 @@ * Defines how the host (editor) should sync

* It is send once as the first method after starting up the
* worker.
* worker. The requests parameter is of type [InitializeParams](#InitializeParams)
* the response if of type [InitializeResult](#InitializeResult) of a Thenable that
* resolves to such.
*/

@@ -44,3 +47,3 @@ var InitializeRequest;

* It is send once when the client descides to shutdown the
* server. The only event that is sent after a shudown request
* server. The only notification that is sent after a shudown request
* is the exit event.

@@ -186,2 +189,5 @@ */

//---- Completion Support --------------------------
/**
* The kind of a completion entry.
*/
(function (CompletionItemKind) {

@@ -208,4 +214,12 @@ CompletionItemKind[CompletionItemKind["Text"] = 1] = "Text";

var CompletionItemKind = exports.CompletionItemKind;
/**
* The CompletionItem namespace provides functions to deal with
* completion items.
*/
var CompletionItem;
(function (CompletionItem) {
/**
* Create a completion item and seed it with a label.
* @param label The completion item's label
*/
function create(label) {

@@ -216,4 +230,13 @@ return { label: label };

})(CompletionItem = exports.CompletionItem || (exports.CompletionItem = {}));
/**
* The TextEdit namespace provides helper function to create replace,
* insert and delete edits more easily.
*/
var TextEdit;
(function (TextEdit) {
/**
* Creates a replace text edit.
* @param range The range of text to be replaced.
* @param newText The new text.
*/
function replace(range, newText) {

@@ -223,2 +246,7 @@ return { range: range, newText: newText };

TextEdit.replace = replace;
/**
* Creates a insert text edit.
* @param psotion The position to insert the text at.
* @param newText The text to be inserted.
*/
function insert(position, newText) {

@@ -228,2 +256,6 @@ return { range: { start: position, end: position }, newText: newText };

TextEdit.insert = insert;
/**
* Creates a delete text edit.
* @param range The range of text to be deleted.
*/
function del(range) {

@@ -234,2 +266,7 @@ return { range: range, newText: '' };

})(TextEdit = exports.TextEdit || (exports.TextEdit = {}));
/**
* Request to request completion at a given text document position. The request's
* parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response
* is of type [CompletionItem[]](#CompletionItem) or a Thenable that resolves to such.
*/
var CompletionRequest;

@@ -239,2 +276,7 @@ (function (CompletionRequest) {

})(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));
/**
* Request to resolve additional information for a given completion item.The request's
* parameter is of type [CompletionItem](#CompletionItem) the response
* is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such.
*/
var CompletionResolveRequest;

@@ -244,2 +286,7 @@ (function (CompletionResolveRequest) {

})(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));
/**
* Request to request hover information at a given text document position. The request's
* parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of
* type [Hover](#Hover) or a Thenable that resolves to such.
*/
var HoverRequest;

@@ -249,4 +296,14 @@ (function (HoverRequest) {

})(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));
/**
* The ParameterInformation namespace provides helper functions to work with
* [ParameterInformation](#ParameterInformation) literals.
*/
var ParameterInformation;
(function (ParameterInformation) {
/**
* Creates a new parameter information literal.
*
* @param label A label string.
* @param documentation A doc string.
*/
function create(label, documentation) {

@@ -258,6 +315,24 @@ return documentation ? { label: label, documentation: documentation } : { label: label };

})(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {}));
/**
* The SignatureInformation namespace provides helper functions to work with
* [SignatureInformation](#SignatureInformation) literals.
*/
var SignatureInformation;
(function (SignatureInformation) {
function create(label, documentation) {
return documentation ? { label: label, documentation: documentation } : { label: label };
var parameters = [];
for (var _i = 2; _i < arguments.length; _i++) {
parameters[_i - 2] = arguments[_i];
}
var result = { label: label };
if (is.defined(documentation)) {
result.documentation = documentation;
}
if (is.defined(parameters)) {
result.parameters = parameters;
}
else {
result.parameters = [];
}
return result;
}

@@ -270,2 +345,8 @@ SignatureInformation.create = create;

})(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));
/**
* A request to resolve the defintion location of a symbol at a given text
* document position. The request's parameter is of type [TextDocumentPosition]
* (#TextDocumentPosition) the response is of type [Definition](#Definition) or a
* Thenable that resolves to such.
*/
var DefinitionRequest;

@@ -275,2 +356,8 @@ (function (DefinitionRequest) {

})(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));
/**
* A request to resolve project-wide references for the symbol denoted
* by the given text document position. The request's parameter is of
* type [ReferenceParams](#ReferenceParams) the response is of type
* [Location[]](#Location) or a Thenable that resolves to such.
*/
var ReferencesRequest;

@@ -281,8 +368,45 @@ (function (ReferencesRequest) {

//---- Document Highlight ----------------------------------
/**
* A document highlight kind.
*/
(function (DocumentHighlightKind) {
/**
* A textual occurrance.
*/
DocumentHighlightKind[DocumentHighlightKind["Text"] = 1] = "Text";
/**
* Read-access of a symbol, like reading a variable.
*/
DocumentHighlightKind[DocumentHighlightKind["Read"] = 2] = "Read";
/**
* Write-access of a symbol, like writing to a variable.
*/
DocumentHighlightKind[DocumentHighlightKind["Write"] = 3] = "Write";
})(exports.DocumentHighlightKind || (exports.DocumentHighlightKind = {}));
var DocumentHighlightKind = exports.DocumentHighlightKind;
/**
* DocumentHighlight namespace to provide helper functions to work with
* [DocumentHighlight](#DocumentHighlight) literals.
*/
var DocumentHighlight;
(function (DocumentHighlight) {
/**
* Create a DocumentHighlight object.
* @param range The range the highlight applies to.
*/
function create(range, kind) {
var result = { range: range };
if (is.number(kind)) {
result.kind = kind;
}
return result;
}
DocumentHighlight.create = create;
})(DocumentHighlight = exports.DocumentHighlight || (exports.DocumentHighlight = {}));
/**
* Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given
* text document position. The request's parameter is of type [TextDocumentPosition]
* (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]]
* (#DocumentHighlight) or a Thenable that resolves to such.
*/
var DocumentHighlightRequest;

@@ -293,2 +417,5 @@ (function (DocumentHighlightRequest) {

//---- Document Symbol Provider ---------------------------
/**
* A symbol kind.
*/
(function (SymbolKind) {

@@ -315,2 +442,32 @@ SymbolKind[SymbolKind["File"] = 1] = "File";

var SymbolKind = exports.SymbolKind;
var SymbolInformation;
(function (SymbolInformation) {
/**
* Creates a new symbol information literal.
*
* @param name The name of the symbol.
* @param kind The kind of the symbol.
* @param range The range of the location of the symbol.
* @param uri The resource of the location of symbol, defaults to the current document.
* @param containerName The name of the symbol containg the symbol.
*/
function create(name, kind, range, uri, containerName) {
var result = {
name: name,
kind: kind,
location: { uri: uri, range: range }
};
if (containerName) {
result.containerName = containerName;
}
return result;
}
SymbolInformation.create = create;
})(SymbolInformation = exports.SymbolInformation || (exports.SymbolInformation = {}));
/**
* A request to list all symbols found in a given text document. The request's
* parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the
* response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable
* that resolves to such.
*/
var DocumentSymbolRequest;

@@ -320,2 +477,8 @@ (function (DocumentSymbolRequest) {

})(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));
/**
* A request to list project-wide symbols matching the query string given
* by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is
* of type [SymbolInformation[]](#SymbolInformation) or a Thenable that
* resolves to such.
*/
var WorkspaceSymbolRequest;

@@ -322,0 +485,0 @@ (function (WorkspaceSymbolRequest) {

import * as code from 'vscode';
import * as proto from './protocol';
import ProtocolCompletionItem from './protocolCompletionItem';
export declare function asDiagnostics(diagnostics: proto.Diagnostic[]): code.Diagnostic[];

@@ -9,3 +10,3 @@ export declare function asRange(value: proto.Range): code.Range;

export declare function asCompletionItems(items: proto.CompletionItem[]): code.CompletionItem[];
export declare function asCompletionItem(item: proto.CompletionItem): code.CompletionItem;
export declare function asCompletionItem(item: proto.CompletionItem): ProtocolCompletionItem;
export declare function asTextEdit(edit: proto.TextEdit): code.TextEdit;

@@ -12,0 +13,0 @@ export declare function asSignatureHelp(item: proto.SignatureHelp): code.SignatureHelp;

@@ -9,2 +9,3 @@ /* --------------------------------------------------------------------------------------------

var is = require('./utils/is');
var protocolCompletionItem_1 = require('./protocolCompletionItem');
function asDiagnostics(diagnostics) {

@@ -61,3 +62,3 @@ return diagnostics.map(function (diagnostic) { return new code.Diagnostic(asRange(diagnostic.range), diagnostic.message, asDiagnosticSeverity(diagnostic.severity)); });

function asCompletionItem(item) {
var result = new code.CompletionItem(item.label);
var result = new protocolCompletionItem_1.default(item.label);
set(item.detail, function () { return result.detail = item.detail; });

@@ -71,2 +72,3 @@ set(item.documentation, function () { return result.documentation = item.documentation; });

set(item.textEdit, function () { return result.textEdit = asTextEdit(item.textEdit); });
set(item.data, function () { return result.data = item.data; });
return result;

@@ -73,0 +75,0 @@ }

{
"name": "vscode-languageclient",
"description": "VSCode Language client implementation",
"version": "0.10.5",
"version": "0.10.6",
"author": "Microsoft Corporation",

@@ -6,0 +6,0 @@ "license": "MIT",

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