typescript 7.1.0-dev.20261019.1 → 7.1.0-dev.20261020.3

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.
@@ -22,7 +22,7 @@ import { TypePredicateKind } from "#enums/typePredicateKind";
22
22
  import { ModifierFlags, unescapeLeadingUnderscores, } from "../../ast/index.js";
23
23
  import { assertNever } from "../../internal/utils.js";
24
24
  import { encodeNode, uint8ArrayToBase64, } from "../node/encoder.js";
25
- import { decodeNode, getNodeId, parseNodeHandleFromCompiler, readParseOptionsKey, readSourceFileHash, readSourceFileLease, RemoteNode, RemoteSourceFile, } from "../node/node.js";
25
+ import { decodeNode, getNodeId, getNodeRequestHandle, parseNodeHandleFromCompiler, readParseOptionsKey, readSourceFileHash, readSourceFileLease, RemoteNode, RemoteSourceFile, } from "../node/node.js";
26
26
  import { Wtf8Decoder } from "../node/wtf8.js";
27
27
  import { canonicalize, CaseSensitivity, pathKey, toRootedDirectoryPath, toRootedPath, } from "../path.js";
28
28
  import { prepareCompilerOptions } from "../prepareCompilerOptions.generated.js";
@@ -1128,13 +1128,15 @@ export class ModuleResolver {
1128
1128
  }
1129
1129
  class SnapshotObjectRegistry {
1130
1130
  symbols = new Map();
1131
+ nodeHandles = new Map();
1131
1132
  projectRegistries = new Map();
1132
1133
  snapshotId;
1134
+ disposed = false;
1133
1135
  constructor(snapshotId) {
1134
1136
  this.snapshotId = snapshotId;
1135
1137
  }
1136
1138
  addProjectRegistry(registry) {
1137
- this.projectRegistries.set(registry.project.id, registry);
1139
+ this.projectRegistries.set(registry.project.handle, registry);
1138
1140
  }
1139
1141
  getOrCreateSymbol(data) {
1140
1142
  const reference = data.reference;
@@ -1156,8 +1158,19 @@ class SnapshotObjectRegistry {
1156
1158
  getSymbol(id) {
1157
1159
  return this.symbols.get(id);
1158
1160
  }
1161
+ getOrCreateNodeHandle(handle, project) {
1162
+ let node = this.nodeHandles.get(handle);
1163
+ if (!node) {
1164
+ node = new NodeHandle(handle, project);
1165
+ if (!this.disposed)
1166
+ this.nodeHandles.set(handle, node);
1167
+ }
1168
+ return node;
1169
+ }
1159
1170
  clear() {
1171
+ this.disposed = true;
1160
1172
  this.symbols.clear();
1173
+ this.nodeHandles.clear();
1161
1174
  }
1162
1175
  }
1163
1176
  class ProjectObjectRegistry {
@@ -1217,7 +1230,7 @@ class ProjectObjectRegistry {
1217
1230
  return this.types.get(id);
1218
1231
  }
1219
1232
  createNodeHandle(handle) {
1220
- return new NodeHandle(handle, this.project);
1233
+ return this.snapshotRegistry.getOrCreateNodeHandle(handle, this.project);
1221
1234
  }
1222
1235
  getOrCreateSignature(data) {
1223
1236
  let sig = this.signatures.get(data.id);
@@ -1251,7 +1264,7 @@ class ProjectObjectRegistry {
1251
1264
  }
1252
1265
  const data = owner.client.apiRequest(method, {
1253
1266
  snapshot: owner.snapshotId,
1254
- project: owner.project.id,
1267
+ project: owner.project.handle,
1255
1268
  objectId: source.id,
1256
1269
  });
1257
1270
  if (!data)
@@ -1267,7 +1280,7 @@ class ProjectObjectRegistry {
1267
1280
  }
1268
1281
  const data = yield* apiRequest(method, {
1269
1282
  snapshot: owner.snapshotId,
1270
- project: owner.project.id,
1283
+ project: owner.project.handle,
1271
1284
  objectId: source.id,
1272
1285
  });
1273
1286
  if (!data)
@@ -1301,7 +1314,7 @@ class ProjectObjectRegistry {
1301
1314
  ? owner.client.apiRequest(method, { symbol: source.reference })
1302
1315
  : owner.client.apiRequest(method, {
1303
1316
  snapshot: owner.snapshotId,
1304
- project: owner.project.id,
1317
+ project: owner.project.handle,
1305
1318
  objectId: source.id,
1306
1319
  });
1307
1320
  if (!data)
@@ -1317,7 +1330,7 @@ class ProjectObjectRegistry {
1317
1330
  ? yield* apiRequest(method, { symbol: source.reference })
1318
1331
  : yield* apiRequest(method, {
1319
1332
  snapshot: owner.snapshotId,
1320
- project: owner.project.id,
1333
+ project: owner.project.handle,
1321
1334
  objectId: source.id,
1322
1335
  });
1323
1336
  if (!data)
@@ -1335,7 +1348,7 @@ class ProjectObjectRegistry {
1335
1348
  return cached;
1336
1349
  const data = owner.client.apiRequest(method, {
1337
1350
  snapshot: owner.snapshotId,
1338
- project: owner.project.id,
1351
+ project: owner.project.handle,
1339
1352
  objectId: source.id,
1340
1353
  });
1341
1354
  if (!data)
@@ -1349,7 +1362,7 @@ class ProjectObjectRegistry {
1349
1362
  return cached;
1350
1363
  const data = yield* apiRequest(method, {
1351
1364
  snapshot: owner.snapshotId,
1352
- project: owner.project.id,
1365
+ project: owner.project.handle,
1353
1366
  objectId: source.id,
1354
1367
  });
1355
1368
  if (!data)
@@ -1376,7 +1389,7 @@ class ProjectObjectRegistry {
1376
1389
  }
1377
1390
  const typesData = owner.client.apiRequest(method, {
1378
1391
  snapshot: owner.snapshotId,
1379
- project: owner.project.id,
1392
+ project: owner.project.handle,
1380
1393
  objectId: source.id,
1381
1394
  });
1382
1395
  if (typesData == null)
@@ -1400,7 +1413,7 @@ class ProjectObjectRegistry {
1400
1413
  }
1401
1414
  const typesData = yield* apiRequest(method, {
1402
1415
  snapshot: owner.snapshotId,
1403
- project: owner.project.id,
1416
+ project: owner.project.handle,
1404
1417
  objectId: source.id,
1405
1418
  });
1406
1419
  if (typesData == null)
@@ -1446,7 +1459,7 @@ class ProjectObjectRegistry {
1446
1459
  ? owner.client.apiRequest(method, { symbol: source.reference })
1447
1460
  : owner.client.apiRequest(method, {
1448
1461
  snapshot: owner.snapshotId,
1449
- project: owner.project.id,
1462
+ project: owner.project.handle,
1450
1463
  objectId: source.id,
1451
1464
  });
1452
1465
  return data?.map(symbol => owner.getOrCreateSymbol(symbol)) ?? [];
@@ -1455,7 +1468,7 @@ class ProjectObjectRegistry {
1455
1468
  ? yield* apiRequest(method, { symbol: source.reference })
1456
1469
  : yield* apiRequest(method, {
1457
1470
  snapshot: owner.snapshotId,
1458
- project: owner.project.id,
1471
+ project: owner.project.handle,
1459
1472
  objectId: source.id,
1460
1473
  });
1461
1474
  return data?.map(symbol => owner.getOrCreateSymbol(symbol)) ?? [];
@@ -1468,7 +1481,7 @@ class ProjectObjectRegistry {
1468
1481
  return cacheGeneratorMethod(owner, "fetchBaseTypes", function (source) {
1469
1482
  const typesData = owner.client.apiRequest("getBaseTypes", {
1470
1483
  snapshot: owner.snapshotId,
1471
- project: owner.project.id,
1484
+ project: owner.project.handle,
1472
1485
  type: source.id,
1473
1486
  });
1474
1487
  if (typesData == null)
@@ -1477,7 +1490,7 @@ class ProjectObjectRegistry {
1477
1490
  }, function* (source) {
1478
1491
  const typesData = yield* apiRequest("getBaseTypes", {
1479
1492
  snapshot: owner.snapshotId,
1480
- project: owner.project.id,
1493
+ project: owner.project.handle,
1481
1494
  type: source.id,
1482
1495
  });
1483
1496
  if (typesData == null)
@@ -1490,14 +1503,14 @@ class ProjectObjectRegistry {
1490
1503
  return cacheGeneratorMethod(owner, "fetchPropertiesOfType", function (source) {
1491
1504
  const data = owner.client.apiRequest("getPropertiesOfType", {
1492
1505
  snapshot: owner.snapshotId,
1493
- project: owner.project.id,
1506
+ project: owner.project.handle,
1494
1507
  type: source.id,
1495
1508
  });
1496
1509
  return data ? data.map(symbol => owner.getOrCreateSymbol(symbol)) : [];
1497
1510
  }, function* (source) {
1498
1511
  const data = yield* apiRequest("getPropertiesOfType", {
1499
1512
  snapshot: owner.snapshotId,
1500
- project: owner.project.id,
1513
+ project: owner.project.handle,
1501
1514
  type: source.id,
1502
1515
  });
1503
1516
  return data ? data.map(symbol => owner.getOrCreateSymbol(symbol)) : [];
@@ -1508,14 +1521,14 @@ class ProjectObjectRegistry {
1508
1521
  return cacheGeneratorMethod(owner, "fetchApparentPropertiesOfType", function (source) {
1509
1522
  const data = owner.client.apiRequest("getApparentPropertiesOfType", {
1510
1523
  snapshot: owner.snapshotId,
1511
- project: owner.project.id,
1524
+ project: owner.project.handle,
1512
1525
  objectId: source.id,
1513
1526
  });
1514
1527
  return data ? data.map(symbol => owner.getOrCreateSymbol(symbol)) : [];
1515
1528
  }, function* (source) {
1516
1529
  const data = yield* apiRequest("getApparentPropertiesOfType", {
1517
1530
  snapshot: owner.snapshotId,
1518
- project: owner.project.id,
1531
+ project: owner.project.handle,
1519
1532
  objectId: source.id,
1520
1533
  });
1521
1534
  return data ? data.map(symbol => owner.getOrCreateSymbol(symbol)) : [];
@@ -1526,7 +1539,7 @@ class ProjectObjectRegistry {
1526
1539
  return cacheGeneratorMethod(owner, "fetchPropertyOfType", function (source, name) {
1527
1540
  const data = owner.client.apiRequest("getPropertyOfType", {
1528
1541
  snapshot: owner.snapshotId,
1529
- project: owner.project.id,
1542
+ project: owner.project.handle,
1530
1543
  type: source.id,
1531
1544
  name,
1532
1545
  });
@@ -1534,7 +1547,7 @@ class ProjectObjectRegistry {
1534
1547
  }, function* (source, name) {
1535
1548
  const data = yield* apiRequest("getPropertyOfType", {
1536
1549
  snapshot: owner.snapshotId,
1537
- project: owner.project.id,
1550
+ project: owner.project.handle,
1538
1551
  type: source.id,
1539
1552
  name,
1540
1553
  });
@@ -1546,7 +1559,7 @@ class ProjectObjectRegistry {
1546
1559
  return cacheGeneratorMethod(owner, "fetchSignaturesOfType", function (source, kind) {
1547
1560
  const data = owner.client.apiRequest("getSignaturesOfType", {
1548
1561
  snapshot: owner.snapshotId,
1549
- project: owner.project.id,
1562
+ project: owner.project.handle,
1550
1563
  type: source.id,
1551
1564
  kind,
1552
1565
  });
@@ -1554,7 +1567,7 @@ class ProjectObjectRegistry {
1554
1567
  }, function* (source, kind) {
1555
1568
  const data = yield* apiRequest("getSignaturesOfType", {
1556
1569
  snapshot: owner.snapshotId,
1557
- project: owner.project.id,
1570
+ project: owner.project.handle,
1558
1571
  type: source.id,
1559
1572
  kind,
1560
1573
  });
@@ -1566,7 +1579,7 @@ class ProjectObjectRegistry {
1566
1579
  return cacheGeneratorMethod(owner, "fetchIndexInfosOfType", function (source) {
1567
1580
  const data = owner.client.apiRequest("getIndexInfosOfType", {
1568
1581
  snapshot: owner.snapshotId,
1569
- project: owner.project.id,
1582
+ project: owner.project.handle,
1570
1583
  type: source.id,
1571
1584
  });
1572
1585
  if (!data)
@@ -1575,12 +1588,12 @@ class ProjectObjectRegistry {
1575
1588
  keyType: owner.getOrCreateType(info.keyType),
1576
1589
  valueType: owner.getOrCreateType(info.valueType),
1577
1590
  isReadonly: info.isReadonly ?? false,
1578
- declaration: info.declaration ? new NodeHandle(info.declaration, owner.project) : undefined,
1591
+ declaration: info.declaration ? owner.createNodeHandle(info.declaration) : undefined,
1579
1592
  }));
1580
1593
  }, function* (source) {
1581
1594
  const data = yield* apiRequest("getIndexInfosOfType", {
1582
1595
  snapshot: owner.snapshotId,
1583
- project: owner.project.id,
1596
+ project: owner.project.handle,
1584
1597
  type: source.id,
1585
1598
  });
1586
1599
  if (!data)
@@ -1589,7 +1602,7 @@ class ProjectObjectRegistry {
1589
1602
  keyType: owner.getOrCreateType(info.keyType),
1590
1603
  valueType: owner.getOrCreateType(info.valueType),
1591
1604
  isReadonly: info.isReadonly ?? false,
1592
- declaration: info.declaration ? new NodeHandle(info.declaration, owner.project) : undefined,
1605
+ declaration: info.declaration ? owner.createNodeHandle(info.declaration) : undefined,
1593
1606
  }));
1594
1607
  });
1595
1608
  }
@@ -1598,7 +1611,7 @@ class ProjectObjectRegistry {
1598
1611
  return cacheGeneratorMethod(owner, "fetchTypeParameterAtPosition", function (source, pos) {
1599
1612
  const data = owner.client.apiRequest("getTypeParameterAtPosition", {
1600
1613
  snapshot: owner.snapshotId,
1601
- project: owner.project.id,
1614
+ project: owner.project.handle,
1602
1615
  signature: source.id,
1603
1616
  index: pos,
1604
1617
  });
@@ -1606,7 +1619,7 @@ class ProjectObjectRegistry {
1606
1619
  }, function* (source, pos) {
1607
1620
  const data = yield* apiRequest("getTypeParameterAtPosition", {
1608
1621
  snapshot: owner.snapshotId,
1609
- project: owner.project.id,
1622
+ project: owner.project.handle,
1610
1623
  signature: source.id,
1611
1624
  index: pos,
1612
1625
  });
@@ -1618,6 +1631,11 @@ export class Project {
1618
1631
  /** @internal */
1619
1632
  api;
1620
1633
  id;
1634
+ /**
1635
+ * Server identity for this project's lifetime across snapshots.
1636
+ * @internal
1637
+ */
1638
+ handle;
1621
1639
  configFileName;
1622
1640
  currentDirectory;
1623
1641
  dirty;
@@ -1627,6 +1645,7 @@ export class Project {
1627
1645
  languageService;
1628
1646
  constructor(data, snapshotId, toPath, api, snapshotRegistry) {
1629
1647
  this.id = data.id;
1648
+ this.handle = data.handle;
1630
1649
  this.api = api;
1631
1650
  this.configFileName = data.configFileName;
1632
1651
  this.currentDirectory = data.currentDirectory;
@@ -1676,7 +1695,7 @@ export class LanguageService {
1676
1695
  });
1677
1696
  const data = owner.client.apiRequest("getImportAdderEdits", {
1678
1697
  snapshot: owner.snapshotId,
1679
- project: owner.project.id,
1698
+ project: owner.project.handle,
1680
1699
  file,
1681
1700
  actions: requestActions,
1682
1701
  });
@@ -1699,7 +1718,7 @@ export class LanguageService {
1699
1718
  });
1700
1719
  const data = yield* apiRequest("getImportAdderEdits", {
1701
1720
  snapshot: owner.snapshotId,
1702
- project: owner.project.id,
1721
+ project: owner.project.handle,
1703
1722
  file,
1704
1723
  actions: requestActions,
1705
1724
  });
@@ -1743,26 +1762,26 @@ export class LanguageService {
1743
1762
  return cacheGeneratorMethod(owner, "getReferencedSymbolsForNode", function (node, position) {
1744
1763
  const data = owner.client.apiRequest("getReferencedSymbolsForNode", {
1745
1764
  snapshot: owner.snapshotId,
1746
- project: owner.project.id,
1747
- node: getNodeId(node),
1765
+ project: owner.project.handle,
1766
+ node: getNodeRequestHandle(node),
1748
1767
  position,
1749
1768
  });
1750
1769
  return (data ?? []).map(entry => ({
1751
- definition: new NodeHandle(entry.definition, owner.project),
1770
+ definition: owner.objectRegistry.createNodeHandle(entry.definition),
1752
1771
  symbol: entry.symbol ? owner.objectRegistry.getOrCreateSymbol(entry.symbol) : undefined,
1753
- references: (entry.references ?? []).map(h => new NodeHandle(h, owner.project)),
1772
+ references: (entry.references ?? []).map(h => owner.objectRegistry.createNodeHandle(h)),
1754
1773
  }));
1755
1774
  }, function* (node, position) {
1756
1775
  const data = yield* apiRequest("getReferencedSymbolsForNode", {
1757
1776
  snapshot: owner.snapshotId,
1758
- project: owner.project.id,
1759
- node: getNodeId(node),
1777
+ project: owner.project.handle,
1778
+ node: getNodeRequestHandle(node),
1760
1779
  position,
1761
1780
  });
1762
1781
  return (data ?? []).map(entry => ({
1763
- definition: new NodeHandle(entry.definition, owner.project),
1782
+ definition: owner.objectRegistry.createNodeHandle(entry.definition),
1764
1783
  symbol: entry.symbol ? owner.objectRegistry.getOrCreateSymbol(entry.symbol) : undefined,
1765
- references: (entry.references ?? []).map(h => new NodeHandle(h, owner.project)),
1784
+ references: (entry.references ?? []).map(h => owner.objectRegistry.createNodeHandle(h)),
1766
1785
  }));
1767
1786
  });
1768
1787
  }
@@ -1771,22 +1790,22 @@ export class LanguageService {
1771
1790
  return cacheGeneratorMethod(owner, "getSignatureUsage", function (signatureDecl) {
1772
1791
  const data = owner.client.apiRequest("getSignatureUsages", {
1773
1792
  snapshot: owner.snapshotId,
1774
- project: owner.project.id,
1775
- signatureDecl: getNodeId(signatureDecl),
1793
+ project: owner.project.handle,
1794
+ signatureDecl: getNodeRequestHandle(signatureDecl),
1776
1795
  });
1777
1796
  return (data ?? []).map(entry => ({
1778
- name: new NodeHandle(entry.name, owner.project),
1779
- call: entry.call ? new NodeHandle(entry.call, owner.project) : undefined,
1797
+ name: owner.objectRegistry.createNodeHandle(entry.name),
1798
+ call: entry.call ? owner.objectRegistry.createNodeHandle(entry.call) : undefined,
1780
1799
  }));
1781
1800
  }, function* (signatureDecl) {
1782
1801
  const data = yield* apiRequest("getSignatureUsages", {
1783
1802
  snapshot: owner.snapshotId,
1784
- project: owner.project.id,
1785
- signatureDecl: getNodeId(signatureDecl),
1803
+ project: owner.project.handle,
1804
+ signatureDecl: getNodeRequestHandle(signatureDecl),
1786
1805
  });
1787
1806
  return (data ?? []).map(entry => ({
1788
- name: new NodeHandle(entry.name, owner.project),
1789
- call: entry.call ? new NodeHandle(entry.call, owner.project) : undefined,
1807
+ name: owner.objectRegistry.createNodeHandle(entry.name),
1808
+ call: entry.call ? owner.objectRegistry.createNodeHandle(entry.call) : undefined,
1790
1809
  }));
1791
1810
  });
1792
1811
  }
@@ -1795,7 +1814,7 @@ export class LanguageService {
1795
1814
  return cacheGeneratorMethod(owner, "getCompletionsAtPosition", function (document, position, options) {
1796
1815
  const data = owner.client.apiRequest("getCompletionsAtPosition", {
1797
1816
  snapshot: owner.snapshotId,
1798
- project: owner.project.id,
1817
+ project: owner.project.handle,
1799
1818
  file: document,
1800
1819
  position,
1801
1820
  triggerCharacter: options?.triggerCharacter,
@@ -1813,7 +1832,7 @@ export class LanguageService {
1813
1832
  }, function* (document, position, options) {
1814
1833
  const data = yield* apiRequest("getCompletionsAtPosition", {
1815
1834
  snapshot: owner.snapshotId,
1816
- project: owner.project.id,
1835
+ project: owner.project.handle,
1817
1836
  file: document,
1818
1837
  position,
1819
1838
  triggerCharacter: options?.triggerCharacter,
@@ -1846,7 +1865,7 @@ export class LanguageService {
1846
1865
  const base64 = uint8ArrayToBase64(encoded);
1847
1866
  return owner.client.apiRequest("formatNodeForInsertion", {
1848
1867
  snapshot: owner.snapshotId,
1849
- project: owner.project.id,
1868
+ project: owner.project.handle,
1850
1869
  file,
1851
1870
  position,
1852
1871
  data: base64,
@@ -1856,7 +1875,7 @@ export class LanguageService {
1856
1875
  const base64 = uint8ArrayToBase64(encoded);
1857
1876
  return yield* apiRequest("formatNodeForInsertion", {
1858
1877
  snapshot: owner.snapshotId,
1859
- project: owner.project.id,
1878
+ project: owner.project.handle,
1860
1879
  file,
1861
1880
  position,
1862
1881
  data: base64,
@@ -1965,7 +1984,7 @@ export class Program {
1965
1984
  // Fetch from server
1966
1985
  const binaryData = owner.client.apiRequestBinary("getSourceFile", {
1967
1986
  snapshot: owner.snapshotId,
1968
- project: owner.project.id,
1987
+ project: owner.project.handle,
1969
1988
  file,
1970
1989
  });
1971
1990
  if (!binaryData) {
@@ -1983,7 +2002,7 @@ export class Program {
1983
2002
  // Fetch from server
1984
2003
  const binaryData = sourceFileResponseToUint8Array(yield* apiRequest("getSourceFile", {
1985
2004
  snapshot: owner.snapshotId,
1986
- project: owner.project.id,
2005
+ project: owner.project.handle,
1987
2006
  file,
1988
2007
  }));
1989
2008
  if (!binaryData) {
@@ -1999,7 +2018,7 @@ export class Program {
1999
2018
  return cacheGeneratorMethod(owner, "getResolvedModule", function (file, moduleName, mode) {
2000
2019
  const result = owner.client.apiRequest("getResolvedModule", {
2001
2020
  snapshot: owner.snapshotId,
2002
- project: owner.project.id,
2021
+ project: owner.project.handle,
2003
2022
  file,
2004
2023
  moduleName,
2005
2024
  mode,
@@ -2008,7 +2027,7 @@ export class Program {
2008
2027
  }, function* (file, moduleName, mode) {
2009
2028
  const result = yield* apiRequest("getResolvedModule", {
2010
2029
  snapshot: owner.snapshotId,
2011
- project: owner.project.id,
2030
+ project: owner.project.handle,
2012
2031
  file,
2013
2032
  moduleName,
2014
2033
  mode,
@@ -2021,16 +2040,16 @@ export class Program {
2021
2040
  return cacheGeneratorMethod(owner, "getModeForUsageLocation", function (file, usage) {
2022
2041
  return owner.client.apiRequest("getModeForUsageLocation", {
2023
2042
  snapshot: owner.snapshotId,
2024
- project: owner.project.id,
2043
+ project: owner.project.handle,
2025
2044
  file,
2026
- usage: getNodeId(usage),
2045
+ usage: getNodeRequestHandle(usage),
2027
2046
  });
2028
2047
  }, function* (file, usage) {
2029
2048
  return yield* apiRequest("getModeForUsageLocation", {
2030
2049
  snapshot: owner.snapshotId,
2031
- project: owner.project.id,
2050
+ project: owner.project.handle,
2032
2051
  file,
2033
- usage: getNodeId(usage),
2052
+ usage: getNodeRequestHandle(usage),
2034
2053
  });
2035
2054
  });
2036
2055
  }
@@ -2039,14 +2058,14 @@ export class Program {
2039
2058
  return cacheGeneratorMethod(owner, "getModeForResolutionAtIndex", function (file, index) {
2040
2059
  return owner.client.apiRequest("getModeForResolutionAtIndex", {
2041
2060
  snapshot: owner.snapshotId,
2042
- project: owner.project.id,
2061
+ project: owner.project.handle,
2043
2062
  file,
2044
2063
  index,
2045
2064
  });
2046
2065
  }, function* (file, index) {
2047
2066
  return yield* apiRequest("getModeForResolutionAtIndex", {
2048
2067
  snapshot: owner.snapshotId,
2049
- project: owner.project.id,
2068
+ project: owner.project.handle,
2050
2069
  file,
2051
2070
  index,
2052
2071
  });
@@ -2057,16 +2076,16 @@ export class Program {
2057
2076
  return cacheGeneratorMethod(owner, "getResolvedModuleFromModuleSpecifier", function (moduleSpecifier, sourceFile) {
2058
2077
  const result = owner.client.apiRequest("getResolvedModuleFromModuleSpecifier", {
2059
2078
  snapshot: owner.snapshotId,
2060
- project: owner.project.id,
2061
- moduleSpecifier: getNodeId(moduleSpecifier),
2079
+ project: owner.project.handle,
2080
+ moduleSpecifier: getNodeRequestHandle(moduleSpecifier),
2062
2081
  sourceFile,
2063
2082
  });
2064
2083
  return result ?? undefined;
2065
2084
  }, function* (moduleSpecifier, sourceFile) {
2066
2085
  const result = yield* apiRequest("getResolvedModuleFromModuleSpecifier", {
2067
2086
  snapshot: owner.snapshotId,
2068
- project: owner.project.id,
2069
- moduleSpecifier: getNodeId(moduleSpecifier),
2087
+ project: owner.project.handle,
2088
+ moduleSpecifier: getNodeRequestHandle(moduleSpecifier),
2070
2089
  sourceFile,
2071
2090
  });
2072
2091
  return result ?? undefined;
@@ -2077,7 +2096,7 @@ export class Program {
2077
2096
  return cacheGeneratorMethod(owner, "getResolvedTypeReferenceDirective", function (file, typeDirectiveName, mode) {
2078
2097
  const result = owner.client.apiRequest("getResolvedTypeReferenceDirective", {
2079
2098
  snapshot: owner.snapshotId,
2080
- project: owner.project.id,
2099
+ project: owner.project.handle,
2081
2100
  file,
2082
2101
  typeDirectiveName,
2083
2102
  mode,
@@ -2086,7 +2105,7 @@ export class Program {
2086
2105
  }, function* (file, typeDirectiveName, mode) {
2087
2106
  const result = yield* apiRequest("getResolvedTypeReferenceDirective", {
2088
2107
  snapshot: owner.snapshotId,
2089
- project: owner.project.id,
2108
+ project: owner.project.handle,
2090
2109
  file,
2091
2110
  typeDirectiveName,
2092
2111
  mode,
@@ -2099,7 +2118,7 @@ export class Program {
2099
2118
  return cacheGeneratorMethod(owner, "getResolvedTypeReferenceDirectiveFromTypeReferenceDirective", function (typeReferenceDirective, sourceFile) {
2100
2119
  const result = owner.client.apiRequest("getResolvedTypeReferenceDirectiveFromTypeReferenceDirective", {
2101
2120
  snapshot: owner.snapshotId,
2102
- project: owner.project.id,
2121
+ project: owner.project.handle,
2103
2122
  sourceFile,
2104
2123
  typeDirectiveName: typeReferenceDirective.fileName,
2105
2124
  resolutionMode: typeReferenceDirective.resolutionMode,
@@ -2108,7 +2127,7 @@ export class Program {
2108
2127
  }, function* (typeReferenceDirective, sourceFile) {
2109
2128
  const result = yield* apiRequest("getResolvedTypeReferenceDirectiveFromTypeReferenceDirective", {
2110
2129
  snapshot: owner.snapshotId,
2111
- project: owner.project.id,
2130
+ project: owner.project.handle,
2112
2131
  sourceFile,
2113
2132
  typeDirectiveName: typeReferenceDirective.fileName,
2114
2133
  resolutionMode: typeReferenceDirective.resolutionMode,
@@ -2121,13 +2140,13 @@ export class Program {
2121
2140
  return cacheGeneratorMethod(owner, "getSourceFileNames", function () {
2122
2141
  const data = owner.client.apiRequest("getSourceFileNames", {
2123
2142
  snapshot: owner.snapshotId,
2124
- project: owner.project.id,
2143
+ project: owner.project.handle,
2125
2144
  });
2126
2145
  return data ?? [];
2127
2146
  }, function* () {
2128
2147
  const data = yield* apiRequest("getSourceFileNames", {
2129
2148
  snapshot: owner.snapshotId,
2130
- project: owner.project.id,
2149
+ project: owner.project.handle,
2131
2150
  });
2132
2151
  return data ?? [];
2133
2152
  });
@@ -2176,7 +2195,7 @@ export class Program {
2176
2195
  // client-provided path text as untrusted input.
2177
2196
  const data = owner.client.apiRequest("getSourceFileMetadata", {
2178
2197
  snapshot: owner.snapshotId,
2179
- project: owner.project.id,
2198
+ project: owner.project.handle,
2180
2199
  file: path,
2181
2200
  });
2182
2201
  return data ?? undefined;
@@ -2185,7 +2204,7 @@ export class Program {
2185
2204
  // client-provided path text as untrusted input.
2186
2205
  const data = yield* apiRequest("getSourceFileMetadata", {
2187
2206
  snapshot: owner.snapshotId,
2188
- project: owner.project.id,
2207
+ project: owner.project.handle,
2189
2208
  file: path,
2190
2209
  });
2191
2210
  return data ?? undefined;
@@ -2233,13 +2252,13 @@ export class Program {
2233
2252
  return cacheGeneratorMethod(owner, "getConfigFileNames", function () {
2234
2253
  const data = owner.client.apiRequest("getConfigFileNames", {
2235
2254
  snapshot: owner.snapshotId,
2236
- project: owner.project.id,
2255
+ project: owner.project.handle,
2237
2256
  });
2238
2257
  return data ?? [];
2239
2258
  }, function* () {
2240
2259
  const data = yield* apiRequest("getConfigFileNames", {
2241
2260
  snapshot: owner.snapshotId,
2242
- project: owner.project.id,
2261
+ project: owner.project.handle,
2243
2262
  });
2244
2263
  return data ?? [];
2245
2264
  });
@@ -2253,7 +2272,7 @@ export class Program {
2253
2272
  return cacheGeneratorMethod(owner, "getConfigSourceFile", function (file) {
2254
2273
  const binaryData = owner.client.apiRequestBinary("getConfigSourceFile", {
2255
2274
  snapshot: owner.snapshotId,
2256
- project: owner.project.id,
2275
+ project: owner.project.handle,
2257
2276
  file,
2258
2277
  });
2259
2278
  if (!binaryData) {
@@ -2263,7 +2282,7 @@ export class Program {
2263
2282
  }, function* (file) {
2264
2283
  const binaryData = sourceFileResponseToUint8Array(yield* apiRequest("getConfigSourceFile", {
2265
2284
  snapshot: owner.snapshotId,
2266
- project: owner.project.id,
2285
+ project: owner.project.handle,
2267
2286
  file,
2268
2287
  }));
2269
2288
  if (!binaryData) {
@@ -2284,7 +2303,7 @@ export class Program {
2284
2303
  : [file];
2285
2304
  const data = owner.client.apiRequest("getSyntacticDiagnostics", {
2286
2305
  snapshot: owner.snapshotId,
2287
- project: owner.project.id,
2306
+ project: owner.project.handle,
2288
2307
  files,
2289
2308
  });
2290
2309
  return data ?? [];
@@ -2294,7 +2313,7 @@ export class Program {
2294
2313
  : [file];
2295
2314
  const data = yield* apiRequest("getSyntacticDiagnostics", {
2296
2315
  snapshot: owner.snapshotId,
2297
- project: owner.project.id,
2316
+ project: owner.project.handle,
2298
2317
  files,
2299
2318
  });
2300
2319
  return data ?? [];
@@ -2312,7 +2331,7 @@ export class Program {
2312
2331
  : [file];
2313
2332
  const data = owner.client.apiRequest("getBindDiagnostics", {
2314
2333
  snapshot: owner.snapshotId,
2315
- project: owner.project.id,
2334
+ project: owner.project.handle,
2316
2335
  files,
2317
2336
  });
2318
2337
  return data ?? [];
@@ -2322,7 +2341,7 @@ export class Program {
2322
2341
  : [file];
2323
2342
  const data = yield* apiRequest("getBindDiagnostics", {
2324
2343
  snapshot: owner.snapshotId,
2325
- project: owner.project.id,
2344
+ project: owner.project.handle,
2326
2345
  files,
2327
2346
  });
2328
2347
  return data ?? [];
@@ -2340,7 +2359,7 @@ export class Program {
2340
2359
  : [file];
2341
2360
  const data = owner.client.apiRequest("getSemanticDiagnostics", {
2342
2361
  snapshot: owner.snapshotId,
2343
- project: owner.project.id,
2362
+ project: owner.project.handle,
2344
2363
  files,
2345
2364
  });
2346
2365
  return data ?? [];
@@ -2350,7 +2369,7 @@ export class Program {
2350
2369
  : [file];
2351
2370
  const data = yield* apiRequest("getSemanticDiagnostics", {
2352
2371
  snapshot: owner.snapshotId,
2353
- project: owner.project.id,
2372
+ project: owner.project.handle,
2354
2373
  files,
2355
2374
  });
2356
2375
  return data ?? [];
@@ -2368,7 +2387,7 @@ export class Program {
2368
2387
  : [file];
2369
2388
  const data = owner.client.apiRequest("getSuggestionDiagnostics", {
2370
2389
  snapshot: owner.snapshotId,
2371
- project: owner.project.id,
2390
+ project: owner.project.handle,
2372
2391
  files,
2373
2392
  });
2374
2393
  return data ?? [];
@@ -2378,7 +2397,7 @@ export class Program {
2378
2397
  : [file];
2379
2398
  const data = yield* apiRequest("getSuggestionDiagnostics", {
2380
2399
  snapshot: owner.snapshotId,
2381
- project: owner.project.id,
2400
+ project: owner.project.handle,
2382
2401
  files,
2383
2402
  });
2384
2403
  return data ?? [];
@@ -2396,7 +2415,7 @@ export class Program {
2396
2415
  : [file];
2397
2416
  const data = owner.client.apiRequest("getDeclarationDiagnostics", {
2398
2417
  snapshot: owner.snapshotId,
2399
- project: owner.project.id,
2418
+ project: owner.project.handle,
2400
2419
  files,
2401
2420
  });
2402
2421
  return data ?? [];
@@ -2406,7 +2425,7 @@ export class Program {
2406
2425
  : [file];
2407
2426
  const data = yield* apiRequest("getDeclarationDiagnostics", {
2408
2427
  snapshot: owner.snapshotId,
2409
- project: owner.project.id,
2428
+ project: owner.project.handle,
2410
2429
  files,
2411
2430
  });
2412
2431
  return data ?? [];
@@ -2420,13 +2439,13 @@ export class Program {
2420
2439
  return cacheGeneratorMethod(owner, "getProgramDiagnostics", function () {
2421
2440
  const data = owner.client.apiRequest("getProgramDiagnostics", {
2422
2441
  snapshot: owner.snapshotId,
2423
- project: owner.project.id,
2442
+ project: owner.project.handle,
2424
2443
  });
2425
2444
  return data ?? [];
2426
2445
  }, function* () {
2427
2446
  const data = yield* apiRequest("getProgramDiagnostics", {
2428
2447
  snapshot: owner.snapshotId,
2429
- project: owner.project.id,
2448
+ project: owner.project.handle,
2430
2449
  });
2431
2450
  return data ?? [];
2432
2451
  });
@@ -2439,13 +2458,13 @@ export class Program {
2439
2458
  return cacheGeneratorMethod(owner, "getGlobalDiagnostics", function () {
2440
2459
  const data = owner.client.apiRequest("getGlobalDiagnostics", {
2441
2460
  snapshot: owner.snapshotId,
2442
- project: owner.project.id,
2461
+ project: owner.project.handle,
2443
2462
  });
2444
2463
  return data ?? [];
2445
2464
  }, function* () {
2446
2465
  const data = yield* apiRequest("getGlobalDiagnostics", {
2447
2466
  snapshot: owner.snapshotId,
2448
- project: owner.project.id,
2467
+ project: owner.project.handle,
2449
2468
  });
2450
2469
  return data ?? [];
2451
2470
  });
@@ -2458,13 +2477,13 @@ export class Program {
2458
2477
  return cacheGeneratorMethod(owner, "getConfigFileParsingDiagnostics", function () {
2459
2478
  const data = owner.client.apiRequest("getConfigFileParsingDiagnostics", {
2460
2479
  snapshot: owner.snapshotId,
2461
- project: owner.project.id,
2480
+ project: owner.project.handle,
2462
2481
  });
2463
2482
  return data ?? [];
2464
2483
  }, function* () {
2465
2484
  const data = yield* apiRequest("getConfigFileParsingDiagnostics", {
2466
2485
  snapshot: owner.snapshotId,
2467
- project: owner.project.id,
2486
+ project: owner.project.handle,
2468
2487
  });
2469
2488
  return data ?? [];
2470
2489
  });
@@ -2479,7 +2498,7 @@ export class Program {
2479
2498
  return cacheGeneratorMethod(owner, "emit", function (emitOnly) {
2480
2499
  const response = owner.client.apiRequest("emit", {
2481
2500
  snapshot: owner.snapshotId,
2482
- project: owner.project.id,
2501
+ project: owner.project.handle,
2483
2502
  emitOnly,
2484
2503
  });
2485
2504
  const fileSystem = response.emittedFilesContents.length
@@ -2497,7 +2516,7 @@ export class Program {
2497
2516
  }, function* (emitOnly) {
2498
2517
  const response = yield* apiRequest("emit", {
2499
2518
  snapshot: owner.snapshotId,
2500
- project: owner.project.id,
2519
+ project: owner.project.handle,
2501
2520
  emitOnly,
2502
2521
  });
2503
2522
  const fileSystem = response.emittedFilesContents.length
@@ -2522,14 +2541,14 @@ export class Program {
2522
2541
  return cacheGeneratorMethod(owner, "emitToString", function (emitOnly) {
2523
2542
  const response = owner.client.apiRequest("emitToString", {
2524
2543
  snapshot: owner.snapshotId,
2525
- project: owner.project.id,
2544
+ project: owner.project.handle,
2526
2545
  emitOnly,
2527
2546
  });
2528
2547
  return toEmitOutput(response);
2529
2548
  }, function* (emitOnly) {
2530
2549
  const response = yield* apiRequest("emitToString", {
2531
2550
  snapshot: owner.snapshotId,
2532
- project: owner.project.id,
2551
+ project: owner.project.handle,
2533
2552
  emitOnly,
2534
2553
  });
2535
2554
  return toEmitOutput(response);
@@ -2543,14 +2562,14 @@ export class Program {
2543
2562
  return cacheGeneratorMethod(owner, "getJavaScriptEmit", function (files) {
2544
2563
  const response = owner.client.apiRequest("getJavaScriptEmit", {
2545
2564
  snapshot: owner.snapshotId,
2546
- project: owner.project.id,
2565
+ project: owner.project.handle,
2547
2566
  files,
2548
2567
  });
2549
2568
  return toEmitOutput(response);
2550
2569
  }, function* (files) {
2551
2570
  const response = yield* apiRequest("getJavaScriptEmit", {
2552
2571
  snapshot: owner.snapshotId,
2553
- project: owner.project.id,
2572
+ project: owner.project.handle,
2554
2573
  files,
2555
2574
  });
2556
2575
  return toEmitOutput(response);
@@ -2564,14 +2583,14 @@ export class Program {
2564
2583
  return cacheGeneratorMethod(owner, "getDeclarationEmit", function (files) {
2565
2584
  const response = owner.client.apiRequest("getDeclarationEmit", {
2566
2585
  snapshot: owner.snapshotId,
2567
- project: owner.project.id,
2586
+ project: owner.project.handle,
2568
2587
  files,
2569
2588
  });
2570
2589
  return toEmitOutput(response);
2571
2590
  }, function* (files) {
2572
2591
  const response = yield* apiRequest("getDeclarationEmit", {
2573
2592
  snapshot: owner.snapshotId,
2574
- project: owner.project.id,
2593
+ project: owner.project.handle,
2575
2594
  files,
2576
2595
  });
2577
2596
  return toEmitOutput(response);
@@ -2746,14 +2765,14 @@ export class Checker {
2746
2765
  return cacheGeneratorMethod(owner, "getMergedSymbol", function (symbol) {
2747
2766
  const data = owner.client.apiRequest("getMergedSymbol", {
2748
2767
  snapshot: owner.snapshotId,
2749
- project: owner.project.id,
2768
+ project: owner.project.handle,
2750
2769
  symbol: symbol.reference,
2751
2770
  });
2752
2771
  return owner.objectRegistry.getOrCreateSymbol(data);
2753
2772
  }, function* (symbol) {
2754
2773
  const data = yield* apiRequest("getMergedSymbol", {
2755
2774
  snapshot: owner.snapshotId,
2756
- project: owner.project.id,
2775
+ project: owner.project.handle,
2757
2776
  symbol: symbol.reference,
2758
2777
  });
2759
2778
  return owner.objectRegistry.getOrCreateSymbol(data);
@@ -2768,15 +2787,15 @@ export class Checker {
2768
2787
  return cacheGeneratorMethod(owner, "getSymbolOfNode", function (node) {
2769
2788
  const data = owner.client.apiRequest("getSymbolOfNode", {
2770
2789
  snapshot: owner.snapshotId,
2771
- project: owner.project.id,
2772
- location: getNodeId(node),
2790
+ project: owner.project.handle,
2791
+ location: getNodeRequestHandle(node),
2773
2792
  });
2774
2793
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
2775
2794
  }, function* (node) {
2776
2795
  const data = yield* apiRequest("getSymbolOfNode", {
2777
2796
  snapshot: owner.snapshotId,
2778
- project: owner.project.id,
2779
- location: getNodeId(node),
2797
+ project: owner.project.handle,
2798
+ location: getNodeRequestHandle(node),
2780
2799
  });
2781
2800
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
2782
2801
  });
@@ -2787,16 +2806,16 @@ export class Checker {
2787
2806
  return cacheGeneratorMethod(owner, "getSymbolOfDeclaration", function (node) {
2788
2807
  const data = owner.client.apiRequest("getSymbolOfDeclarationForChecker", {
2789
2808
  snapshot: owner.snapshotId,
2790
- project: owner.project.id,
2791
- location: getNodeId(node),
2809
+ project: owner.project.handle,
2810
+ location: getNodeRequestHandle(node),
2792
2811
  });
2793
2812
  // Declarations normally have symbols, but preserve unexpected null results at runtime.
2794
2813
  return (data && owner.objectRegistry.getOrCreateSymbol(data));
2795
2814
  }, function* (node) {
2796
2815
  const data = yield* apiRequest("getSymbolOfDeclarationForChecker", {
2797
2816
  snapshot: owner.snapshotId,
2798
- project: owner.project.id,
2799
- location: getNodeId(node),
2817
+ project: owner.project.handle,
2818
+ location: getNodeRequestHandle(node),
2800
2819
  });
2801
2820
  // Declarations normally have symbols, but preserve unexpected null results at runtime.
2802
2821
  return (data && owner.objectRegistry.getOrCreateSymbol(data));
@@ -2808,14 +2827,14 @@ export class Checker {
2808
2827
  return cacheGeneratorMethod(owner, "getParentOfSymbol", function (symbol) {
2809
2828
  const data = owner.client.apiRequest("getParentOfSymbolForChecker", {
2810
2829
  snapshot: owner.snapshotId,
2811
- project: owner.project.id,
2830
+ project: owner.project.handle,
2812
2831
  symbol: symbol.reference,
2813
2832
  });
2814
2833
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
2815
2834
  }, function* (symbol) {
2816
2835
  const data = yield* apiRequest("getParentOfSymbolForChecker", {
2817
2836
  snapshot: owner.snapshotId,
2818
- project: owner.project.id,
2837
+ project: owner.project.handle,
2819
2838
  symbol: symbol.reference,
2820
2839
  });
2821
2840
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
@@ -2827,15 +2846,15 @@ export class Checker {
2827
2846
  if (Array.isArray(nodeOrNodes)) {
2828
2847
  const data = owner.client.apiRequest("getSymbolsAtLocations", {
2829
2848
  snapshot: owner.snapshotId,
2830
- project: owner.project.id,
2831
- locations: nodeOrNodes.map(node => getNodeId(node)),
2849
+ project: owner.project.handle,
2850
+ locations: nodeOrNodes.map(node => getNodeRequestHandle(node)),
2832
2851
  });
2833
2852
  return data.map(d => d ? owner.objectRegistry.getOrCreateSymbol(d) : undefined);
2834
2853
  }
2835
2854
  const data = owner.client.apiRequest("getSymbolAtLocation", {
2836
2855
  snapshot: owner.snapshotId,
2837
- project: owner.project.id,
2838
- location: getNodeId(nodeOrNodes),
2856
+ project: owner.project.handle,
2857
+ location: getNodeRequestHandle(nodeOrNodes),
2839
2858
  });
2840
2859
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
2841
2860
  }
@@ -2843,15 +2862,15 @@ export class Checker {
2843
2862
  if (Array.isArray(nodeOrNodes)) {
2844
2863
  const data = yield* apiRequest("getSymbolsAtLocations", {
2845
2864
  snapshot: owner.snapshotId,
2846
- project: owner.project.id,
2847
- locations: nodeOrNodes.map(node => getNodeId(node)),
2865
+ project: owner.project.handle,
2866
+ locations: nodeOrNodes.map(node => getNodeRequestHandle(node)),
2848
2867
  });
2849
2868
  return data.map(d => d ? owner.objectRegistry.getOrCreateSymbol(d) : undefined);
2850
2869
  }
2851
2870
  const data = yield* apiRequest("getSymbolAtLocation", {
2852
2871
  snapshot: owner.snapshotId,
2853
- project: owner.project.id,
2854
- location: getNodeId(nodeOrNodes),
2872
+ project: owner.project.handle,
2873
+ location: getNodeRequestHandle(nodeOrNodes),
2855
2874
  });
2856
2875
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
2857
2876
  }
@@ -2863,7 +2882,7 @@ export class Checker {
2863
2882
  if (typeof positionOrPositions === "number") {
2864
2883
  const data = owner.client.apiRequest("getSymbolAtPosition", {
2865
2884
  snapshot: owner.snapshotId,
2866
- project: owner.project.id,
2885
+ project: owner.project.handle,
2867
2886
  file,
2868
2887
  position: positionOrPositions,
2869
2888
  });
@@ -2871,7 +2890,7 @@ export class Checker {
2871
2890
  }
2872
2891
  const data = owner.client.apiRequest("getSymbolsAtPositions", {
2873
2892
  snapshot: owner.snapshotId,
2874
- project: owner.project.id,
2893
+ project: owner.project.handle,
2875
2894
  file,
2876
2895
  positions: positionOrPositions,
2877
2896
  });
@@ -2881,7 +2900,7 @@ export class Checker {
2881
2900
  if (typeof positionOrPositions === "number") {
2882
2901
  const data = yield* apiRequest("getSymbolAtPosition", {
2883
2902
  snapshot: owner.snapshotId,
2884
- project: owner.project.id,
2903
+ project: owner.project.handle,
2885
2904
  file,
2886
2905
  position: positionOrPositions,
2887
2906
  });
@@ -2889,7 +2908,7 @@ export class Checker {
2889
2908
  }
2890
2909
  const data = yield* apiRequest("getSymbolsAtPositions", {
2891
2910
  snapshot: owner.snapshotId,
2892
- project: owner.project.id,
2911
+ project: owner.project.handle,
2893
2912
  file,
2894
2913
  positions: positionOrPositions,
2895
2914
  });
@@ -2903,14 +2922,14 @@ export class Checker {
2903
2922
  if (Array.isArray(fileOrFiles)) {
2904
2923
  const data = owner.client.apiRequest("getSymbolsOfSourceFiles", {
2905
2924
  snapshot: owner.snapshotId,
2906
- project: owner.project.id,
2925
+ project: owner.project.handle,
2907
2926
  files: fileOrFiles,
2908
2927
  });
2909
2928
  return data.map(d => d ? owner.objectRegistry.getOrCreateSymbol(d) : undefined);
2910
2929
  }
2911
2930
  const data = owner.client.apiRequest("getSymbolOfSourceFile", {
2912
2931
  snapshot: owner.snapshotId,
2913
- project: owner.project.id,
2932
+ project: owner.project.handle,
2914
2933
  file: fileOrFiles,
2915
2934
  });
2916
2935
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
@@ -2919,14 +2938,14 @@ export class Checker {
2919
2938
  if (Array.isArray(fileOrFiles)) {
2920
2939
  const data = yield* apiRequest("getSymbolsOfSourceFiles", {
2921
2940
  snapshot: owner.snapshotId,
2922
- project: owner.project.id,
2941
+ project: owner.project.handle,
2923
2942
  files: fileOrFiles,
2924
2943
  });
2925
2944
  return data.map(d => d ? owner.objectRegistry.getOrCreateSymbol(d) : undefined);
2926
2945
  }
2927
2946
  const data = yield* apiRequest("getSymbolOfSourceFile", {
2928
2947
  snapshot: owner.snapshotId,
2929
- project: owner.project.id,
2948
+ project: owner.project.handle,
2930
2949
  file: fileOrFiles,
2931
2950
  });
2932
2951
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
@@ -2944,14 +2963,14 @@ export class Checker {
2944
2963
  if (Array.isArray(symbolOrSymbols)) {
2945
2964
  const data = owner.client.apiRequest("getTypesOfSymbols", {
2946
2965
  snapshot: owner.snapshotId,
2947
- project: owner.project.id,
2966
+ project: owner.project.handle,
2948
2967
  symbols: symbolOrSymbols.map(symbol => symbol.reference),
2949
2968
  });
2950
2969
  return data.map(d => owner.objectRegistry.getOrCreateType(d));
2951
2970
  }
2952
2971
  const data = owner.client.apiRequest("getTypeOfSymbol", {
2953
2972
  snapshot: owner.snapshotId,
2954
- project: owner.project.id,
2973
+ project: owner.project.handle,
2955
2974
  symbol: symbolOrSymbols.reference,
2956
2975
  });
2957
2976
  return owner.objectRegistry.getOrCreateType(data);
@@ -2960,14 +2979,14 @@ export class Checker {
2960
2979
  if (Array.isArray(symbolOrSymbols)) {
2961
2980
  const data = yield* apiRequest("getTypesOfSymbols", {
2962
2981
  snapshot: owner.snapshotId,
2963
- project: owner.project.id,
2982
+ project: owner.project.handle,
2964
2983
  symbols: symbolOrSymbols.map(symbol => symbol.reference),
2965
2984
  });
2966
2985
  return data.map(d => owner.objectRegistry.getOrCreateType(d));
2967
2986
  }
2968
2987
  const data = yield* apiRequest("getTypeOfSymbol", {
2969
2988
  snapshot: owner.snapshotId,
2970
- project: owner.project.id,
2989
+ project: owner.project.handle,
2971
2990
  symbol: symbolOrSymbols.reference,
2972
2991
  });
2973
2992
  return owner.objectRegistry.getOrCreateType(data);
@@ -2984,14 +3003,14 @@ export class Checker {
2984
3003
  return cacheGeneratorMethod(owner, "getDeclaredTypeOfSymbol", function (symbol) {
2985
3004
  const data = owner.client.apiRequest("getDeclaredTypeOfSymbol", {
2986
3005
  snapshot: owner.snapshotId,
2987
- project: owner.project.id,
3006
+ project: owner.project.handle,
2988
3007
  symbol: symbol.reference,
2989
3008
  });
2990
3009
  return owner.objectRegistry.getOrCreateType(data);
2991
3010
  }, function* (symbol) {
2992
3011
  const data = yield* apiRequest("getDeclaredTypeOfSymbol", {
2993
3012
  snapshot: owner.snapshotId,
2994
- project: owner.project.id,
3013
+ project: owner.project.handle,
2995
3014
  symbol: symbol.reference,
2996
3015
  });
2997
3016
  return owner.objectRegistry.getOrCreateType(data);
@@ -3008,14 +3027,14 @@ export class Checker {
3008
3027
  return cacheGeneratorMethod(owner, "getNonMissingTypeOfSymbol", function (symbol) {
3009
3028
  const data = owner.client.apiRequest("getNonMissingTypeOfSymbol", {
3010
3029
  snapshot: owner.snapshotId,
3011
- project: owner.project.id,
3030
+ project: owner.project.handle,
3012
3031
  symbol: symbol.reference,
3013
3032
  });
3014
3033
  return owner.objectRegistry.getOrCreateType(data);
3015
3034
  }, function* (symbol) {
3016
3035
  const data = yield* apiRequest("getNonMissingTypeOfSymbol", {
3017
3036
  snapshot: owner.snapshotId,
3018
- project: owner.project.id,
3037
+ project: owner.project.handle,
3019
3038
  symbol: symbol.reference,
3020
3039
  });
3021
3040
  return owner.objectRegistry.getOrCreateType(data);
@@ -3026,19 +3045,19 @@ export class Checker {
3026
3045
  return cacheGeneratorMethod(owner, "getReferencesToSymbolInFile", function (file, symbol) {
3027
3046
  const data = owner.client.apiRequest("getReferencesToSymbolInFile", {
3028
3047
  snapshot: owner.snapshotId,
3029
- project: owner.project.id,
3048
+ project: owner.project.handle,
3030
3049
  file,
3031
3050
  symbol: symbol.reference,
3032
3051
  });
3033
- return (data ?? []).map(h => new NodeHandle(h, owner.project));
3052
+ return (data ?? []).map(h => owner.objectRegistry.createNodeHandle(h));
3034
3053
  }, function* (file, symbol) {
3035
3054
  const data = yield* apiRequest("getReferencesToSymbolInFile", {
3036
3055
  snapshot: owner.snapshotId,
3037
- project: owner.project.id,
3056
+ project: owner.project.handle,
3038
3057
  file,
3039
3058
  symbol: symbol.reference,
3040
3059
  });
3041
- return (data ?? []).map(h => new NodeHandle(h, owner.project));
3060
+ return (data ?? []).map(h => owner.objectRegistry.createNodeHandle(h));
3042
3061
  });
3043
3062
  }
3044
3063
  /**
@@ -3052,15 +3071,15 @@ export class Checker {
3052
3071
  if (Array.isArray(nodeOrNodes)) {
3053
3072
  const data = owner.client.apiRequest("getTypeAtLocations", {
3054
3073
  snapshot: owner.snapshotId,
3055
- project: owner.project.id,
3056
- locations: nodeOrNodes.map(node => getNodeId(node)),
3074
+ project: owner.project.handle,
3075
+ locations: nodeOrNodes.map(node => getNodeRequestHandle(node)),
3057
3076
  });
3058
3077
  return data.map(d => owner.objectRegistry.getOrCreateType(d));
3059
3078
  }
3060
3079
  const data = owner.client.apiRequest("getTypeAtLocation", {
3061
3080
  snapshot: owner.snapshotId,
3062
- project: owner.project.id,
3063
- location: getNodeId(nodeOrNodes),
3081
+ project: owner.project.handle,
3082
+ location: getNodeRequestHandle(nodeOrNodes),
3064
3083
  });
3065
3084
  return owner.objectRegistry.getOrCreateType(data);
3066
3085
  }
@@ -3068,15 +3087,15 @@ export class Checker {
3068
3087
  if (Array.isArray(nodeOrNodes)) {
3069
3088
  const data = yield* apiRequest("getTypeAtLocations", {
3070
3089
  snapshot: owner.snapshotId,
3071
- project: owner.project.id,
3072
- locations: nodeOrNodes.map(node => getNodeId(node)),
3090
+ project: owner.project.handle,
3091
+ locations: nodeOrNodes.map(node => getNodeRequestHandle(node)),
3073
3092
  });
3074
3093
  return data.map(d => owner.objectRegistry.getOrCreateType(d));
3075
3094
  }
3076
3095
  const data = yield* apiRequest("getTypeAtLocation", {
3077
3096
  snapshot: owner.snapshotId,
3078
- project: owner.project.id,
3079
- location: getNodeId(nodeOrNodes),
3097
+ project: owner.project.handle,
3098
+ location: getNodeRequestHandle(nodeOrNodes),
3080
3099
  });
3081
3100
  return owner.objectRegistry.getOrCreateType(data);
3082
3101
  }
@@ -3100,15 +3119,15 @@ export class Checker {
3100
3119
  return cacheGeneratorMethod(owner, "getResolvedSignature", function (node) {
3101
3120
  const data = owner.client.apiRequest("getResolvedSignature", {
3102
3121
  snapshot: owner.snapshotId,
3103
- project: owner.project.id,
3104
- location: getNodeId(node),
3122
+ project: owner.project.handle,
3123
+ location: getNodeRequestHandle(node),
3105
3124
  });
3106
3125
  return owner.objectRegistry.getOrCreateSignature(data);
3107
3126
  }, function* (node) {
3108
3127
  const data = yield* apiRequest("getResolvedSignature", {
3109
3128
  snapshot: owner.snapshotId,
3110
- project: owner.project.id,
3111
- location: getNodeId(node),
3129
+ project: owner.project.handle,
3130
+ location: getNodeRequestHandle(node),
3112
3131
  });
3113
3132
  return owner.objectRegistry.getOrCreateSignature(data);
3114
3133
  });
@@ -3119,7 +3138,7 @@ export class Checker {
3119
3138
  if (typeof positionOrPositions === "number") {
3120
3139
  const data = owner.client.apiRequest("getTypeAtPosition", {
3121
3140
  snapshot: owner.snapshotId,
3122
- project: owner.project.id,
3141
+ project: owner.project.handle,
3123
3142
  file,
3124
3143
  position: positionOrPositions,
3125
3144
  });
@@ -3127,7 +3146,7 @@ export class Checker {
3127
3146
  }
3128
3147
  const data = owner.client.apiRequest("getTypesAtPositions", {
3129
3148
  snapshot: owner.snapshotId,
3130
- project: owner.project.id,
3149
+ project: owner.project.handle,
3131
3150
  file,
3132
3151
  positions: positionOrPositions,
3133
3152
  });
@@ -3137,7 +3156,7 @@ export class Checker {
3137
3156
  if (typeof positionOrPositions === "number") {
3138
3157
  const data = yield* apiRequest("getTypeAtPosition", {
3139
3158
  snapshot: owner.snapshotId,
3140
- project: owner.project.id,
3159
+ project: owner.project.handle,
3141
3160
  file,
3142
3161
  position: positionOrPositions,
3143
3162
  });
@@ -3145,7 +3164,7 @@ export class Checker {
3145
3164
  }
3146
3165
  const data = yield* apiRequest("getTypesAtPositions", {
3147
3166
  snapshot: owner.snapshotId,
3148
- project: owner.project.id,
3167
+ project: owner.project.handle,
3149
3168
  file,
3150
3169
  positions: positionOrPositions,
3151
3170
  });
@@ -3160,10 +3179,10 @@ export class Checker {
3160
3179
  const isNode = location && "kind" in location;
3161
3180
  const data = owner.client.apiRequest("resolveName", {
3162
3181
  snapshot: owner.snapshotId,
3163
- project: owner.project.id,
3182
+ project: owner.project.handle,
3164
3183
  name,
3165
3184
  meaning,
3166
- location: isNode ? getNodeId(location) : undefined,
3185
+ location: isNode ? getNodeRequestHandle(location) : undefined,
3167
3186
  file: !isNode && location ? location.document : undefined,
3168
3187
  position: !isNode && location ? location.position : undefined,
3169
3188
  excludeGlobals,
@@ -3174,10 +3193,10 @@ export class Checker {
3174
3193
  const isNode = location && "kind" in location;
3175
3194
  const data = yield* apiRequest("resolveName", {
3176
3195
  snapshot: owner.snapshotId,
3177
- project: owner.project.id,
3196
+ project: owner.project.handle,
3178
3197
  name,
3179
3198
  meaning,
3180
- location: isNode ? getNodeId(location) : undefined,
3199
+ location: isNode ? getNodeRequestHandle(location) : undefined,
3181
3200
  file: !isNode && location ? location.document : undefined,
3182
3201
  position: !isNode && location ? location.position : undefined,
3183
3202
  excludeGlobals,
@@ -3195,9 +3214,9 @@ export class Checker {
3195
3214
  const isNode = "kind" in location;
3196
3215
  const data = owner.client.apiRequest("getSymbolsInScope", {
3197
3216
  snapshot: owner.snapshotId,
3198
- project: owner.project.id,
3217
+ project: owner.project.handle,
3199
3218
  meaning,
3200
- location: isNode ? getNodeId(location) : undefined,
3219
+ location: isNode ? getNodeRequestHandle(location) : undefined,
3201
3220
  file: isNode ? undefined : location.document,
3202
3221
  position: isNode ? undefined : location.position,
3203
3222
  });
@@ -3207,9 +3226,9 @@ export class Checker {
3207
3226
  const isNode = "kind" in location;
3208
3227
  const data = yield* apiRequest("getSymbolsInScope", {
3209
3228
  snapshot: owner.snapshotId,
3210
- project: owner.project.id,
3229
+ project: owner.project.handle,
3211
3230
  meaning,
3212
- location: isNode ? getNodeId(location) : undefined,
3231
+ location: isNode ? getNodeRequestHandle(location) : undefined,
3213
3232
  file: isNode ? undefined : location.document,
3214
3233
  position: isNode ? undefined : location.position,
3215
3234
  });
@@ -3235,15 +3254,15 @@ export class Checker {
3235
3254
  return cacheGeneratorMethod(owner, "getContextualType", function (node) {
3236
3255
  const data = owner.client.apiRequest("getContextualType", {
3237
3256
  snapshot: owner.snapshotId,
3238
- project: owner.project.id,
3239
- location: getNodeId(node),
3257
+ project: owner.project.handle,
3258
+ location: getNodeRequestHandle(node),
3240
3259
  });
3241
3260
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3242
3261
  }, function* (node) {
3243
3262
  const data = yield* apiRequest("getContextualType", {
3244
3263
  snapshot: owner.snapshotId,
3245
- project: owner.project.id,
3246
- location: getNodeId(node),
3264
+ project: owner.project.handle,
3265
+ location: getNodeRequestHandle(node),
3247
3266
  });
3248
3267
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3249
3268
  });
@@ -3253,16 +3272,16 @@ export class Checker {
3253
3272
  return cacheGeneratorMethod(owner, "getContextualTypeForArgumentAtIndex", function (node, argIndex) {
3254
3273
  const data = owner.client.apiRequest("getContextualTypeForArgument", {
3255
3274
  snapshot: owner.snapshotId,
3256
- project: owner.project.id,
3257
- location: getNodeId(node),
3275
+ project: owner.project.handle,
3276
+ location: getNodeRequestHandle(node),
3258
3277
  index: argIndex,
3259
3278
  });
3260
3279
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3261
3280
  }, function* (node, argIndex) {
3262
3281
  const data = yield* apiRequest("getContextualTypeForArgument", {
3263
3282
  snapshot: owner.snapshotId,
3264
- project: owner.project.id,
3265
- location: getNodeId(node),
3283
+ project: owner.project.handle,
3284
+ location: getNodeRequestHandle(node),
3266
3285
  index: argIndex,
3267
3286
  });
3268
3287
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
@@ -3273,14 +3292,14 @@ export class Checker {
3273
3292
  return cacheGeneratorMethod(owner, "getAwaitedType", function (type) {
3274
3293
  const data = owner.client.apiRequest("getAwaitedType", {
3275
3294
  snapshot: owner.snapshotId,
3276
- project: owner.project.id,
3295
+ project: owner.project.handle,
3277
3296
  type: type.id,
3278
3297
  });
3279
3298
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3280
3299
  }, function* (type) {
3281
3300
  const data = yield* apiRequest("getAwaitedType", {
3282
3301
  snapshot: owner.snapshotId,
3283
- project: owner.project.id,
3302
+ project: owner.project.handle,
3284
3303
  type: type.id,
3285
3304
  });
3286
3305
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
@@ -3292,14 +3311,14 @@ export class Checker {
3292
3311
  return cacheGeneratorMethod(owner, "getBaseTypeOfLiteralType", function (type) {
3293
3312
  const data = owner.client.apiRequest("getBaseTypeOfLiteralType", {
3294
3313
  snapshot: owner.snapshotId,
3295
- project: owner.project.id,
3314
+ project: owner.project.handle,
3296
3315
  type: type.id,
3297
3316
  });
3298
3317
  return owner.objectRegistry.getOrCreateType(data);
3299
3318
  }, function* (type) {
3300
3319
  const data = yield* apiRequest("getBaseTypeOfLiteralType", {
3301
3320
  snapshot: owner.snapshotId,
3302
- project: owner.project.id,
3321
+ project: owner.project.handle,
3303
3322
  type: type.id,
3304
3323
  });
3305
3324
  return owner.objectRegistry.getOrCreateType(data);
@@ -3324,15 +3343,15 @@ export class Checker {
3324
3343
  return cacheGeneratorMethod(owner, "getTypeFromTypeNode", function (node) {
3325
3344
  const data = owner.client.apiRequest("getTypeFromTypeNode", {
3326
3345
  snapshot: owner.snapshotId,
3327
- project: owner.project.id,
3328
- location: getNodeId(node),
3346
+ project: owner.project.handle,
3347
+ location: getNodeRequestHandle(node),
3329
3348
  });
3330
3349
  return owner.objectRegistry.getOrCreateType(data);
3331
3350
  }, function* (node) {
3332
3351
  const data = yield* apiRequest("getTypeFromTypeNode", {
3333
3352
  snapshot: owner.snapshotId,
3334
- project: owner.project.id,
3335
- location: getNodeId(node),
3353
+ project: owner.project.handle,
3354
+ location: getNodeRequestHandle(node),
3336
3355
  });
3337
3356
  return owner.objectRegistry.getOrCreateType(data);
3338
3357
  });
@@ -3343,14 +3362,14 @@ export class Checker {
3343
3362
  return cacheGeneratorMethod(owner, "getWidenedType", function (type) {
3344
3363
  const data = owner.client.apiRequest("getWidenedType", {
3345
3364
  snapshot: owner.snapshotId,
3346
- project: owner.project.id,
3365
+ project: owner.project.handle,
3347
3366
  type: type.id,
3348
3367
  });
3349
3368
  return owner.objectRegistry.getOrCreateType(data);
3350
3369
  }, function* (type) {
3351
3370
  const data = yield* apiRequest("getWidenedType", {
3352
3371
  snapshot: owner.snapshotId,
3353
- project: owner.project.id,
3372
+ project: owner.project.handle,
3354
3373
  type: type.id,
3355
3374
  });
3356
3375
  return owner.objectRegistry.getOrCreateType(data);
@@ -3365,7 +3384,7 @@ export class Checker {
3365
3384
  return cacheGeneratorMethod(owner, "getParameterType", function (signature, index) {
3366
3385
  const data = owner.client.apiRequest("getParameterType", {
3367
3386
  snapshot: owner.snapshotId,
3368
- project: owner.project.id,
3387
+ project: owner.project.handle,
3369
3388
  signature: signature.id,
3370
3389
  index,
3371
3390
  });
@@ -3373,7 +3392,7 @@ export class Checker {
3373
3392
  }, function* (signature, index) {
3374
3393
  const data = yield* apiRequest("getParameterType", {
3375
3394
  snapshot: owner.snapshotId,
3376
- project: owner.project.id,
3395
+ project: owner.project.handle,
3377
3396
  signature: signature.id,
3378
3397
  index,
3379
3398
  });
@@ -3385,13 +3404,13 @@ export class Checker {
3385
3404
  return cacheGeneratorMethod(owner, "isArrayLikeType", function (type) {
3386
3405
  return owner.client.apiRequest("isArrayLikeType", {
3387
3406
  snapshot: owner.snapshotId,
3388
- project: owner.project.id,
3407
+ project: owner.project.handle,
3389
3408
  type: type.id,
3390
3409
  });
3391
3410
  }, function* (type) {
3392
3411
  return yield* apiRequest("isArrayLikeType", {
3393
3412
  snapshot: owner.snapshotId,
3394
- project: owner.project.id,
3413
+ project: owner.project.handle,
3395
3414
  type: type.id,
3396
3415
  });
3397
3416
  });
@@ -3401,14 +3420,14 @@ export class Checker {
3401
3420
  return cacheGeneratorMethod(owner, "isTypeAssignableTo", function (source, target) {
3402
3421
  return owner.client.apiRequest("isTypeAssignableTo", {
3403
3422
  snapshot: owner.snapshotId,
3404
- project: owner.project.id,
3423
+ project: owner.project.handle,
3405
3424
  source: source.id,
3406
3425
  target: target.id,
3407
3426
  });
3408
3427
  }, function* (source, target) {
3409
3428
  return yield* apiRequest("isTypeAssignableTo", {
3410
3429
  snapshot: owner.snapshotId,
3411
- project: owner.project.id,
3430
+ project: owner.project.handle,
3412
3431
  source: source.id,
3413
3432
  target: target.id,
3414
3433
  });
@@ -3419,15 +3438,15 @@ export class Checker {
3419
3438
  return cacheGeneratorMethod(owner, "getShorthandAssignmentValueSymbol", function (node) {
3420
3439
  const data = owner.client.apiRequest("getShorthandAssignmentValueSymbol", {
3421
3440
  snapshot: owner.snapshotId,
3422
- project: owner.project.id,
3423
- location: getNodeId(node),
3441
+ project: owner.project.handle,
3442
+ location: getNodeRequestHandle(node),
3424
3443
  });
3425
3444
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
3426
3445
  }, function* (node) {
3427
3446
  const data = yield* apiRequest("getShorthandAssignmentValueSymbol", {
3428
3447
  snapshot: owner.snapshotId,
3429
- project: owner.project.id,
3430
- location: getNodeId(node),
3448
+ project: owner.project.handle,
3449
+ location: getNodeRequestHandle(node),
3431
3450
  });
3432
3451
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
3433
3452
  });
@@ -3442,17 +3461,17 @@ export class Checker {
3442
3461
  return cacheGeneratorMethod(owner, "getTypeOfSymbolAtLocation", function (symbol, location) {
3443
3462
  const data = owner.client.apiRequest("getTypeOfSymbolAtLocation", {
3444
3463
  snapshot: owner.snapshotId,
3445
- project: owner.project.id,
3464
+ project: owner.project.handle,
3446
3465
  symbol: symbol.reference,
3447
- location: getNodeId(location),
3466
+ location: getNodeRequestHandle(location),
3448
3467
  });
3449
3468
  return owner.objectRegistry.getOrCreateType(data);
3450
3469
  }, function* (symbol, location) {
3451
3470
  const data = yield* apiRequest("getTypeOfSymbolAtLocation", {
3452
3471
  snapshot: owner.snapshotId,
3453
- project: owner.project.id,
3472
+ project: owner.project.handle,
3454
3473
  symbol: symbol.reference,
3455
- location: getNodeId(location),
3474
+ location: getNodeRequestHandle(location),
3456
3475
  });
3457
3476
  return owner.objectRegistry.getOrCreateType(data);
3458
3477
  });
@@ -3462,13 +3481,13 @@ export class Checker {
3462
3481
  return cacheGeneratorMethod(owner, "getIntrinsicType", function (method) {
3463
3482
  const data = owner.client.apiRequest(method, {
3464
3483
  snapshot: owner.snapshotId,
3465
- project: owner.project.id,
3484
+ project: owner.project.handle,
3466
3485
  });
3467
3486
  return owner.objectRegistry.getOrCreateType(data);
3468
3487
  }, function* (method) {
3469
3488
  const data = yield* apiRequest(method, {
3470
3489
  snapshot: owner.snapshotId,
3471
- project: owner.project.id,
3490
+ project: owner.project.handle,
3472
3491
  });
3473
3492
  return owner.objectRegistry.getOrCreateType(data);
3474
3493
  });
@@ -3574,9 +3593,9 @@ export class Checker {
3574
3593
  return cacheGeneratorMethod(owner, "typeToTypeNode", function (type, enclosingDeclaration, flags) {
3575
3594
  const binaryData = owner.client.apiRequestBinary("typeToTypeNode", {
3576
3595
  snapshot: owner.snapshotId,
3577
- project: owner.project.id,
3596
+ project: owner.project.handle,
3578
3597
  type: type.id,
3579
- location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
3598
+ location: enclosingDeclaration ? getNodeRequestHandle(enclosingDeclaration) : undefined,
3580
3599
  flags,
3581
3600
  });
3582
3601
  if (!binaryData)
@@ -3585,9 +3604,9 @@ export class Checker {
3585
3604
  }, function* (type, enclosingDeclaration, flags) {
3586
3605
  const binaryData = sourceFileResponseToUint8Array(yield* apiRequest("typeToTypeNode", {
3587
3606
  snapshot: owner.snapshotId,
3588
- project: owner.project.id,
3607
+ project: owner.project.handle,
3589
3608
  type: type.id,
3590
- location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
3609
+ location: enclosingDeclaration ? getNodeRequestHandle(enclosingDeclaration) : undefined,
3591
3610
  flags,
3592
3611
  }));
3593
3612
  if (!binaryData)
@@ -3600,10 +3619,10 @@ export class Checker {
3600
3619
  return cacheGeneratorMethod(owner, "signatureToSignatureDeclaration", function (signature, kind, enclosingDeclaration, flags) {
3601
3620
  const binaryData = owner.client.apiRequestBinary("signatureToSignatureDeclaration", {
3602
3621
  snapshot: owner.snapshotId,
3603
- project: owner.project.id,
3622
+ project: owner.project.handle,
3604
3623
  signature: signature.id,
3605
3624
  kind,
3606
- location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
3625
+ location: enclosingDeclaration ? getNodeRequestHandle(enclosingDeclaration) : undefined,
3607
3626
  flags,
3608
3627
  });
3609
3628
  if (!binaryData)
@@ -3612,10 +3631,10 @@ export class Checker {
3612
3631
  }, function* (signature, kind, enclosingDeclaration, flags) {
3613
3632
  const binaryData = sourceFileResponseToUint8Array(yield* apiRequest("signatureToSignatureDeclaration", {
3614
3633
  snapshot: owner.snapshotId,
3615
- project: owner.project.id,
3634
+ project: owner.project.handle,
3616
3635
  signature: signature.id,
3617
3636
  kind,
3618
- location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
3637
+ location: enclosingDeclaration ? getNodeRequestHandle(enclosingDeclaration) : undefined,
3619
3638
  flags,
3620
3639
  }));
3621
3640
  if (!binaryData)
@@ -3628,9 +3647,9 @@ export class Checker {
3628
3647
  return cacheGeneratorMethod(owner, "typeToString", function (type, enclosingDeclaration, flags) {
3629
3648
  const result = owner.client.apiRequest("typeToString", {
3630
3649
  snapshot: owner.snapshotId,
3631
- project: owner.project.id,
3650
+ project: owner.project.handle,
3632
3651
  type: type.id,
3633
- location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
3652
+ location: enclosingDeclaration ? getNodeRequestHandle(enclosingDeclaration) : undefined,
3634
3653
  flags,
3635
3654
  });
3636
3655
  if (typeof result !== "string")
@@ -3639,9 +3658,9 @@ export class Checker {
3639
3658
  }, function* (type, enclosingDeclaration, flags) {
3640
3659
  const result = yield* apiRequest("typeToString", {
3641
3660
  snapshot: owner.snapshotId,
3642
- project: owner.project.id,
3661
+ project: owner.project.handle,
3643
3662
  type: type.id,
3644
- location: enclosingDeclaration ? getNodeId(enclosingDeclaration) : undefined,
3663
+ location: enclosingDeclaration ? getNodeRequestHandle(enclosingDeclaration) : undefined,
3645
3664
  flags,
3646
3665
  });
3647
3666
  if (typeof result !== "string")
@@ -3654,14 +3673,14 @@ export class Checker {
3654
3673
  return cacheGeneratorMethod(owner, "isContextSensitive", function (node) {
3655
3674
  return owner.client.apiRequest("isContextSensitive", {
3656
3675
  snapshot: owner.snapshotId,
3657
- project: owner.project.id,
3658
- location: getNodeId(node),
3676
+ project: owner.project.handle,
3677
+ location: getNodeRequestHandle(node),
3659
3678
  });
3660
3679
  }, function* (node) {
3661
3680
  return yield* apiRequest("isContextSensitive", {
3662
3681
  snapshot: owner.snapshotId,
3663
- project: owner.project.id,
3664
- location: getNodeId(node),
3682
+ project: owner.project.handle,
3683
+ location: getNodeRequestHandle(node),
3665
3684
  });
3666
3685
  });
3667
3686
  }
@@ -3670,13 +3689,13 @@ export class Checker {
3670
3689
  return cacheGeneratorMethod(owner, "isArrayType", function (type) {
3671
3690
  return owner.client.apiRequest("isArrayType", {
3672
3691
  snapshot: owner.snapshotId,
3673
- project: owner.project.id,
3692
+ project: owner.project.handle,
3674
3693
  type: type.id,
3675
3694
  });
3676
3695
  }, function* (type) {
3677
3696
  return yield* apiRequest("isArrayType", {
3678
3697
  snapshot: owner.snapshotId,
3679
- project: owner.project.id,
3698
+ project: owner.project.handle,
3680
3699
  type: type.id,
3681
3700
  });
3682
3701
  });
@@ -3711,13 +3730,13 @@ export class Checker {
3711
3730
  return cacheGeneratorMethod(owner, "isReadonlySymbol", function (symbol) {
3712
3731
  return owner.client.apiRequest("isReadonlySymbol", {
3713
3732
  snapshot: owner.snapshotId,
3714
- project: owner.project.id,
3733
+ project: owner.project.handle,
3715
3734
  symbol: symbol.reference,
3716
3735
  });
3717
3736
  }, function* (symbol) {
3718
3737
  return yield* apiRequest("isReadonlySymbol", {
3719
3738
  snapshot: owner.snapshotId,
3720
- project: owner.project.id,
3739
+ project: owner.project.handle,
3721
3740
  symbol: symbol.reference,
3722
3741
  });
3723
3742
  });
@@ -3740,14 +3759,14 @@ export class Checker {
3740
3759
  return cacheGeneratorMethod(owner, "getRestTypeOfSignature", function (signature) {
3741
3760
  const data = owner.client.apiRequest("getRestTypeOfSignature", {
3742
3761
  snapshot: owner.snapshotId,
3743
- project: owner.project.id,
3762
+ project: owner.project.handle,
3744
3763
  signature: signature.id,
3745
3764
  });
3746
3765
  return owner.objectRegistry.getOrCreateType(data);
3747
3766
  }, function* (signature) {
3748
3767
  const data = yield* apiRequest("getRestTypeOfSignature", {
3749
3768
  snapshot: owner.snapshotId,
3750
- project: owner.project.id,
3769
+ project: owner.project.handle,
3751
3770
  signature: signature.id,
3752
3771
  });
3753
3772
  return owner.objectRegistry.getOrCreateType(data);
@@ -3758,7 +3777,7 @@ export class Checker {
3758
3777
  return cacheGeneratorMethod(owner, "getTypePredicateOfSignature", function (signature) {
3759
3778
  const data = owner.client.apiRequest("getTypePredicateOfSignature", {
3760
3779
  snapshot: owner.snapshotId,
3761
- project: owner.project.id,
3780
+ project: owner.project.handle,
3762
3781
  signature: signature.id,
3763
3782
  });
3764
3783
  if (!data)
@@ -3772,7 +3791,7 @@ export class Checker {
3772
3791
  }, function* (signature) {
3773
3792
  const data = yield* apiRequest("getTypePredicateOfSignature", {
3774
3793
  snapshot: owner.snapshotId,
3775
- project: owner.project.id,
3794
+ project: owner.project.handle,
3776
3795
  signature: signature.id,
3777
3796
  });
3778
3797
  if (!data)
@@ -3836,7 +3855,7 @@ export class Checker {
3836
3855
  return cacheGeneratorMethod(owner, "getIndexInfoOfType", function (type, kind) {
3837
3856
  const data = owner.client.apiRequest("getIndexInfoOfType", {
3838
3857
  snapshot: owner.snapshotId,
3839
- project: owner.project.id,
3858
+ project: owner.project.handle,
3840
3859
  type: type.id,
3841
3860
  kind,
3842
3861
  });
@@ -3844,12 +3863,12 @@ export class Checker {
3844
3863
  keyType: owner.objectRegistry.getOrCreateType(data.keyType),
3845
3864
  valueType: owner.objectRegistry.getOrCreateType(data.valueType),
3846
3865
  isReadonly: data.isReadonly ?? false,
3847
- declaration: data.declaration ? new NodeHandle(data.declaration, owner.project) : undefined,
3866
+ declaration: data.declaration ? owner.objectRegistry.createNodeHandle(data.declaration) : undefined,
3848
3867
  } : undefined;
3849
3868
  }, function* (type, kind) {
3850
3869
  const data = yield* apiRequest("getIndexInfoOfType", {
3851
3870
  snapshot: owner.snapshotId,
3852
- project: owner.project.id,
3871
+ project: owner.project.handle,
3853
3872
  type: type.id,
3854
3873
  kind,
3855
3874
  });
@@ -3857,7 +3876,7 @@ export class Checker {
3857
3876
  keyType: owner.objectRegistry.getOrCreateType(data.keyType),
3858
3877
  valueType: owner.objectRegistry.getOrCreateType(data.valueType),
3859
3878
  isReadonly: data.isReadonly ?? false,
3860
- declaration: data.declaration ? new NodeHandle(data.declaration, owner.project) : undefined,
3879
+ declaration: data.declaration ? owner.objectRegistry.createNodeHandle(data.declaration) : undefined,
3861
3880
  } : undefined;
3862
3881
  });
3863
3882
  }
@@ -3874,7 +3893,7 @@ export class Checker {
3874
3893
  return cacheGeneratorMethod(owner, "getTypeOfPropertyOfType", function (type, propertyName) {
3875
3894
  const data = owner.client.apiRequest("getTypeOfPropertyOfType", {
3876
3895
  snapshot: owner.snapshotId,
3877
- project: owner.project.id,
3896
+ project: owner.project.handle,
3878
3897
  type: type.id,
3879
3898
  name: propertyName,
3880
3899
  });
@@ -3882,7 +3901,7 @@ export class Checker {
3882
3901
  }, function* (type, propertyName) {
3883
3902
  const data = yield* apiRequest("getTypeOfPropertyOfType", {
3884
3903
  snapshot: owner.snapshotId,
3885
- project: owner.project.id,
3904
+ project: owner.project.handle,
3886
3905
  type: type.id,
3887
3906
  name: propertyName,
3888
3907
  });
@@ -3914,14 +3933,14 @@ export class Checker {
3914
3933
  return cacheGeneratorMethod(owner, "getBaseConstraintOfType", function (type) {
3915
3934
  const data = owner.client.apiRequest("getBaseConstraintOfType", {
3916
3935
  snapshot: owner.snapshotId,
3917
- project: owner.project.id,
3936
+ project: owner.project.handle,
3918
3937
  type: type.id,
3919
3938
  });
3920
3939
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
3921
3940
  }, function* (type) {
3922
3941
  const data = yield* apiRequest("getBaseConstraintOfType", {
3923
3942
  snapshot: owner.snapshotId,
3924
- project: owner.project.id,
3943
+ project: owner.project.handle,
3925
3944
  type: type.id,
3926
3945
  });
3927
3946
  return data ? owner.objectRegistry.getOrCreateType(data) : undefined;
@@ -3932,7 +3951,7 @@ export class Checker {
3932
3951
  return cacheGeneratorMethod(owner, "getPropertyOfType", function (type, name) {
3933
3952
  const data = owner.client.apiRequest("getPropertyOfType", {
3934
3953
  snapshot: owner.snapshotId,
3935
- project: owner.project.id,
3954
+ project: owner.project.handle,
3936
3955
  type: type.id,
3937
3956
  name,
3938
3957
  });
@@ -3940,7 +3959,7 @@ export class Checker {
3940
3959
  }, function* (type, name) {
3941
3960
  const data = yield* apiRequest("getPropertyOfType", {
3942
3961
  snapshot: owner.snapshotId,
3943
- project: owner.project.id,
3962
+ project: owner.project.handle,
3944
3963
  type: type.id,
3945
3964
  name,
3946
3965
  });
@@ -3952,8 +3971,8 @@ export class Checker {
3952
3971
  return cacheGeneratorMethod(owner, "getConstantValue", function (node) {
3953
3972
  const data = owner.client.apiRequest("getConstantValue", {
3954
3973
  snapshot: owner.snapshotId,
3955
- project: owner.project.id,
3956
- location: getNodeId(node),
3974
+ project: owner.project.handle,
3975
+ location: getNodeRequestHandle(node),
3957
3976
  });
3958
3977
  if (!data || (typeof data.value !== "string" && typeof data.value !== "number")) {
3959
3978
  return undefined;
@@ -3971,8 +3990,8 @@ export class Checker {
3971
3990
  }, function* (node) {
3972
3991
  const data = yield* apiRequest("getConstantValue", {
3973
3992
  snapshot: owner.snapshotId,
3974
- project: owner.project.id,
3975
- location: getNodeId(node),
3993
+ project: owner.project.handle,
3994
+ location: getNodeRequestHandle(node),
3976
3995
  });
3977
3996
  if (!data || (typeof data.value !== "string" && typeof data.value !== "number")) {
3978
3997
  return undefined;
@@ -3995,15 +4014,15 @@ export class Checker {
3995
4014
  return cacheGeneratorMethod(owner, "getSignatureFromDeclaration", function (node) {
3996
4015
  const data = owner.client.apiRequest("getSignatureFromDeclaration", {
3997
4016
  snapshot: owner.snapshotId,
3998
- project: owner.project.id,
3999
- location: getNodeId(node),
4017
+ project: owner.project.handle,
4018
+ location: getNodeRequestHandle(node),
4000
4019
  });
4001
4020
  return owner.objectRegistry.getOrCreateSignature(data);
4002
4021
  }, function* (node) {
4003
4022
  const data = yield* apiRequest("getSignatureFromDeclaration", {
4004
4023
  snapshot: owner.snapshotId,
4005
- project: owner.project.id,
4006
- location: getNodeId(node),
4024
+ project: owner.project.handle,
4025
+ location: getNodeRequestHandle(node),
4007
4026
  });
4008
4027
  return owner.objectRegistry.getOrCreateSignature(data);
4009
4028
  });
@@ -4013,15 +4032,15 @@ export class Checker {
4013
4032
  return cacheGeneratorMethod(owner, "getExportSpecifierLocalTargetSymbol", function (node) {
4014
4033
  const data = owner.client.apiRequest("getExportSpecifierLocalTargetSymbol", {
4015
4034
  snapshot: owner.snapshotId,
4016
- project: owner.project.id,
4017
- location: getNodeId(node),
4035
+ project: owner.project.handle,
4036
+ location: getNodeRequestHandle(node),
4018
4037
  });
4019
4038
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
4020
4039
  }, function* (node) {
4021
4040
  const data = yield* apiRequest("getExportSpecifierLocalTargetSymbol", {
4022
4041
  snapshot: owner.snapshotId,
4023
- project: owner.project.id,
4024
- location: getNodeId(node),
4042
+ project: owner.project.handle,
4043
+ location: getNodeRequestHandle(node),
4025
4044
  });
4026
4045
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
4027
4046
  });
@@ -4036,14 +4055,14 @@ export class Checker {
4036
4055
  return cacheGeneratorMethod(owner, "getAliasedSymbol", function (symbol) {
4037
4056
  const data = owner.client.apiRequest("getAliasedSymbol", {
4038
4057
  snapshot: owner.snapshotId,
4039
- project: owner.project.id,
4058
+ project: owner.project.handle,
4040
4059
  symbol: symbol.reference,
4041
4060
  });
4042
4061
  return owner.objectRegistry.getOrCreateSymbol(data);
4043
4062
  }, function* (symbol) {
4044
4063
  const data = yield* apiRequest("getAliasedSymbol", {
4045
4064
  snapshot: owner.snapshotId,
4046
- project: owner.project.id,
4065
+ project: owner.project.handle,
4047
4066
  symbol: symbol.reference,
4048
4067
  });
4049
4068
  return owner.objectRegistry.getOrCreateSymbol(data);
@@ -4058,13 +4077,13 @@ export class Checker {
4058
4077
  return cacheGeneratorMethod(owner, "getFullyQualifiedName", function (symbol) {
4059
4078
  return owner.client.apiRequest("getFullyQualifiedName", {
4060
4079
  snapshot: owner.snapshotId,
4061
- project: owner.project.id,
4080
+ project: owner.project.handle,
4062
4081
  symbol: symbol.reference,
4063
4082
  });
4064
4083
  }, function* (symbol) {
4065
4084
  return yield* apiRequest("getFullyQualifiedName", {
4066
4085
  snapshot: owner.snapshotId,
4067
- project: owner.project.id,
4086
+ project: owner.project.handle,
4068
4087
  symbol: symbol.reference,
4069
4088
  });
4070
4089
  });
@@ -4074,14 +4093,14 @@ export class Checker {
4074
4093
  return cacheGeneratorMethod(owner, "getImmediateAliasedSymbol", function (symbol) {
4075
4094
  const data = owner.client.apiRequest("getImmediateAliasedSymbol", {
4076
4095
  snapshot: owner.snapshotId,
4077
- project: owner.project.id,
4096
+ project: owner.project.handle,
4078
4097
  symbol: symbol.reference,
4079
4098
  });
4080
4099
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
4081
4100
  }, function* (symbol) {
4082
4101
  const data = yield* apiRequest("getImmediateAliasedSymbol", {
4083
4102
  snapshot: owner.snapshotId,
4084
- project: owner.project.id,
4103
+ project: owner.project.handle,
4085
4104
  symbol: symbol.reference,
4086
4105
  });
4087
4106
  return data ? owner.objectRegistry.getOrCreateSymbol(data) : undefined;
@@ -4096,7 +4115,7 @@ export class Checker {
4096
4115
  if (symbol.checkFlags & CheckFlags.Instantiated) {
4097
4116
  const data = owner.client.apiRequest("getTargetSymbol", {
4098
4117
  snapshot: owner.snapshotId,
4099
- project: owner.project.id,
4118
+ project: owner.project.handle,
4100
4119
  symbol: symbol.reference,
4101
4120
  });
4102
4121
  return owner.objectRegistry.getOrCreateSymbol(data);
@@ -4106,7 +4125,7 @@ export class Checker {
4106
4125
  if (symbol.checkFlags & CheckFlags.Instantiated) {
4107
4126
  const data = yield* apiRequest("getTargetSymbol", {
4108
4127
  snapshot: owner.snapshotId,
4109
- project: owner.project.id,
4128
+ project: owner.project.handle,
4110
4129
  symbol: symbol.reference,
4111
4130
  });
4112
4131
  return owner.objectRegistry.getOrCreateSymbol(data);
@@ -4119,14 +4138,14 @@ export class Checker {
4119
4138
  return cacheGeneratorMethod(owner, "getExportSymbolOfSymbol", function (symbol) {
4120
4139
  const data = owner.client.apiRequest("getExportSymbolOfSymbolForChecker", {
4121
4140
  snapshot: owner.snapshotId,
4122
- project: owner.project.id,
4141
+ project: owner.project.handle,
4123
4142
  symbol: symbol.reference,
4124
4143
  });
4125
4144
  return owner.objectRegistry.getOrCreateSymbol(data);
4126
4145
  }, function* (symbol) {
4127
4146
  const data = yield* apiRequest("getExportSymbolOfSymbolForChecker", {
4128
4147
  snapshot: owner.snapshotId,
4129
- project: owner.project.id,
4148
+ project: owner.project.handle,
4130
4149
  symbol: symbol.reference,
4131
4150
  });
4132
4151
  return owner.objectRegistry.getOrCreateSymbol(data);
@@ -4143,12 +4162,12 @@ export class Checker {
4143
4162
  return cacheGeneratorMethod(owner, "getWellKnownSymbols", function () {
4144
4163
  return owner.wellKnownSymbols ??= owner.client.apiRequest("getWellKnownSymbols", {
4145
4164
  snapshot: owner.snapshotId,
4146
- project: owner.project.id,
4165
+ project: owner.project.handle,
4147
4166
  });
4148
4167
  }, function* () {
4149
4168
  return owner.wellKnownSymbols ??= yield* apiRequest("getWellKnownSymbols", {
4150
4169
  snapshot: owner.snapshotId,
4151
- project: owner.project.id,
4170
+ project: owner.project.handle,
4152
4171
  });
4153
4172
  });
4154
4173
  }
@@ -4196,12 +4215,12 @@ export class Checker {
4196
4215
  return cacheGeneratorMethod(owner, "getWellKnownSignatures", function () {
4197
4216
  return owner.wellKnownSignatures ??= owner.client.apiRequest("getWellKnownSignatures", {
4198
4217
  snapshot: owner.snapshotId,
4199
- project: owner.project.id,
4218
+ project: owner.project.handle,
4200
4219
  });
4201
4220
  }, function* () {
4202
4221
  return owner.wellKnownSignatures ??= yield* apiRequest("getWellKnownSignatures", {
4203
4222
  snapshot: owner.snapshotId,
4204
- project: owner.project.id,
4223
+ project: owner.project.handle,
4205
4224
  });
4206
4225
  });
4207
4226
  }
@@ -4223,14 +4242,14 @@ export class Checker {
4223
4242
  return cacheGeneratorMethod(owner, "getExportsOfModule", function (symbol) {
4224
4243
  const data = owner.client.apiRequest("getExportsOfModule", {
4225
4244
  snapshot: owner.snapshotId,
4226
- project: owner.project.id,
4245
+ project: owner.project.handle,
4227
4246
  symbol: symbol.reference,
4228
4247
  });
4229
4248
  return data ? data.map(d => owner.objectRegistry.getOrCreateSymbol(d)) : [];
4230
4249
  }, function* (symbol) {
4231
4250
  const data = yield* apiRequest("getExportsOfModule", {
4232
4251
  snapshot: owner.snapshotId,
4233
- project: owner.project.id,
4252
+ project: owner.project.handle,
4234
4253
  symbol: symbol.reference,
4235
4254
  });
4236
4255
  return data ? data.map(d => owner.objectRegistry.getOrCreateSymbol(d)) : [];
@@ -4241,7 +4260,7 @@ export class Checker {
4241
4260
  return cacheGeneratorMethod(owner, "getMemberInModuleExports", function (symbol, name) {
4242
4261
  const data = owner.client.apiRequest("getMemberInModuleExports", {
4243
4262
  snapshot: owner.snapshotId,
4244
- project: owner.project.id,
4263
+ project: owner.project.handle,
4245
4264
  symbol: symbol.reference,
4246
4265
  name,
4247
4266
  });
@@ -4249,7 +4268,7 @@ export class Checker {
4249
4268
  }, function* (symbol, name) {
4250
4269
  const data = yield* apiRequest("getMemberInModuleExports", {
4251
4270
  snapshot: owner.snapshotId,
4252
- project: owner.project.id,
4271
+ project: owner.project.handle,
4253
4272
  symbol: symbol.reference,
4254
4273
  name,
4255
4274
  });
@@ -4261,14 +4280,14 @@ export class Checker {
4261
4280
  return cacheGeneratorMethod(owner, "getJsDocTagsOfSymbol", function (symbol) {
4262
4281
  const data = owner.client.apiRequest("getJsDocTags", {
4263
4282
  snapshot: owner.snapshotId,
4264
- project: owner.project.id,
4283
+ project: owner.project.handle,
4265
4284
  symbol: symbol.reference,
4266
4285
  });
4267
4286
  return data ?? [];
4268
4287
  }, function* (symbol) {
4269
4288
  const data = yield* apiRequest("getJsDocTags", {
4270
4289
  snapshot: owner.snapshotId,
4271
- project: owner.project.id,
4290
+ project: owner.project.handle,
4272
4291
  symbol: symbol.reference,
4273
4292
  });
4274
4293
  return data ?? [];
@@ -4279,13 +4298,13 @@ export class Checker {
4279
4298
  return cacheGeneratorMethod(owner, "getDocumentationCommentOfSymbol", function (symbol) {
4280
4299
  return owner.client.apiRequest("getDocumentationComment", {
4281
4300
  snapshot: owner.snapshotId,
4282
- project: owner.project.id,
4301
+ project: owner.project.handle,
4283
4302
  symbol: symbol.reference,
4284
4303
  });
4285
4304
  }, function* (symbol) {
4286
4305
  return yield* apiRequest("getDocumentationComment", {
4287
4306
  snapshot: owner.snapshotId,
4288
- project: owner.project.id,
4307
+ project: owner.project.handle,
4289
4308
  symbol: symbol.reference,
4290
4309
  });
4291
4310
  });
@@ -4298,14 +4317,14 @@ export class Checker {
4298
4317
  return cacheGeneratorMethod(owner, "getTypeArguments", function (type) {
4299
4318
  const data = owner.client.apiRequest("getTypeArguments", {
4300
4319
  snapshot: owner.snapshotId,
4301
- project: owner.project.id,
4320
+ project: owner.project.handle,
4302
4321
  type: type.id,
4303
4322
  });
4304
4323
  return data ? data.map(d => owner.objectRegistry.getOrCreateType(d)) : [];
4305
4324
  }, function* (type) {
4306
4325
  const data = yield* apiRequest("getTypeArguments", {
4307
4326
  snapshot: owner.snapshotId,
4308
- project: owner.project.id,
4327
+ project: owner.project.handle,
4309
4328
  type: type.id,
4310
4329
  });
4311
4330
  return data ? data.map(d => owner.objectRegistry.getOrCreateType(d)) : [];
@@ -4364,7 +4383,7 @@ export class Printer {
4364
4383
  }
4365
4384
  export class NodeHandle {
4366
4385
  /**
4367
- * The project this handle was produced in, used as the default for {@link resolve}.
4386
+ * The project where this handle was first materialized, used as the default for {@link resolve}.
4368
4387
  * Node handles are only meaningful within a project's program, so the producing project
4369
4388
  * is remembered so callers don't have to pass it explicitly.
4370
4389
  */
@@ -4373,11 +4392,15 @@ export class NodeHandle {
4373
4392
  fileOwner;
4374
4393
  index;
4375
4394
  kind;
4395
+ /** Identity of the exact parsed source file, shared across programs that reuse that AST. */
4396
+ sourceFileId;
4397
+ /** Retrieval metadata; never used to substitute a different source-file AST. */
4376
4398
  path;
4377
4399
  constructor(handle, canonicalProject, fileOwner) {
4378
4400
  const parsed = parseNodeHandleFromCompiler(handle);
4379
4401
  this.index = parsed.index;
4380
4402
  this.kind = parsed.kind;
4403
+ this.sourceFileId = parsed.sourceFileId;
4381
4404
  this.path = parsed.path;
4382
4405
  this.canonicalProject = canonicalProject;
4383
4406
  this.fileOwner = fileOwner;
@@ -4386,36 +4409,47 @@ export class NodeHandle {
4386
4409
  * Resolve this handle to the actual AST node by fetching the source file from a project
4387
4410
  * and looking up the node by index. If no project is passed, the project that produced
4388
4411
  * the handle is used. Declarations of file-owned symbols identify an exact source file and
4389
- * resolve through it, independently of any project.
4412
+ * resolve through it, independently of any project. A different AST at the
4413
+ * same path is never substituted.
4390
4414
  */
4391
4415
  get resolve() {
4392
4416
  const owner = this;
4393
4417
  return cacheGeneratorMethod(owner, "resolve", function (project = owner.canonicalProject) {
4394
4418
  if (owner.fileOwner) {
4395
4419
  const sourceFile = owner.fileOwner.record.file ?? owner.fetchOwnerFile(owner.fileOwner);
4396
- return sourceFile.getOrCreateNodeAtIndex(owner.index);
4420
+ return owner.resolveInFile(sourceFile);
4397
4421
  }
4398
4422
  if (!project)
4399
- throw new Error(`Node handle for '${owner.path}' has no project context`);
4423
+ throw new Error(`Node handle for source file '${owner.sourceFileId}' has no project context`);
4400
4424
  const sourceFile = project.program.getSourceFileByPath(owner.path);
4401
4425
  if (!sourceFile) {
4402
- return undefined;
4426
+ throw new Error("Node handle source file is not part of the requested program");
4403
4427
  }
4404
- return sourceFile.getOrCreateNodeAtIndex(owner.index);
4428
+ return owner.resolveInFile(sourceFile);
4405
4429
  }, function* (project = owner.canonicalProject) {
4406
4430
  if (owner.fileOwner) {
4407
4431
  const sourceFile = owner.fileOwner.record.file ?? (yield* owner.fetchOwnerFile.gen(owner.fileOwner));
4408
- return sourceFile.getOrCreateNodeAtIndex(owner.index);
4432
+ return owner.resolveInFile(sourceFile);
4409
4433
  }
4410
4434
  if (!project)
4411
- throw new Error(`Node handle for '${owner.path}' has no project context`);
4435
+ throw new Error(`Node handle for source file '${owner.sourceFileId}' has no project context`);
4412
4436
  const sourceFile = yield* project.program.getSourceFileByPath.gen(owner.path);
4413
4437
  if (!sourceFile) {
4414
- return undefined;
4438
+ throw new Error("Node handle source file is not part of the requested program");
4415
4439
  }
4416
- return sourceFile.getOrCreateNodeAtIndex(owner.index);
4440
+ return owner.resolveInFile(sourceFile);
4417
4441
  });
4418
4442
  }
4443
+ resolveInFile(sourceFile) {
4444
+ if (sourceFile.nodeId !== this.sourceFileId) {
4445
+ throw new Error(`Node handle source file is not part of the requested program`);
4446
+ }
4447
+ const node = sourceFile.getOrCreateNodeAtIndex(this.index);
4448
+ if (!node || node.kind !== this.kind) {
4449
+ throw new Error("Node handle does not identify a node of the expected kind");
4450
+ }
4451
+ return node;
4452
+ }
4419
4453
  get fetchOwnerFile() {
4420
4454
  const owner = this;
4421
4455
  return cacheGeneratorMethod(owner, "fetchOwnerFile", function (fileOwner) {
@@ -4444,8 +4478,11 @@ export class Symbol {
4444
4478
  checkFlags;
4445
4479
  /** @internal */
4446
4480
  reference;
4447
- declarations;
4448
- valueDeclaration;
4481
+ // Declaration handles are kept in their wire form until first accessed.
4482
+ declarationHandles;
4483
+ valueDeclarationHandle;
4484
+ declarationsCache;
4485
+ valueDeclarationCache;
4449
4486
  parent;
4450
4487
  exportSymbol;
4451
4488
  membersCache;
@@ -4458,19 +4495,31 @@ export class Symbol {
4458
4495
  this.escapedName = data.name;
4459
4496
  this.name = unescapeLeadingUnderscores(data.name);
4460
4497
  this.flags = data.flags;
4461
- this.checkFlags = data.checkFlags;
4462
- // A file-owned symbol has no canonical project; its declarations resolve through its file.
4463
- const project = storage.kind === SymbolOwnerKind.Snapshot ? storage.registry.project : undefined;
4464
- const fileOwner = storage.kind === SymbolOwnerKind.File ? storage.owner : undefined;
4465
- this.declarations = (data.declarations ?? []).map(handle => new NodeHandle(handle, project, fileOwner));
4466
- this.valueDeclaration = data.valueDeclaration
4467
- ? new NodeHandle(data.valueDeclaration, project, fileOwner)
4468
- : undefined;
4498
+ this.checkFlags = data.checkFlags ?? 0;
4499
+ this.declarationHandles = data.declarations;
4500
+ this.valueDeclarationHandle = data.valueDeclaration;
4501
+ this.declarationsCache = undefined;
4502
+ this.valueDeclarationCache = undefined;
4469
4503
  if (data.parent !== undefined)
4470
4504
  this.parent = data.parent;
4471
4505
  if (data.exportSymbol !== undefined)
4472
4506
  this.exportSymbol = data.exportSymbol;
4473
4507
  }
4508
+ get declarations() {
4509
+ return this.declarationsCache ??= this.declarationHandles?.map(handle => this.createDeclarationHandle(handle)) ?? [];
4510
+ }
4511
+ get valueDeclaration() {
4512
+ if (this.valueDeclarationCache === undefined && this.valueDeclarationHandle) {
4513
+ this.valueDeclarationCache = this.createDeclarationHandle(this.valueDeclarationHandle);
4514
+ }
4515
+ return this.valueDeclarationCache;
4516
+ }
4517
+ createDeclarationHandle(handle) {
4518
+ // A file-owned symbol has no canonical project; its declarations resolve through its file.
4519
+ return this.storage.kind === SymbolOwnerKind.Snapshot
4520
+ ? this.storage.registry.createNodeHandle(handle)
4521
+ : new NodeHandle(handle, undefined, this.storage.owner);
4522
+ }
4474
4523
  get getParent() {
4475
4524
  const owner = this;
4476
4525
  return cacheGeneratorMethod(owner, "getParent", function () {
@@ -4670,8 +4719,7 @@ class TypeObject {
4670
4719
  this.objectRegistry = objectRegistry;
4671
4720
  this.id = data.id;
4672
4721
  this.flags = data.flags;
4673
- if (data.objectFlags !== undefined)
4674
- this.objectFlags = data.objectFlags;
4722
+ this.objectFlags = data.objectFlags ?? 0;
4675
4723
  if (data.symbol !== undefined)
4676
4724
  this.symbol = data.symbol;
4677
4725
  if (data.value != null) {
@@ -4699,8 +4747,7 @@ class TypeObject {
4699
4747
  }
4700
4748
  if (data.intrinsicName !== undefined)
4701
4749
  this.intrinsicName = data.intrinsicName;
4702
- if (data.isThisType !== undefined)
4703
- this.isThisType = data.isThisType;
4750
+ this.isThisType = data.isThisType ?? false;
4704
4751
  if (data.freshType !== undefined)
4705
4752
  this.freshType = data.freshType;
4706
4753
  if (data.regularType !== undefined)
@@ -5326,7 +5373,9 @@ export class Signature {
5326
5373
  flags;
5327
5374
  objectRegistry;
5328
5375
  id;
5329
- declaration;
5376
+ project;
5377
+ declarationHandle;
5378
+ declarationCache;
5330
5379
  typeParameters;
5331
5380
  parameters;
5332
5381
  thisParameter;
@@ -5334,15 +5383,23 @@ export class Signature {
5334
5383
  returnType;
5335
5384
  constructor(data, project, objectRegistry) {
5336
5385
  this.id = data.id;
5337
- this.flags = data.flags;
5386
+ this.flags = data.flags ?? 0;
5338
5387
  this.objectRegistry = objectRegistry;
5339
- this.declaration = data.declaration ? new NodeHandle(data.declaration, project) : undefined;
5388
+ this.project = project;
5389
+ this.declarationHandle = data.declaration;
5390
+ this.declarationCache = undefined;
5340
5391
  this.typeParameters = data.typeParameters ?? [];
5341
5392
  this.parameters = data.parameters ?? [];
5342
5393
  this.thisParameter = data.thisParameter;
5343
5394
  this.target = data.target;
5344
5395
  this.returnType = false;
5345
5396
  }
5397
+ get declaration() {
5398
+ if (this.declarationCache === undefined && this.declarationHandle) {
5399
+ this.declarationCache = this.objectRegistry.createNodeHandle(this.declarationHandle);
5400
+ }
5401
+ return this.declarationCache;
5402
+ }
5346
5403
  get getTypeParameters() {
5347
5404
  const owner = this;
5348
5405
  return cacheGeneratorMethod(owner, "getTypeParameters", function () {