@volar/language-service
Advanced tools
Comparing version 2.2.4 to 2.2.5
@@ -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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194727
3933
+ Added@volar/language-core@2.2.5(transitive)
+ Added@volar/source-map@2.2.5(transitive)
- Removed@volar/language-core@2.2.4(transitive)
- Removed@volar/source-map@2.2.4(transitive)
Updated@volar/language-core@2.2.5