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

vscode-languageserver-types

Package Overview
Dependencies
Maintainers
7
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-languageserver-types - npm Package Compare versions

Comparing version 3.0.3 to 3.2.0-alpha.1

20

lib/main.d.ts

@@ -252,3 +252,3 @@ /**

* The TextDocumentEdit namespace provides helper function to create
* create a edit that manipulates a text document.
* an edit that manipulates a text document.
*/

@@ -263,7 +263,19 @@ export declare namespace TextDocumentEdit {

/**
* A workspace edit represents changes to many resources managed
* in the workspace.
* A workspace edit represents changes to many resources managed in the workspace. The edit
* should either provide `changes` or `documentChanges`. If documentChanges are present
* they are preferred over `changes` if the client can handle versioned document edits.
*/
export interface WorkspaceEdit {
changes: TextDocumentEdit[];
/**
* Holds changes to existing resources.
*/
changes?: {
[uri: string]: TextEdit[];
};
/**
* An array of `TextDocumentEdit`s to express changes to specific a specific
* version of a text document. Whether a client supports versioned document
* edits is expressed via `WorkspaceClientCapabilites.versionedWorkspaceEdit`.
*/
documentChanges?: TextDocumentEdit[];
}

@@ -270,0 +282,0 @@ /**

50

lib/main.js

@@ -214,3 +214,3 @@ (function (factory) {

* The TextDocumentEdit namespace provides helper function to create
* create a edit that manipulates a text document.
* an edit that manipulates a text document.
*/

@@ -267,12 +267,15 @@ var TextDocumentEdit;

this._workspaceEdit = workspaceEdit;
workspaceEdit.changes.forEach(function (textDocumentEdit) {
var textEditChange = new TextEditChangeImpl(textDocumentEdit.edits);
_this._textEditChanges[textDocumentEdit.textDocument.uri] = textEditChange;
});
if (workspaceEdit.documentChanges) {
workspaceEdit.documentChanges.forEach(function (textDocumentEdit) {
var textEditChange = new TextEditChangeImpl(textDocumentEdit.edits);
_this._textEditChanges[textDocumentEdit.textDocument.uri] = textEditChange;
});
}
else if (workspaceEdit.changes) {
Object.keys(workspaceEdit.changes).forEach(function (key) {
var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
_this._textEditChanges[key] = textEditChange;
});
}
}
else {
this._workspaceEdit = {
changes: []
};
}
}

@@ -292,2 +295,10 @@ Object.defineProperty(WorkspaceChange.prototype, "edit", {

if (VersionedTextDocumentIdentifier.is(key)) {
if (!this._workspaceEdit) {
this._workspaceEdit = {
documentChanges: []
};
}
if (!this._workspaceEdit.documentChanges) {
throw new Error('Workspace edit is not configured for versioned document changes.');
}
var textDocument = key;

@@ -301,3 +312,3 @@ var result = this._textEditChanges[textDocument.uri];

};
this._workspaceEdit.changes.push(textDocumentEdit);
this._workspaceEdit.documentChanges.push(textDocumentEdit);
result = new TextEditChangeImpl(edits);

@@ -309,3 +320,18 @@ this._textEditChanges[textDocument.uri] = result;

else {
return this._textEditChanges[key];
if (!this._workspaceEdit) {
this._workspaceEdit = {
changes: Object.create(null)
};
}
if (!this._workspaceEdit.changes) {
throw new Error('Workspace edit is not configured for normal text edit changes.');
}
var result = this._textEditChanges[key];
if (!result) {
var edits = [];
this._workspaceEdit.changes[key] = edits;
result = new TextEditChangeImpl(edits);
this._textEditChanges[key] = result;
}
return result;
}

@@ -312,0 +338,0 @@ };

{
"name": "vscode-languageserver-types",
"description": "Types used by the Language server for node",
"version": "3.0.3",
"version": "3.2.0-alpha.1",
"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