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.1-alpha.3 to 3.0.1-alpha.4

3

lib/main.d.ts

@@ -288,3 +288,3 @@ /**

private _textEditChanges;
constructor();
constructor(workspaceEdit?: WorkspaceEdit);
/**

@@ -300,2 +300,3 @@ * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal

getTextEditChange(textDocument: VersionedTextDocumentIdentifier): TextEditChange;
getTextEditChange(uri: string): TextEditChange;
}

@@ -302,0 +303,0 @@ /**

@@ -189,2 +189,23 @@ (function (factory) {

})(TextEdit = exports.TextEdit || (exports.TextEdit = {}));
var TextEditChangeImpl = (function () {
function TextEditChangeImpl(edits) {
this.edits = edits;
}
TextEditChangeImpl.prototype.insert = function (position, newText) {
this.edits.push(TextEdit.insert(position, newText));
};
TextEditChangeImpl.prototype.replace = function (range, newText) {
this.edits.push(TextEdit.replace(range, newText));
};
TextEditChangeImpl.prototype.delete = function (range) {
this.edits.push(TextEdit.del(range));
};
TextEditChangeImpl.prototype.all = function () {
return this.edits;
};
TextEditChangeImpl.prototype.clear = function () {
this.edits.splice(0, this.edits.length);
};
return TextEditChangeImpl;
}());
/**

@@ -194,7 +215,17 @@ * A workspace change helps constructing changes to a workspace.

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

@@ -212,40 +243,21 @@ Object.defineProperty(WorkspaceChange.prototype, "edit", {

});
/**
* Returns the [TextEditChange](#TextEditChange) to manage text edits
* for resources.
*/
WorkspaceChange.prototype.getTextEditChange = function (textDocument) {
var TextEditChangeImpl = (function () {
function TextEditChangeImpl(edits) {
this.edits = edits;
WorkspaceChange.prototype.getTextEditChange = function (key) {
if (VersionedTextDocumentIdentifier.is(key)) {
var textDocument = key;
var result = this._textEditChanges[textDocument.uri];
if (!result) {
var edits = [];
var textDocumentEdit = {
textDocument: textDocument,
edits: edits
};
this._workspaceEdit.changes.push(textDocumentEdit);
result = new TextEditChangeImpl(edits);
this._textEditChanges[textDocument.uri] = result;
}
TextEditChangeImpl.prototype.insert = function (position, newText) {
this.edits.push(TextEdit.insert(position, newText));
};
TextEditChangeImpl.prototype.replace = function (range, newText) {
this.edits.push(TextEdit.replace(range, newText));
};
TextEditChangeImpl.prototype.delete = function (range) {
this.edits.push(TextEdit.del(range));
};
TextEditChangeImpl.prototype.all = function () {
return this.edits;
};
TextEditChangeImpl.prototype.clear = function () {
this.edits.splice(0, this.edits.length);
};
return TextEditChangeImpl;
}());
var result = this._textEditChanges[textDocument.uri];
if (!result) {
var edits = [];
var textDocumentEdit = {
textDocument: textDocument,
edits: edits
};
this._workspaceEdit.changes.push(textDocumentEdit);
result = new TextEditChangeImpl(edits);
this._textEditChanges[textDocument.uri] = result;
return result;
}
return result;
else {
return this._textEditChanges[key];
}
};

@@ -252,0 +264,0 @@ return WorkspaceChange;

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