@marko/language-server 1.0.8 → 1.0.9

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/dist/index.mjs CHANGED
@@ -1207,6 +1207,17 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1207
1207
  var _a2;
1208
1208
  return (_a2 = processor.getRootNames) == null ? void 0 : _a2.call(processor);
1209
1209
  }).flat().filter(Boolean);
1210
+ const trackFile = ps ? (fileName) => {
1211
+ ps.getOrCreateScriptInfoForNormalizedPath(
1212
+ fileName,
1213
+ true,
1214
+ void 0,
1215
+ ts2.ScriptKind.Deferred,
1216
+ false,
1217
+ host
1218
+ );
1219
+ } : () => {
1220
+ };
1210
1221
  const getScriptFileNames = host.getScriptFileNames.bind(host);
1211
1222
  host.getScriptFileNames = () => [
1212
1223
  ...new Set(rootNames.concat(getScriptFileNames()))
@@ -1233,14 +1244,7 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1233
1244
  } catch {
1234
1245
  cached = { snapshot: ts2.ScriptSnapshot.fromString("") };
1235
1246
  }
1236
- ps == null ? void 0 : ps.getOrCreateScriptInfoForNormalizedPath(
1237
- fileName,
1238
- true,
1239
- void 0,
1240
- ts2.ScriptKind.Deferred,
1241
- false,
1242
- host
1243
- );
1247
+ trackFile(fileName);
1244
1248
  extractCache2.set(fileName, cached);
1245
1249
  }
1246
1250
  return cached.snapshot;
@@ -1274,7 +1278,8 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1274
1278
  let normalModuleLiterals = moduleLiterals;
1275
1279
  let resolvedModules;
1276
1280
  for (let i = 0; i < moduleLiterals.length; i++) {
1277
- const moduleName = moduleLiterals[i].text;
1281
+ const moduleLiteral = moduleLiterals[i];
1282
+ const moduleName = moduleLiteral.text;
1278
1283
  const processor = moduleName[0] !== "*" ? getProcessor(moduleName) : void 0;
1279
1284
  if (processor) {
1280
1285
  let resolvedFileName;
@@ -1332,6 +1337,7 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1332
1337
  });
1333
1338
  } else if (resolvedModules) {
1334
1339
  resolvedModules.push(void 0);
1340
+ normalModuleLiterals.push(moduleLiteral);
1335
1341
  }
1336
1342
  }
1337
1343
  const normalResolvedModules = normalModuleLiterals.length ? resolveModuleNameLiterals(