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

@volar/language-service

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/language-service - npm Package Compare versions

Comparing version 2.2.4 to 2.2.5

4

lib/documents.js

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

matchSourcePosition(position, mapping) {
let offset = (0, language_core_1.translateOffset)(this.embeddedDocument.offsetAt(position), mapping.generatedOffsets, mapping.sourceOffsets, mapping.lengths);
let offset = (0, language_core_1.translateOffset)(this.embeddedDocument.offsetAt(position), mapping.generatedOffsets, mapping.sourceOffsets, mapping.generatedLengths ?? mapping.lengths, mapping.lengths);
if (offset !== undefined) {

@@ -96,3 +96,3 @@ return this.sourceDocument.positionAt(offset);

matchGeneratedPosition(position, mapping) {
let offset = (0, language_core_1.translateOffset)(this.sourceDocument.offsetAt(position), mapping.sourceOffsets, mapping.generatedOffsets, mapping.lengths);
let offset = (0, language_core_1.translateOffset)(this.sourceDocument.offsetAt(position), mapping.sourceOffsets, mapping.generatedOffsets, mapping.lengths, mapping.generatedLengths ?? mapping.lengths);
if (offset !== undefined) {

@@ -99,0 +99,0 @@ return this.embeddedDocument.positionAt(offset);

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

const lastMapping = map.mappings[map.mappings.length - 1];
if (embeddedRange.end === lastMapping.generatedOffsets[lastMapping.generatedOffsets.length - 1] + lastMapping.lengths[lastMapping.lengths.length - 1]) {
if (embeddedRange.end === lastMapping.generatedOffsets[lastMapping.generatedOffsets.length - 1] + (lastMapping.generatedLengths ?? lastMapping.lengths)[lastMapping.lengths.length - 1]) {
embeddedRange.end = code.snapshot.getLength();

@@ -42,0 +42,0 @@ }

@@ -26,14 +26,8 @@ "use strict";

if (overlap) {
if (mappedStart === undefined) {
mappedStart = overlap.start + mapping.generatedOffsets[0] - mappingStart;
}
else {
mappedStart = Math.min(mappedStart, overlap.start + mapping.generatedOffsets[0] - mappingStart);
}
if (mappedEnd === undefined) {
mappedEnd = overlap.end + mapping.generatedOffsets[0] - mappingStart;
}
else {
mappedEnd = Math.max(mappedEnd, overlap.end + mapping.generatedOffsets[0] - mappingStart);
}
const curMappedStart = (overlap.start - mappingStart) + mapping.generatedOffsets[0];
mappedStart = mappedStart === undefined ? curMappedStart : Math.min(mappedStart, curMappedStart);
const lastGeneratedLength = (mapping.generatedLengths ?? mapping.lengths)[mapping.generatedOffsets.length - 1];
const curMappedEndOffset = Math.min(overlap.end - mapping.sourceOffsets[mapping.sourceOffsets.length - 1], lastGeneratedLength);
const curMappedEnd = mapping.generatedOffsets[mapping.generatedOffsets.length - 1] + curMappedEndOffset;
mappedEnd = mappedEnd === undefined ? curMappedEnd : Math.max(mappedEnd, curMappedEnd);
}

@@ -40,0 +34,0 @@ }

{
"name": "@volar/language-service",
"version": "2.2.4",
"version": "2.2.5",
"license": "MIT",

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

"dependencies": {
"@volar/language-core": "2.2.4",
"@volar/language-core": "2.2.5",
"vscode-languageserver-protocol": "^3.17.5",

@@ -21,3 +21,3 @@ "vscode-languageserver-textdocument": "^1.0.11",

},
"gitHead": "71a58c8b9c3a3e420b95df9ffb4a50be37cb31bc"
"gitHead": "ee4aaa9da58c4c942d6cb74f9028d19b7ef4465d"
}
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