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

vscode-languageserver-protocol

Package Overview
Dependencies
Maintainers
11
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-languageserver-protocol - npm Package Compare versions

Comparing version 3.17.0-next.12 to 3.17.0-next.13

10

lib/common/api.d.ts

@@ -104,3 +104,3 @@ import type { integer } from 'vscode-languageserver-types';

type NotebookDocumentSyncClientCapabilities = nb.NotebookDocumentSyncClientCapabilities;
type $NotebookDocumentServerCapabilities = nb.$NotebookDocumentServerCapabilities;
type $NotebookDocumentSyncServerCapabilities = nb.$NotebookDocumentSyncServerCapabilities;
type NotebookCellKind = nb.NotebookCellKind;

@@ -110,3 +110,3 @@ const NotebookCellKind: typeof nb.NotebookCellKind;

const NotebookCell: typeof nb.NotebookCell;
type NotebookCellChange = nb.NotebookCellChange;
type NotebookCellArrayChange = nb.NotebookCellArrayChange;
type NotebookDocument = nb.NotebookDocument;

@@ -117,4 +117,4 @@ const NotebookDocument: typeof nb.NotebookDocument;

type VersionedNotebookDocumentIdentifier = nb.VersionedNotebookDocumentIdentifier;
type NotebookDocumentOptions = nb.NotebookDocumentOptions;
type NotebookDocumentRegistrationOptions = nb.NotebookDocumentRegistrationOptions;
type NotebookDocumentSyncOptions = nb.NotebookDocumentSyncOptions;
type NotebookDocumentSyncRegistrationOptions = nb.NotebookDocumentSyncRegistrationOptions;
const NotebookDocumentSyncRegistrationType: typeof nb.NotebookDocumentSyncRegistrationType;

@@ -125,4 +125,6 @@ type DidOpenNotebookDocumentParams = nb.DidOpenNotebookDocumentParams;

const DidChangeNotebookDocumentNotification: typeof nb.DidChangeNotebookDocumentNotification;
type DidSaveNotebookDocumentParams = nb.DidSaveNotebookDocumentParams;
const DidSaveNotebookDocumentNotification: typeof nb.DidSaveNotebookDocumentNotification;
type DidCloseNotebookDocumentParams = nb.DidCloseNotebookDocumentParams;
const DidCloseNotebookDocumentNotification: typeof nb.DidCloseNotebookDocumentNotification;
}

1

lib/common/api.js

@@ -96,4 +96,5 @@ "use strict";

Proposed.DidChangeNotebookDocumentNotification = nb.DidChangeNotebookDocumentNotification;
Proposed.DidSaveNotebookDocumentNotification = nb.DidSaveNotebookDocumentNotification;
Proposed.DidCloseNotebookDocumentNotification = nb.DidCloseNotebookDocumentNotification;
})(Proposed = exports.Proposed || (exports.Proposed = {}));
//# sourceMappingURL=api.js.map

@@ -1,4 +0,4 @@

import { URI, integer, DocumentUri, uinteger } from 'vscode-languageserver-types';
import { URI, integer, DocumentUri, uinteger, LSPObject, TextDocumentItem, TextDocumentIdentifier, VersionedTextDocumentIdentifier } from 'vscode-languageserver-types';
import { ProtocolNotificationType, RegistrationType } from './messages';
import { StaticRegistrationOptions, NotebookDocumentFilter } from './protocol';
import { StaticRegistrationOptions, NotebookDocumentFilter, TextDocumentContentChangeEvent } from './protocol';
/**

@@ -43,2 +43,6 @@ * Notebook specific client capabilities.

*
* A cell's document URI must be unique across ALL notebook
* cells and can therefore be used to uniquely identify a
* notebook cell or the cell's text document.
*
* @since 3.17.0 - proposed state

@@ -52,7 +56,10 @@ */

/**
* The cell's text represented as a text document.
* The document's content is synced using the
* existing text document sync notifications.
* The URI of the cell's text document
* content.
*/
document: DocumentUri;
/**
* Additional metadata stored with the cell.
*/
metadata?: LSPObject;
}

@@ -62,29 +69,5 @@ export declare namespace NotebookCell {

function is(value: any): value is NotebookCell;
function equal(one: NotebookCell, two: NotebookCell): boolean;
function equals(one: NotebookCell, other: NotebookCell, compareMetaData?: boolean): boolean;
}
/**
* A change describing how to move a `NotebookCell`
* array from state S' to S''.
*
* @since 3.17.0 - proposed state
*/
export interface NotebookCellChange {
/**
* The start oftest of the cell that changed.
*/
start: uinteger;
/**
* The deleted cells
*/
deleteCount: uinteger;
/**
* The new cells, if any
*/
cells?: NotebookCell[];
}
export declare namespace NotebookCellChange {
function is(value: any): value is NotebookCellChange;
function create(start: uinteger, deleteCount: uinteger, cells?: NotebookCell[]): NotebookCellChange;
}
/**
* A notebook document.

@@ -109,2 +92,7 @@ *

/**
* Additional metadata stored with the notebook
* document.
*/
metadata?: LSPObject;
/**
* The cells of a notebook.

@@ -148,3 +136,3 @@ */

*
* If a selector provider a notebook document
* If a selector provide a notebook document
* filter but no cell selector all cells of a

@@ -160,4 +148,7 @@ * matching notebook document will be synced.

*/
export declare type NotebookDocumentOptions = {
notebookDocumentSelector?: ({
export declare type NotebookDocumentSyncOptions = {
/**
* The notebook document to be synced
*/
notebookDocumentSelector: ({
/** The notebook documents to be synced */

@@ -177,6 +168,20 @@ notebookDocumentFilter: NotebookDocumentFilter;

})[];
/**
* Determines how the notebook is synchronized.
*
* If set to 'notebook' the notebook document,
* its meta data, cell structure and the cell's
* text documents are synchronized.
*
* If set to 'cellContent' only the cell content
* is synchronized using the available
* `textDocument/did*` notifications.
*/
mode: 'notebook' | 'cellContent';
/**
* Whether save notification should be forwarded to
* the server. Will only be honored if mode === `notebook`.
*/
save?: boolean;
};
export interface $NotebookDocumentServerCapabilities {
notebookDocumentSync?: NotebookDocumentOptions | NotebookDocumentRegistrationOptions;
}
/**

@@ -187,6 +192,9 @@ * Registration options specific to a notebook.

*/
export declare type NotebookDocumentRegistrationOptions = NotebookDocumentOptions & StaticRegistrationOptions;
export declare type NotebookDocumentSyncRegistrationOptions = NotebookDocumentSyncOptions & StaticRegistrationOptions;
export interface $NotebookDocumentSyncServerCapabilities {
notebookDocumentSync?: NotebookDocumentSyncOptions | NotebookDocumentSyncRegistrationOptions;
}
export declare namespace NotebookDocumentSyncRegistrationType {
const method: 'notebookDocument/sync';
const type: RegistrationType<NotebookDocumentRegistrationOptions>;
const type: RegistrationType<NotebookDocumentSyncRegistrationOptions>;
}

@@ -203,2 +211,7 @@ /**

notebookDocument: NotebookDocument;
/**
* The text documents that represent the content
* of a notebook cell.
*/
cellTextDocuments: TextDocumentItem[];
}

@@ -214,9 +227,78 @@ /**

}
/**
* A change describing how to move a `NotebookCell`
* array from state S to S'.
*
* @since 3.17.0 - proposed state
*/
export interface NotebookCellArrayChange {
/**
* The start oftest of the cell that changed.
*/
start: uinteger;
/**
* The deleted cells
*/
deleteCount: uinteger;
/**
* The new cells, if any
*/
cells?: NotebookCell[];
}
export declare namespace NotebookCellArrayChange {
function is(value: any): value is NotebookCellArrayChange;
function create(start: uinteger, deleteCount: uinteger, cells?: NotebookCell[]): NotebookCellArrayChange;
}
/**
* A change event for a notebook document.
*
* @since 3.17.0 - proposed state
*/
export interface NotebookDocumentChangeEvent {
cells: NotebookCellChange;
/**
* The changed meta data if any.
*/
metadata?: LSPObject;
/**
* Changes to the cell structure to add or
* remove cells.
*/
cellStructure?: {
/**
* The change to the cell array.
*/
array: NotebookCellArrayChange;
/**
* Additional opened cell text documents.
*/
didOpen?: TextDocumentItem[];
/**
* Additional closed cell text documents.
*/
didClose?: TextDocumentIdentifier[];
};
/**
* Changes to notebook cells properties like its
* kind or metadata.
*/
cellData?: NotebookCell[];
/**
* Changes to the text content of notebook cells.
*/
cellTextDocuments?: {
textDocument: VersionedTextDocumentIdentifier;
contentChanges: TextDocumentContentChangeEvent[];
}[];
}
/**
* The params sent in a change notebook document notification.
*
* @since 3.17.0 - proposed state
*/
export interface DidChangeNotebookDocumentParams {
/**
* The notebook document that did change. The version number points
* to the version after all provided changes have been applied.
* to the version after all provided changes have been applied. If
* only the text document content of a cell changes the notebook version
* doesn't necessarily have to change.
*/

@@ -239,3 +321,3 @@ notebookDocument: VersionedNotebookDocumentIdentifier;

*/
changes: NotebookDocumentChangeEvent[];
change: NotebookDocumentChangeEvent;
}

@@ -247,2 +329,22 @@ export declare namespace DidChangeNotebookDocumentNotification {

/**
* The params sent in a save notebook document notification.
*
* @since 3.17.0 - proposed state
*/
export interface DidSaveNotebookDocumentParams {
/**
* The notebook document that got saved.
*/
notebookDocument: NotebookDocumentIdentifier;
}
/**
* A notification sent when a notebook document is saved.
*
* @since 3.17.0 - proposed state
*/
export declare namespace DidSaveNotebookDocumentNotification {
const method: 'notebookDocument/didSave';
const type: ProtocolNotificationType<DidSaveNotebookDocumentParams, void>;
}
/**
* The params sent in a close notebook document notification.

@@ -254,5 +356,10 @@ *

/**
* The notebook document that got opened.
* The notebook document that got closed.
*/
notebookDocument: NotebookDocumentIdentifier;
/**
* The text documents that represent the content
* of a notebook cell that got closed.
*/
cellTextDocuments: TextDocumentIdentifier[];
}

@@ -259,0 +366,0 @@ /**

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.DidCloseNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCellChange = exports.NotebookCell = exports.NotebookCellKind = void 0;
exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.NotebookCellKind = void 0;
const vscode_languageserver_types_1 = require("vscode-languageserver-types");

@@ -40,26 +40,62 @@ const Is = require("./utils/is");

const candidate = value;
return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document);
return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) &&
(candidate.metadata === undefined || Is.objectLiteral(candidate.metadata));
}
NotebookCell.is = is;
function equal(one, two) {
return one.kind === two.kind && one.document === two.document;
function equals(one, other, compareMetaData = false) {
if (one.kind !== other.kind || one.document !== other.document) {
return false;
}
return !compareMetaData || (compareMetaData && equalsMetadata(one.metadata, other.metadata));
}
NotebookCell.equal = equal;
})(NotebookCell = exports.NotebookCell || (exports.NotebookCell = {}));
var NotebookCellChange;
(function (NotebookCellChange) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));
}
NotebookCellChange.is = is;
function create(start, deleteCount, cells) {
const result = { start, deleteCount };
if (cells !== undefined) {
result.cells = cells;
NotebookCell.equals = equals;
function equalsMetadata(one, other) {
if (one === other) {
return true;
}
return result;
if (one === null || one === undefined || other === null || other === undefined) {
return false;
}
if (typeof one !== typeof other) {
return false;
}
if (typeof one !== 'object') {
return false;
}
const oneArray = Array.isArray(one);
const otherArray = Array.isArray(other);
if (oneArray !== otherArray) {
return false;
}
if (oneArray && otherArray) {
if (one.length !== other.length) {
return false;
}
for (let i = 0; i < one.length; i++) {
if (!equalsMetadata(one[i], other[i])) {
return false;
}
}
}
if (Is.objectLiteral(one) && Is.objectLiteral(other)) {
const oneKeys = Object.keys(one);
const otherKeys = Object.keys(other);
if (oneKeys.length !== otherKeys.length) {
return false;
}
oneKeys.sort();
otherKeys.sort();
if (!equalsMetadata(oneKeys, otherKeys)) {
return false;
}
for (let i = 0; i < oneKeys.length; i++) {
const prop = oneKeys[i];
if (!equalsMetadata(one[prop], other[prop])) {
return false;
}
}
}
return true;
}
NotebookCellChange.create = create;
})(NotebookCellChange = exports.NotebookCellChange || (exports.NotebookCellChange = {}));
})(NotebookCell = exports.NotebookCell || (exports.NotebookCell = {}));
var NotebookDocument;

@@ -92,2 +128,18 @@ (function (NotebookDocument) {

})(DidOpenNotebookDocumentNotification = exports.DidOpenNotebookDocumentNotification || (exports.DidOpenNotebookDocumentNotification = {}));
var NotebookCellArrayChange;
(function (NotebookCellArrayChange) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));
}
NotebookCellArrayChange.is = is;
function create(start, deleteCount, cells) {
const result = { start, deleteCount };
if (cells !== undefined) {
result.cells = cells;
}
return result;
}
NotebookCellArrayChange.create = create;
})(NotebookCellArrayChange = exports.NotebookCellArrayChange || (exports.NotebookCellArrayChange = {}));
var DidChangeNotebookDocumentNotification;

@@ -99,2 +151,12 @@ (function (DidChangeNotebookDocumentNotification) {

/**
* A notification sent when a notebook document is saved.
*
* @since 3.17.0 - proposed state
*/
var DidSaveNotebookDocumentNotification;
(function (DidSaveNotebookDocumentNotification) {
DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave';
DidSaveNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method);
})(DidSaveNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification || (exports.DidSaveNotebookDocumentNotification = {}));
/**
* A notification sent when a notebook closes.

@@ -101,0 +163,0 @@ *

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

const candidate = value;
return Is.objectLiteral(candidate) && NotebookDocumentFilter.is(candidate.notebookDocument) && (candidate.cellLanguage === undefined || Is.string(candidate.cellLanguage));
return Is.objectLiteral(candidate) && (NotebookDocumentFilter.is(candidate.notebookDocument) || Is.string(candidate.cellLanguage));
}

@@ -103,0 +103,0 @@ NotebookCellTextDocumentFilter.is = is;

{
"name": "vscode-languageserver-protocol",
"description": "VSCode Language Server Protocol implementation",
"version": "3.17.0-next.12",
"version": "3.17.0-next.13",
"author": "Microsoft Corporation",

@@ -21,4 +21,4 @@ "license": "MIT",

"dependencies": {
"vscode-jsonrpc": "8.0.0-next.5",
"vscode-languageserver-types": "3.17.0-next.6"
"vscode-jsonrpc": "8.0.0-next.6",
"vscode-languageserver-types": "3.17.0-next.7"
},

@@ -25,0 +25,0 @@ "scripts": {

Sorry, the diff of this file is too big to display

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