@marko/language-server 1.0.8 → 1.0.10

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.js CHANGED
@@ -1181,6 +1181,17 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1181
1181
  var _a2;
1182
1182
  return (_a2 = processor.getRootNames) == null ? void 0 : _a2.call(processor);
1183
1183
  }).flat().filter(Boolean);
1184
+ const trackFile = ps ? (fileName) => {
1185
+ ps.getOrCreateScriptInfoForNormalizedPath(
1186
+ fileName,
1187
+ true,
1188
+ void 0,
1189
+ ts2.ScriptKind.Deferred,
1190
+ false,
1191
+ host
1192
+ );
1193
+ } : () => {
1194
+ };
1184
1195
  const getScriptFileNames = host.getScriptFileNames.bind(host);
1185
1196
  host.getScriptFileNames = () => [
1186
1197
  ...new Set(rootNames.concat(getScriptFileNames()))
@@ -1207,14 +1218,7 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1207
1218
  } catch {
1208
1219
  cached = { snapshot: ts2.ScriptSnapshot.fromString("") };
1209
1220
  }
1210
- ps == null ? void 0 : ps.getOrCreateScriptInfoForNormalizedPath(
1211
- fileName,
1212
- true,
1213
- void 0,
1214
- ts2.ScriptKind.Deferred,
1215
- false,
1216
- host
1217
- );
1221
+ trackFile(fileName);
1218
1222
  extractCache2.set(fileName, cached);
1219
1223
  }
1220
1224
  return cached.snapshot;
@@ -1248,7 +1252,8 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1248
1252
  let normalModuleLiterals = moduleLiterals;
1249
1253
  let resolvedModules;
1250
1254
  for (let i = 0; i < moduleLiterals.length; i++) {
1251
- const moduleName = moduleLiterals[i].text;
1255
+ const moduleLiteral = moduleLiterals[i];
1256
+ const moduleName = moduleLiteral.text;
1252
1257
  const processor = moduleName[0] !== "*" ? getProcessor(moduleName) : void 0;
1253
1258
  if (processor) {
1254
1259
  let resolvedFileName;
@@ -1306,6 +1311,7 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
1306
1311
  });
1307
1312
  } else if (resolvedModules) {
1308
1313
  resolvedModules.push(void 0);
1314
+ normalModuleLiterals.push(moduleLiteral);
1309
1315
  }
1310
1316
  }
1311
1317
  const normalResolvedModules = normalModuleLiterals.length ? resolveModuleNameLiterals(