@volar/typescript
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -829,10 +829,26 @@ "use strict"; | ||
let end; | ||
const map = language.maps.get(serviceScript.code, targetScript); | ||
const map = language.maps.get(serviceScript.code, sourceScript); | ||
for (const mapping of map.mappings) { | ||
if ((0, language_core_1.isInlayHintsEnabled)(mapping.data) && mapping.sourceOffsets[0] >= span.start && mapping.sourceOffsets[0] <= span.start + span.length) { | ||
start ??= mapping.generatedOffsets[0]; | ||
end ??= mapping.generatedOffsets[mapping.generatedOffsets.length - 1]; | ||
start = Math.min(start, mapping.generatedOffsets[0]); | ||
end = Math.max(end, mapping.generatedOffsets[mapping.generatedOffsets.length - 1]); | ||
if (!(0, language_core_1.isInlayHintsEnabled)(mapping.data)) { | ||
continue; | ||
} | ||
let mappingStart = mapping.sourceOffsets[0]; | ||
let genStart; | ||
let genEnd; | ||
if (mappingStart >= span.start && mappingStart <= span.start + span.length) { | ||
genStart = mapping.generatedOffsets[0]; | ||
genEnd = mapping.generatedOffsets[mapping.generatedOffsets.length - 1] | ||
+ (mapping.generatedLengths ?? mapping.lengths)[mapping.generatedOffsets.length - 1]; | ||
} | ||
else if (mappingStart < span.start && span.start < mappingStart + mapping.lengths[0] | ||
&& mapping.sourceOffsets.length == 1 | ||
&& (!mapping.generatedLengths || mapping.generatedLengths[0] === mapping.lengths[0])) { | ||
genStart = mapping.generatedOffsets[0] + span.start - mappingStart; | ||
genEnd = Math.min(genStart + span.length, mapping.generatedOffsets[0] + mapping.lengths[0]); | ||
} | ||
else { | ||
continue; | ||
} | ||
start = Math.min(start ?? genStart, genStart); | ||
end = Math.max(end ?? genEnd, genEnd); | ||
} | ||
@@ -839,0 +855,0 @@ if (start === undefined || end === undefined) { |
{ | ||
"name": "@volar/typescript", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"license": "MIT", | ||
@@ -15,3 +15,3 @@ "files": [ | ||
"dependencies": { | ||
"@volar/language-core": "2.4.1", | ||
"@volar/language-core": "2.4.2", | ||
"path-browserify": "^1.0.1", | ||
@@ -23,5 +23,5 @@ "vscode-uri": "^3.0.8" | ||
"@types/path-browserify": "latest", | ||
"@volar/language-service": "2.4.1" | ||
"@volar/language-service": "2.4.2" | ||
}, | ||
"gitHead": "b920b6c4a3e4b2d8f46c676ea414e94c437cb5b7" | ||
"gitHead": "f384d55ef4ae21e9f9a6796c9676a4a710458ed9" | ||
} |
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
205091
4358
+ Added@volar/language-core@2.4.2(transitive)
+ Added@volar/source-map@2.4.2(transitive)
- Removed@volar/language-core@2.4.1(transitive)
- Removed@volar/source-map@2.4.1(transitive)
Updated@volar/language-core@2.4.2