@volar/language-core 2.3.0-alpha.11 → 2.3.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -142,13 +142,14 @@ function createLanguage(plugins, scriptRegistry, sync) {
142
142
  },
143
143
  },
144
144
  maps: {
145
- get(virtualCode, sourceScript, mappings) {
145
+ get(virtualCode, sourceScript) {
146
146
  let mapCache = virtualCodeToSourceMap.get(virtualCode.snapshot);
147
147
  if (!mapCache) {
148
148
  virtualCodeToSourceMap.set(virtualCode.snapshot, mapCache = new WeakMap());
149
149
  }
150
150
  if (!mapCache.has(sourceScript.snapshot)) {
151
- mapCache.set(sourceScript.snapshot, new source_map_1.SourceMap(mappings ?? virtualCode.mappings));
151
+ const mappings = virtualCode.associatedScriptMappings?.get(sourceScript.id) ?? virtualCode.mappings;
152
+ mapCache.set(sourceScript.snapshot, new source_map_1.SourceMap(mappings));
152
153
  }
153
154
  return mapCache.get(sourceScript.snapshot);
154
155
  },
@@ -160,13 +161,13 @@ function createLanguage(plugins, scriptRegistry, sync) {
160
161
  this.get(virtualCode, sourceScript),
161
162
  ];
162
163
  if (virtualCode.associatedScriptMappings) {
163
- for (const [relatedScriptId, relatedMappings] of virtualCode.associatedScriptMappings) {
164
+ for (const [relatedScriptId] of virtualCode.associatedScriptMappings) {
164
165
  const relatedSourceScript = scriptRegistry.get(relatedScriptId);
165
166
  if (relatedSourceScript) {
166
167
  yield [
167
168
  relatedSourceScript.id,
168
169
  relatedSourceScript.snapshot,
169
- this.get(virtualCode, relatedSourceScript, relatedMappings),
170
+ this.get(virtualCode, relatedSourceScript),
170
171
  ];
171
172
  }
172
173
  }
package/lib/types.d.ts CHANGED
@@ -10,7 +10,7 @@ export interface Language<T = unknown> {
10
10
  fromVirtualCode(virtualCode: VirtualCode): SourceScript<T>;
11
11
  };
12
12
  maps: {
13
- get(virtualCode: VirtualCode, sourceScript: SourceScript<T>, mappings?: Mapping<CodeInformation>[]): SourceMap<CodeInformation>;
13
+ get(virtualCode: VirtualCode, sourceScript: SourceScript<T>): SourceMap<CodeInformation>;
14
14
  forEach(virtualCode: VirtualCode): Generator<[id: T, snapshot: ts.IScriptSnapshot, map: SourceMap<CodeInformation>]>;
15
15
  };
16
16
  linkedCodeMaps: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/language-core",
3
- "version": "2.3.0-alpha.11",
3
+ "version": "2.3.0-alpha.13",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -12,7 +12,7 @@
12
12
  "directory": "packages/language-core"
13
13
  },
14
14
  "dependencies": {
15
- "@volar/source-map": "2.3.0-alpha.11"
15
+ "@volar/source-map": "2.3.0-alpha.13"
16
16
  },
17
- "gitHead": "c83f835629496d3a4cc38f4b789bb676d07a2118"
17
+ "gitHead": "4effe4689ac845b17b7c821d50deda62c124f23b"
18
18
  }