@prisma/orm-toolchain 8.0.0-rc.17-dev.41 → 8.0.0-rc.17-dev.42

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.
@@ -1,3 +1,3 @@
1
1
  import { w as errorFromCaught } from "./caught-errors-olsx_RBn-Cg0ilJtv.mjs";
2
- import { $ as refuseMissingInvariantPath, A as executeRefDeleteCommand, B as loadContractRawSafely, C as executeDbSign, D as executeMigrationNewCommand, E as executeMigrateShowPlan, F as hasMigrationPath, G as mapContractAtError, J as preflightRefAdvancement, K as mapIntegrityViolations, L as listRefsByContractHash, M as executeRefSetCommand, O as executeMigrationPlanCommand, Q as refuseMarkerOutsideGraph, S as executeDbInit, T as executeDbVerify, U as loadContractSpaceAggregateForCli, V as loadContractSource, X as refuseContractSpaceIntegrity, Y as readMigrationRefs, Z as refuseDeclaredExtensionTargetMismatch, _ as deriveStatusEdgeAnnotations, at as resolveContractRefToSnapshot, b as enumerateCheckSpaces, c as appliedHashesFromLedger, ct as resolveStatements, d as buildReadAggregate, dt as runContractSpaceSeedPhase, et as refusePackageCorruptionOnAggregate, f as buildRefAdvancementFields, ft as runMigrationCheck, g as createControlClient, gt as statusForMigrationHash, it as resolveContractRef$1, j as executeRefListCommand, k as executeRefAdvancement, l as buildContractSpaceAggregate, lt as resolveToForPlan, m as computeRefAdvancementName, o as advanceRefSafely, ot as resolveFromForPlan, p as checkSingleTarget, pt as runMigrationList, q as migrationSpaceListEntriesFromAggregate, r as NO_REF_ADVANCEMENT, s as appContractStandInFromIdentity, st as resolveMigrationRef, tt as refuseUnknownInvariants, u as buildMigrationSpaceGraphEntries, v as disposeEmitQueue, w as executeDbUpdate, x as executeContractEmit, y as enrichContract, z as loadAggregateIntegrityViolations } from "./ref-BMhPu-wB-DU1LW2lb.mjs";
2
+ import { $ as refuseMissingInvariantPath, A as executeRefDeleteCommand, B as loadContractRawSafely, C as executeDbSign, D as executeMigrationNewCommand, E as executeMigrateShowPlan, F as hasMigrationPath, G as mapContractAtError, J as preflightRefAdvancement, K as mapIntegrityViolations, L as listRefsByContractHash, M as executeRefSetCommand, O as executeMigrationPlanCommand, Q as refuseMarkerOutsideGraph, S as executeDbInit, T as executeDbVerify, U as loadContractSpaceAggregateForCli, V as loadContractSource, X as refuseContractSpaceIntegrity, Y as readMigrationRefs, Z as refuseDeclaredExtensionTargetMismatch, _ as deriveStatusEdgeAnnotations, at as resolveContractRefToSnapshot, b as enumerateCheckSpaces, c as appliedHashesFromLedger, ct as resolveStatements, d as buildReadAggregate, dt as runContractSpaceSeedPhase, et as refusePackageCorruptionOnAggregate, f as buildRefAdvancementFields, ft as runMigrationCheck, g as createControlClient, gt as statusForMigrationHash, it as resolveContractRef$1, j as executeRefListCommand, k as executeRefAdvancement, l as buildContractSpaceAggregate, lt as resolveToForPlan, m as computeRefAdvancementName, o as advanceRefSafely, ot as resolveFromForPlan, p as checkSingleTarget, pt as runMigrationList, q as migrationSpaceListEntriesFromAggregate, r as NO_REF_ADVANCEMENT, s as appContractStandInFromIdentity, st as resolveMigrationRef, tt as refuseUnknownInvariants, u as buildMigrationSpaceGraphEntries, v as disposeEmitQueue, w as executeDbUpdate, x as executeContractEmit, y as enrichContract, z as loadAggregateIntegrityViolations } from "./ref-D0TsCUZG-Cyf9-Rs6.mjs";
3
3
  export { NO_REF_ADVANCEMENT, advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, errorFromCaught, executeContractEmit, executeDbInit, executeDbSign, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSource, loadContractSpaceAggregateForCli, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, preflightRefAdvancement, readMigrationRefs, refuseContractSpaceIntegrity, refuseDeclaredExtensionTargetMismatch, refuseMarkerOutsideGraph, refuseMissingInvariantPath, refusePackageCorruptionOnAggregate, refuseUnknownInvariants, resolveContractRef$1 as resolveContractRef, resolveContractRefToSnapshot, resolveFromForPlan, resolveMigrationRef, resolveStatements, resolveToForPlan, runContractSpaceSeedPhase, runMigrationCheck, runMigrationList, statusForMigrationHash };
@@ -6,6 +6,7 @@ import { InternalError } from "@prisma/orm-framework/utils/internal-error";
6
6
  import { join } from "pathe";
7
7
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
8
  import { readFileSync, statSync } from "node:fs";
9
+ import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
9
10
  import { fileURLToPath, pathToFileURL } from "node:url";
10
11
  import { normalize as normalize$1 } from "node:path";
11
12
  import { format, resolveFormatOptions } from "@prisma/orm-framework/psl-parser/format";
@@ -303,6 +304,7 @@ function isThenable(value) {
303
304
  const CONFIG_FILENAME = "prisma.config.ts";
304
305
  const emptyLspControlStack = {
305
306
  scalarTypes: [],
307
+ defaultNamespaceId: UNBOUND_NAMESPACE_ID,
306
308
  pslBlockDescriptors: {}
307
309
  };
308
310
  async function resolveConfigInputs(configPath, readText) {
@@ -342,6 +344,7 @@ async function resolveConfigInputs(configPath, readText) {
342
344
  function lspControlStackFromStack(stack) {
343
345
  return {
344
346
  scalarTypes: [...stack.scalarTypes],
347
+ defaultNamespaceId: stack.target.defaultNamespaceId,
345
348
  pslBlockDescriptors: stack.authoringContributions.pslBlockDescriptors,
346
349
  authoringContributions: stack.authoringContributions,
347
350
  dataTypes: stack.dataTypes,
@@ -363,7 +366,8 @@ function resolveInterpretation(config, stack, inputs) {
363
366
  dataTypes: stack.dataTypes,
364
367
  controlMutationDefaults: stack.controlMutationDefaults,
365
368
  resolvedInputs: [...inputs.uris()],
366
- capabilities: stack.capabilities
369
+ capabilities: stack.capabilities,
370
+ defaultNamespaceId: stack.target.defaultNamespaceId
367
371
  }
368
372
  };
369
373
  }
@@ -2404,7 +2408,8 @@ var ProjectArtifacts = class {
2404
2408
  const currentDocuments = this.documents().map((snapshot) => snapshot.parse().document);
2405
2409
  this.#symbolTableResult ??= buildSymbolTable({
2406
2410
  documents: currentDocuments,
2407
- sources: this.sources
2411
+ sources: this.sources,
2412
+ defaultNamespaceId: this.#options.controlStack.defaultNamespaceId
2408
2413
  });
2409
2414
  return this.#symbolTableResult;
2410
2415
  }
@@ -2446,6 +2451,7 @@ function providePrepareRename(input) {
2446
2451
  const { sourceFile } = input;
2447
2452
  const token = identTokenAt(input.document.syntax, sourceFile.offsetAt(input.position));
2448
2453
  if (token === void 0) return null;
2454
+ if (renamedSymbol(input) === input.symbolTable.defaultNamespace) return null;
2449
2455
  if (provideReferences({
2450
2456
  ...input,
2451
2457
  includeDeclaration: true
@@ -2461,6 +2467,7 @@ function providePrepareRename(input) {
2461
2467
  function provideRename(input) {
2462
2468
  const { newName } = input;
2463
2469
  if (!isPslIdentifier(newName)) throw new ResponseError(LSPErrorCodes.RequestFailed, `"${newName}" is not a valid PSL identifier`);
2470
+ if (renamedSymbol(input) === input.symbolTable.defaultNamespace) return null;
2464
2471
  const locations = provideReferences({
2465
2472
  ...input,
2466
2473
  includeDeclaration: true
@@ -3088,7 +3095,8 @@ var Project = class {
3088
3095
  sourceFile: document.sourceFile,
3089
3096
  position,
3090
3097
  documents,
3091
- binder: data.artifacts.binder()
3098
+ binder: data.artifacts.binder(),
3099
+ symbolTable: data.artifacts.symbolTable()
3092
3100
  });
3093
3101
  } catch {
3094
3102
  return null;
@@ -3931,4 +3939,4 @@ function startServer(streams) {
3931
3939
  //#endregion
3932
3940
  export { startServer };
3933
3941
 
3934
- //# sourceMappingURL=exports-D-0yFZ8f.mjs.map
3942
+ //# sourceMappingURL=exports-cWMrCC0a.mjs.map