New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@volar/language-server

Package Overview
Dependencies
Maintainers
0
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/language-server - npm Package Compare versions

Comparing version 2.4.5 to 2.4.6

4

lib/utils/snapshotDocument.d.ts

@@ -23,7 +23,3 @@ import type * as ts from 'typescript';

private resetChanges;
/**
* Calculate the change range from the given content changes.
*/
private calculateChangeRange;
private clearUnreferencedVersions;
}

46

lib/utils/snapshotDocument.js

@@ -40,12 +40,17 @@ "use strict";

if (contentChanges.every(change => 'range' in change)) {
const { minStart, oldLength, lengthDiff } = this.calculateChangeRange(contentChanges);
vscode_languageserver_textdocument_1.TextDocument.update(this.document, contentChanges, version);
let changeRanges = [];
for (const contentChange of contentChanges) {
if (!('range' in contentChange)) {
continue;
}
const start = this.offsetAt(contentChange.range.start);
const length = contentChange.rangeLength ?? this.offsetAt(contentChange.range.end) - start;
changeRanges.push({
span: { start, length },
newLength: contentChange.text.length
});
vscode_languageserver_textdocument_1.TextDocument.update(this.document, [contentChange], version);
}
this.snapshots.push({
changeRange: {
span: {
start: minStart,
length: oldLength,
},
newLength: oldLength + lengthDiff,
},
changeRange: (0, combineChangeRanges_1.combineChangeRanges)(...changeRanges),
version,

@@ -107,25 +112,2 @@ ref: undefined,

}
/**
* Calculate the change range from the given content changes.
*/
calculateChangeRange(contentChanges) {
let lengthDiff = 0;
const starts = [];
const ends = [];
for (const contentChange of contentChanges) {
if (!('range' in contentChange)) {
continue;
}
const start = this.offsetAt(contentChange.range.start);
const length = contentChange.rangeLength ?? this.offsetAt(contentChange.range.end) - start;
const end = start + length;
starts.push(start);
ends.push(end);
lengthDiff += contentChange.text.length - length;
}
const minStart = Math.min(...starts);
const maxEnd = Math.max(...ends);
const oldLength = maxEnd - minStart;
return { minStart, oldLength, lengthDiff };
}
clearUnreferencedVersions() {

@@ -132,0 +114,0 @@ let firstReferencedIndex = 0;

{
"name": "@volar/language-server",
"version": "2.4.5",
"version": "2.4.6",
"license": "MIT",

@@ -15,5 +15,5 @@ "files": [

"dependencies": {
"@volar/language-core": "2.4.5",
"@volar/language-service": "2.4.5",
"@volar/typescript": "2.4.5",
"@volar/language-core": "2.4.6",
"@volar/language-service": "2.4.6",
"@volar/typescript": "2.4.6",
"path-browserify": "^1.0.1",

@@ -29,3 +29,3 @@ "request-light": "^0.7.0",

},
"gitHead": "eb9864da6a36535195b906ae33aca3c0f95286a5"
"gitHead": "f4cec29bc563378069be05cf6a92713914c8608b"
}
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