@volar/language-core
Advanced tools
Comparing version 2.3.0-alpha.8 to 2.3.0-alpha.9
30
index.js
@@ -145,9 +145,3 @@ "use strict"; | ||
maps: { | ||
get(virtualCode) { | ||
for (const map of this.forEach(virtualCode)) { | ||
return map[2]; | ||
} | ||
throw `no map found for ${virtualCode.id}`; | ||
}, | ||
*forEach(virtualCode) { | ||
get(virtualCode, sourceScript, mappings) { | ||
let mapCache = virtualCodeToSourceMap.get(virtualCode.snapshot); | ||
@@ -157,7 +151,14 @@ if (!mapCache) { | ||
} | ||
const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode); | ||
if (!mapCache.has(sourceScript.snapshot)) { | ||
mapCache.set(sourceScript.snapshot, new source_map_1.SourceMap(virtualCode.mappings)); | ||
mapCache.set(sourceScript.snapshot, new source_map_1.SourceMap(mappings ?? virtualCode.mappings)); | ||
} | ||
yield [sourceScript.id, sourceScript.snapshot, mapCache.get(sourceScript.snapshot)]; | ||
return mapCache.get(sourceScript.snapshot); | ||
}, | ||
*forEach(virtualCode) { | ||
const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode); | ||
yield [ | ||
sourceScript.id, | ||
sourceScript.snapshot, | ||
this.get(virtualCode, sourceScript), | ||
]; | ||
if (virtualCode.associatedScriptMappings) { | ||
@@ -167,6 +168,7 @@ for (const [relatedScriptId, relatedMappings] of virtualCode.associatedScriptMappings) { | ||
if (relatedSourceScript) { | ||
if (!mapCache.has(relatedSourceScript.snapshot)) { | ||
mapCache.set(relatedSourceScript.snapshot, new source_map_1.SourceMap(relatedMappings)); | ||
} | ||
yield [relatedSourceScript.id, relatedSourceScript.snapshot, mapCache.get(relatedSourceScript.snapshot)]; | ||
yield [ | ||
relatedSourceScript.id, | ||
relatedSourceScript.snapshot, | ||
this.get(virtualCode, relatedSourceScript, relatedMappings), | ||
]; | ||
} | ||
@@ -173,0 +175,0 @@ } |
@@ -13,3 +13,3 @@ import type { Mapping, SourceMap } from '@volar/source-map'; | ||
maps: { | ||
get(virtualCode: VirtualCode): SourceMap<CodeInformation>; | ||
get(virtualCode: VirtualCode, sourceScript: SourceScript<T>, mappings?: Mapping<CodeInformation>[]): SourceMap<CodeInformation>; | ||
forEach(virtualCode: VirtualCode): Generator<[id: T, snapshot: ts.IScriptSnapshot, map: SourceMap<CodeInformation>]>; | ||
@@ -16,0 +16,0 @@ }; |
{ | ||
"name": "@volar/language-core", | ||
"version": "2.3.0-alpha.8", | ||
"version": "2.3.0-alpha.9", | ||
"license": "MIT", | ||
@@ -15,5 +15,5 @@ "files": [ | ||
"dependencies": { | ||
"@volar/source-map": "2.3.0-alpha.8" | ||
"@volar/source-map": "2.3.0-alpha.9" | ||
}, | ||
"gitHead": "377a0083ac697a476509805a6777a2339391dcaf" | ||
"gitHead": "3f741930343896dfc464a893ebe5f3619bb1a1aa" | ||
} |
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
586
26748
+ Added@volar/source-map@2.3.0-alpha.9(transitive)
- Removed@volar/source-map@2.3.0-alpha.8(transitive)