@prisma/orm-toolchain 0.17.0-dev.1 → 0.17.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin__prisma-next.mjs +21 -21
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli__commands__contract-emit.mjs +1 -1
- package/dist/cli__commands__contract-infer.mjs +1 -1
- package/dist/cli__commands__db-init.mjs +1 -1
- package/dist/cli__commands__db-schema.mjs +1 -1
- package/dist/cli__commands__db-sign.mjs +1 -1
- package/dist/cli__commands__db-update.mjs +1 -1
- package/dist/cli__commands__db-verify.mjs +1 -1
- package/dist/cli__commands__migrate.mjs +1 -1
- package/dist/cli__commands__migration-check.mjs +1 -1
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.mjs +1 -1
- package/dist/cli__commands__migration-log.mjs +1 -1
- package/dist/cli__commands__migration-new.mjs +1 -1
- package/dist/cli__commands__migration-plan.mjs +1 -1
- package/dist/cli__commands__migration-show.mjs +1 -1
- package/dist/cli__commands__migration-status.mjs +1 -1
- package/dist/cli__commands__ref.mjs +1 -1
- package/dist/cli__control-api.mjs +2 -2
- package/dist/cli__migration-cli.mjs +1 -1
- package/dist/{client-75qrAPqf-DZAVUxFa.mjs → client-75qrAPqf-7l0C0H_b.mjs} +2 -2
- package/dist/{client-75qrAPqf-DZAVUxFa.mjs.map → client-75qrAPqf-7l0C0H_b.mjs.map} +1 -1
- package/dist/config-loader.mjs +1 -1
- package/dist/{contract-emit-0hSjbuxp-BBOKldTZ.mjs → contract-emit-0hSjbuxp-BJLC-VgC.mjs} +4 -4
- package/dist/{contract-emit-0hSjbuxp-BBOKldTZ.mjs.map → contract-emit-0hSjbuxp-BJLC-VgC.mjs.map} +1 -1
- package/dist/{contract-emit-B6odMoem-CK3diBPk.mjs → contract-emit-B6odMoem-C87PBvmo.mjs} +3 -3
- package/dist/{contract-emit-B6odMoem-CK3diBPk.mjs.map → contract-emit-B6odMoem-C87PBvmo.mjs.map} +1 -1
- package/dist/{contract-infer-BnkqpftN-DVM2eKJ3.mjs → contract-infer-BnkqpftN-DwBzasOu.mjs} +2 -2
- package/dist/{contract-infer-BnkqpftN-DVM2eKJ3.mjs.map → contract-infer-BnkqpftN-DwBzasOu.mjs.map} +1 -1
- package/dist/{db-init-Vbkb_TKZ.mjs → db-init-bd0_x2Q8.mjs} +2 -2
- package/dist/{db-init-Vbkb_TKZ.mjs.map → db-init-bd0_x2Q8.mjs.map} +1 -1
- package/dist/{db-schema-ClQCu3xY.mjs → db-schema-CwgAWTqG.mjs} +2 -2
- package/dist/{db-schema-ClQCu3xY.mjs.map → db-schema-CwgAWTqG.mjs.map} +1 -1
- package/dist/{db-sign-jjXDgQ1u.mjs → db-sign-vqiYfpjI.mjs} +3 -3
- package/dist/{db-sign-jjXDgQ1u.mjs.map → db-sign-vqiYfpjI.mjs.map} +1 -1
- package/dist/{db-update-BQlrqtDD.mjs → db-update-Br0diOCo.mjs} +2 -2
- package/dist/{db-update-BQlrqtDD.mjs.map → db-update-Br0diOCo.mjs.map} +1 -1
- package/dist/{db-verify-CKPsRFrj-3udprZQD.mjs → db-verify-CKPsRFrj-T7nSt7yT.mjs} +3 -3
- package/dist/{db-verify-CKPsRFrj-3udprZQD.mjs.map → db-verify-CKPsRFrj-T7nSt7yT.mjs.map} +1 -1
- package/dist/{domain-type-generation-DAn9y5d2-BgoT5uKI.mjs → domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs} +16 -16
- package/dist/domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs.map +1 -0
- package/dist/emitter.d.mts +5 -2
- package/dist/emitter.d.mts.map +1 -1
- package/dist/emitter.mjs +2 -2
- package/dist/emitter__domain-type-generation.mjs +1 -1
- package/dist/{exports-D3-NwrMA-CadaBGQ3.mjs → exports-BCLg4CiV-okAfZydo.mjs} +12 -6
- package/dist/exports-BCLg4CiV-okAfZydo.mjs.map +1 -0
- package/dist/{exports-B_xhKZmC.mjs → exports-BnihzVhw.mjs} +2 -2
- package/dist/{exports-B_xhKZmC.mjs.map → exports-BnihzVhw.mjs.map} +1 -1
- package/dist/{exports-Dl2aGAk7.mjs → exports-CDX9kZuw.mjs} +2 -2
- package/dist/{exports-Dl2aGAk7.mjs.map → exports-CDX9kZuw.mjs.map} +1 -1
- package/dist/{format-ByDm2goZ-DKLyhNHo.mjs → format-ByDm2goZ-BIRlFoo6.mjs} +2 -2
- package/dist/{format-ByDm2goZ-DKLyhNHo.mjs.map → format-ByDm2goZ-BIRlFoo6.mjs.map} +1 -1
- package/dist/{init-DHctXAI9-DSlaaYXN.mjs → init-BGm77aWc-jHVUn63W.mjs} +69 -18
- package/dist/init-BGm77aWc-jHVUn63W.mjs.map +1 -0
- package/dist/{inspect-live-schema-CnwYTRZ0-BErPHMni.mjs → inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs} +3 -3
- package/dist/{inspect-live-schema-CnwYTRZ0-BErPHMni.mjs.map → inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs.map} +1 -1
- package/dist/{migrate-Cb_iv264.mjs → migrate-BdVFDKF2.mjs} +4 -4
- package/dist/{migrate-Cb_iv264.mjs.map → migrate-BdVFDKF2.mjs.map} +1 -1
- package/dist/{migration-check-CcG-fB8r-CDs5C9vt.mjs → migration-check-CcG-fB8r-qpu6xdbA.mjs} +2 -2
- package/dist/{migration-check-CcG-fB8r-CDs5C9vt.mjs.map → migration-check-CcG-fB8r-qpu6xdbA.mjs.map} +1 -1
- package/dist/{migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs → migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs} +3 -3
- package/dist/{migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs.map → migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs.map} +1 -1
- package/dist/{migration-graph-DkoCC0Qy.mjs → migration-graph-vmgkL3k4.mjs} +3 -3
- package/dist/{migration-graph-DkoCC0Qy.mjs.map → migration-graph-vmgkL3k4.mjs.map} +1 -1
- package/dist/{migration-list-BFBeo1_X-c0kqYokL.mjs → migration-list-BFBeo1_X-ckYMhETH.mjs} +2 -2
- package/dist/{migration-list-BFBeo1_X-c0kqYokL.mjs.map → migration-list-BFBeo1_X-ckYMhETH.mjs.map} +1 -1
- package/dist/{migration-log-CS5IWcNq-BQ-32Low.mjs → migration-log-CS5IWcNq-DI7FTHCA.mjs} +3 -3
- package/dist/{migration-log-CS5IWcNq-BQ-32Low.mjs.map → migration-log-CS5IWcNq-DI7FTHCA.mjs.map} +1 -1
- package/dist/{migration-new-BurCjyaQ.mjs → migration-new-GmW2anVb.mjs} +3 -3
- package/dist/{migration-new-BurCjyaQ.mjs.map → migration-new-GmW2anVb.mjs.map} +1 -1
- package/dist/{migration-plan-q_L84PN1-BWE0LTH6.mjs → migration-plan-q_L84PN1-ClkGgtVz.mjs} +3 -3
- package/dist/{migration-plan-q_L84PN1-BWE0LTH6.mjs.map → migration-plan-q_L84PN1-ClkGgtVz.mjs.map} +1 -1
- package/dist/{migration-show-Bx5I5aW9.mjs → migration-show--pW4XhKs.mjs} +3 -3
- package/dist/{migration-show-Bx5I5aW9.mjs.map → migration-show--pW4XhKs.mjs.map} +1 -1
- package/dist/{migration-status-CFlzlRmu-DewBN8Ys.mjs → migration-status-CFlzlRmu-QHUxHm_l.mjs} +4 -4
- package/dist/{migration-status-CFlzlRmu-DewBN8Ys.mjs.map → migration-status-CFlzlRmu-QHUxHm_l.mjs.map} +1 -1
- package/dist/{ref-B6cTthTi.mjs → ref-sHE8zOcm.mjs} +2 -2
- package/dist/{ref-B6cTthTi.mjs.map → ref-sHE8zOcm.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +3 -3
- package/package.json +12 -12
- package/dist/domain-type-generation-DAn9y5d2-BgoT5uKI.mjs.map +0 -1
- package/dist/exports-D3-NwrMA-CadaBGQ3.mjs.map +0 -1
- package/dist/init-DHctXAI9-DSlaaYXN.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports-B_xhKZmC.mjs","names":["#sourceFile","#rangeOffsets","#intersectsRange","#addMultilineSplitToken","#encode","#data","#first","#previousLine","#previousCharacter"],"sources":["../../../../1-framework/3-tooling/language-server/dist/exports/index.mjs"],"sourcesContent":["import { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { findNearestConfigPathForFile, loadConfig } from \"@internal/config-loader\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { format } from \"@internal/psl-parser/format\";\nimport { join } from \"pathe\";\nimport { CompletionItemKind, DiagnosticSeverity, DidChangeWatchedFilesNotification, DocumentDiagnosticReportKind, FoldingRangeKind, InsertTextFormat, RegistrationRequest, SemanticTokenModifiers, SemanticTokenTypes, TextDocumentSyncKind, TextDocuments } from \"vscode-languageserver\";\nimport { TextDocument } from \"vscode-languageserver-textdocument\";\nimport { ArrayLiteralAst, AttributeArgListAst, BooleanLiteralExprAst, CompositeTypeDeclarationAst, FieldAttributeAst, FieldDeclarationAst, FunctionCallAst, GenericBlockDeclarationAst, IdentifierAst, KeyValuePairAst, ModelAttributeAst, ModelDeclarationAst, NamespaceDeclarationAst, NumberLiteralExprAst, ObjectLiteralExprAst, StringLiteralExprAst, TypesBlockAst, any, filterChildren, findChildToken, parse, skipTriviaToken } from \"@internal/psl-parser/syntax\";\nimport { isAuthoringPslBlockDescriptor } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, findBlockDescriptor } from \"@internal/psl-parser\";\nimport { createControlStack } from \"@internal/framework-components/control\";\nimport { hasPslInterpreter } from \"@internal/psl-parser/interpret\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { ProposedFeatures, createConnection } from \"vscode-languageserver/node\";\n//#region src/diagnostic-mapping.ts\nconst ParseDiagnosticSeverity = {\n\tError: 1,\n\tWarning: 2,\n\tInformation: 3,\n\tHint: 4\n};\nfunction mapParseDiagnostics(diagnostics) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\trange: diagnostic.range,\n\t\tmessage: diagnostic.message,\n\t\tcode: diagnostic.code,\n\t\tseverity: ParseDiagnosticSeverity.Error\n\t}));\n}\nconst documentStartRange = {\n\tstart: {\n\t\tline: 0,\n\t\tcharacter: 0\n\t},\n\tend: {\n\t\tline: 0,\n\t\tcharacter: 1\n\t}\n};\nfunction mapInterpreterDiagnostics(diagnostics, sourceFile) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\trange: diagnostic.span === void 0 ? documentStartRange : pslSpanToRange(diagnostic.span, sourceFile),\n\t\tmessage: diagnostic.message,\n\t\tcode: diagnostic.code,\n\t\tseverity: ParseDiagnosticSeverity.Error\n\t}));\n}\nfunction pslSpanToRange(span, sourceFile) {\n\treturn {\n\t\tstart: sourceFile.positionAt(span.start.offset),\n\t\tend: sourceFile.positionAt(span.end.offset)\n\t};\n}\n//#endregion\n//#region src/completion-context.ts\nconst UNSUPPORTED = { kind: \"unsupported\" };\nfunction classifyPslCompletionContext(input) {\n\tconst root = input.document.syntax;\n\tconst offset = input.sourceFile.offsetAt(input.position);\n\tconst at = root.tokenAtOffset(offset);\n\tif (at.leftBiased()?.kind === \"Comment\") return UNSUPPORTED;\n\tconst edit = cursorIdentifier(at, offset);\n\tconst preceding = precedingToken(at, edit);\n\tconst precedingNode = preceding?.parent;\n\tconst replacementStartOffset = edit?.offset ?? offset;\n\tconst declarationKeywordContext = classifyDeclarationKeyword({\n\t\tnode: precedingNode,\n\t\toffset,\n\t\treplacementStartOffset\n\t});\n\tif (declarationKeywordContext !== void 0) return declarationKeywordContext;\n\tconst genericBlockContext = classifyGenericBlockParameter({\n\t\toffset,\n\t\tat,\n\t\tprecedingToken: preceding,\n\t\treplacementStartOffset\n\t});\n\tif (genericBlockContext !== void 0) return genericBlockContext;\n\tconst field = fieldForTypeSlot(precedingNode);\n\tif (field === void 0) return UNSUPPORTED;\n\tif (field.syntax.findAncestor(any(ModelDeclarationAst.cast, CompositeTypeDeclarationAst.cast)) === void 0) return UNSUPPORTED;\n\treturn classifyModelFieldType({\n\t\tfield,\n\t\toffset,\n\t\treplacementStartOffset,\n\t\tprecedingToken: preceding\n\t});\n}\n/**\n* Locates the field whose type position the cursor occupies. The preceding token\n* climbs to the field whether the cursor sits inside a present type (the type\n* identifier's predecessor still belongs to the field) or in the empty type slot\n* of a typeless field (whose trailing trivia lives in the enclosing block, so\n* the nearest significant token to the left is the field's own name).\n*/\nfunction fieldForTypeSlot(precedingNode) {\n\treturn precedingNode?.findAncestor(FieldDeclarationAst.cast);\n}\nfunction classifyModelFieldType(input) {\n\tconst fieldName = input.field.name();\n\tif (fieldName === void 0) return UNSUPPORTED;\n\tconst fieldNameText = fieldName.name();\n\tif (fieldNameText === void 0) return UNSUPPORTED;\n\tif (fieldName.syntax.isInside(input.offset)) return UNSUPPORTED;\n\tconst typeAnnotation = input.field.typeAnnotation();\n\tif (typeAnnotation === void 0) {\n\t\tif (input.precedingToken !== void 0 && fieldName.syntax.isInside(input.precedingToken.offset)) return {\n\t\t\tkind: \"modelType\",\n\t\t\toffset: input.offset,\n\t\t\tfieldName: fieldNameText,\n\t\t\treplacementStartOffset: input.offset\n\t\t};\n\t\treturn UNSUPPORTED;\n\t}\n\tif (typeAnnotation.syntax.isOutside(input.offset)) return UNSUPPORTED;\n\tif (typeAnnotation.argList()?.syntax.isInside(input.offset)) return UNSUPPORTED;\n\tconst name = typeAnnotation.name();\n\tif (name === void 0) return UNSUPPORTED;\n\tif (name.syntax.isOutside(input.offset)) return UNSUPPORTED;\n\tif (name.isOverQualified()) return UNSUPPORTED;\n\treturn classifyTypePosition(name, input.offset, fieldNameText, input.replacementStartOffset);\n}\n/**\n* Builds the type-completion context for a qualified name. Roles are read\n* straight off the separator-positional accessors: a populated namespace\n* segment is a `.`-qualified name, a populated space segment is a `:`-qualified\n* name, and the absence of both is a bare model type.\n*\n* Behaviour change: a `:`-qualified name with no `.` (e.g. `supabase:`,\n* `supabase:U`) is a `spaceMember` position rather than falling through to bare\n* model-type completions. A malformed leading-separator name (`:User`, `.User`)\n* carries no populated segment and resolves to `modelType` rather than\n* `unsupported`.\n*/\nfunction classifyTypePosition(name, offset, fieldName, replacementStartOffset) {\n\tconst namespace = name.namespace()?.name();\n\tif (namespace !== void 0 && namespace.length > 0) {\n\t\tconst namespaceSpace = name.space()?.name();\n\t\treturn {\n\t\t\tkind: \"namespaceMember\",\n\t\t\toffset,\n\t\t\tfieldName,\n\t\t\treplacementStartOffset,\n\t\t\tnamespace,\n\t\t\t...namespaceSpace !== void 0 && namespaceSpace.length > 0 ? { space: namespaceSpace } : {}\n\t\t};\n\t}\n\tconst space = name.space()?.name();\n\tif (space !== void 0 && space.length > 0) return {\n\t\tkind: \"spaceMember\",\n\t\toffset,\n\t\tfieldName,\n\t\treplacementStartOffset,\n\t\tspace\n\t};\n\treturn {\n\t\tkind: \"modelType\",\n\t\toffset,\n\t\tfieldName,\n\t\treplacementStartOffset\n\t};\n}\nconst declarationCast = any(ModelDeclarationAst.cast, CompositeTypeDeclarationAst.cast, TypesBlockAst.cast, GenericBlockDeclarationAst.cast, NamespaceDeclarationAst.cast);\nfunction classifyDeclarationKeyword(input) {\n\tconst precedingDeclaration = input.node?.findAncestor(declarationCast);\n\tconst namespace = input.node?.findAncestor(NamespaceDeclarationAst.cast);\n\tconst inNamespaceBody = blockBodyContainsOffset(namespace, input.offset);\n\tif (precedingDeclaration !== void 0 && !canCompleteDeclaration(precedingDeclaration, input.offset, inNamespaceBody)) return;\n\treturn {\n\t\tkind: \"declarationKeyword\",\n\t\toffset: input.offset,\n\t\tscope: inNamespaceBody ? \"namespace\" : \"document\",\n\t\treplacementStartOffset: input.replacementStartOffset\n\t};\n}\n/**\n* Whether a new declaration can begin at the cursor, given the nearest enclosing\n* declaration. Allowed when that declaration is still nascent (only its keyword\n* typed, no name or body yet), when it is a namespace whose body holds further\n* declarations, or when the cursor sits past its closing `}`.\n*/\nfunction canCompleteDeclaration(precedingDeclaration, offset, inNamespaceBody) {\n\tif (precedingDeclaration.lbrace() === void 0 && (precedingDeclaration instanceof TypesBlockAst || precedingDeclaration.name() === void 0)) return true;\n\tif (precedingDeclaration instanceof NamespaceDeclarationAst && inNamespaceBody) return true;\n\tconst rbrace = precedingDeclaration.rbrace();\n\treturn rbrace !== void 0 && offset >= rbrace.endOffset;\n}\nfunction blockBodyContainsOffset(block, offset) {\n\tif (block === void 0) return false;\n\tconst lbrace = block.lbrace();\n\tif (lbrace === void 0) return false;\n\tconst bodyStart = lbrace.endOffset;\n\tconst bodyEnd = block.rbrace()?.offset ?? block.syntax.endOffset;\n\treturn offset >= bodyStart && offset <= bodyEnd;\n}\nfunction classifyGenericBlockParameter(input) {\n\tconst node = input.at.leftBiased()?.parent;\n\tconst block = node?.findAncestor(GenericBlockDeclarationAst.cast);\n\tif (block === void 0) return;\n\tif (hasUnsupportedAncestor(node)) return UNSUPPORTED;\n\tif (!blockBodyContainsOffset(block, input.offset)) return UNSUPPORTED;\n\tif ((node?.findAncestor(FieldDeclarationAst.cast))?.syntax.isInside(input.offset)) return UNSUPPORTED;\n\tconst keyword = block.keyword()?.text;\n\tif (keyword === void 0 || keyword.length === 0) return UNSUPPORTED;\n\tif (input.precedingToken?.kind === \"Equals\") return {\n\t\tkind: \"genericBlockValue\",\n\t\toffset: input.offset,\n\t\tblockKeyword: keyword,\n\t\treplacementStartOffset: input.replacementStartOffset\n\t};\n\tconst activePair = activeKeyValuePair(node, input.offset);\n\tif (activePair !== void 0 && isAfterEquals(activePair, input.offset)) return UNSUPPORTED;\n\treturn {\n\t\tkind: \"genericBlockKey\",\n\t\toffset: input.offset,\n\t\tblockKeyword: keyword,\n\t\treplacementStartOffset: input.replacementStartOffset,\n\t\tblock\n\t};\n}\nfunction activeKeyValuePair(node, offset) {\n\tconst pair = node?.findAncestor(KeyValuePairAst.cast);\n\tif (pair === void 0 || pair.syntax.isOutside(offset)) return;\n\treturn pair;\n}\nfunction isAfterEquals(pair, offset) {\n\tconst equals = pair.equals();\n\treturn equals !== void 0 && offset > equals.offset;\n}\nfunction hasUnsupportedAncestor(node) {\n\treturn node?.findAncestor(any(AttributeArgListAst.cast, FieldAttributeAst.cast, ModelAttributeAst.cast)) !== void 0;\n}\n/** The significant token preceding the cursor — the in-progress edit identifier\n* is skipped, so the result is the token the classifier anchors on. */\nfunction precedingToken(at, edit) {\n\tconst start = edit !== void 0 ? edit.prevToken : at.leftBiased();\n\treturn start === void 0 ? void 0 : skipTriviaToken(start, \"prev\");\n}\n/** The identifier token the cursor is editing, if any. */\nfunction cursorIdentifier(at, offset) {\n\tconst right = at.rightBiased();\n\tif (right?.kind === \"Ident\" && offset < right.endOffset) return right;\n\tconst left = at.leftBiased();\n\tif (left?.kind === \"Ident\" && left.endOffset === offset) return left;\n}\n//#endregion\n//#region src/named-type-classification.ts\n/**\n* Presentation-level classification of a `types {}` binding: a\n* non-constructor binding whose base is a configured scalar type refines that\n* scalar (rendered as a default-library type); everything else reads as a\n* plain alias. The authoritative scalar-or-not pronouncement lives in the\n* interpreter's named-type resolution — this mirrors it for display only.\n*/\nfunction refinesScalarType(symbol, scalarTypes) {\n\treturn !symbol.isConstructor && symbol.baseType !== void 0 && scalarTypes.includes(symbol.baseType);\n}\n//#endregion\n//#region src/completion-provider.ts\nconst categoryOrder = {\n\tconfiguredScalar: 0,\n\ttopLevelModel: 1,\n\ttopLevelCompositeType: 2,\n\tscalar: 3,\n\ttypeAlias: 4,\n\tnamespace: 5,\n\tnamespaceModel: 6,\n\tnamespaceCompositeType: 7\n};\nconst declarationKeywordCategoryOrder = {\n\tnative: 0,\n\tgenericBlock: 1\n};\nconst nameSnippetPlaceholder = \"${1:Name}\";\nconst documentNativeDeclarationKeywords = [\n\tnativeDeclarationKeyword(\"model\", \"model \", `model ${nameSnippetPlaceholder} {\\n $0\\n}`),\n\tnativeDeclarationKeyword(\"type\", \"type \", `type ${nameSnippetPlaceholder} {\\n $0\\n}`),\n\tnativeDeclarationKeyword(\"types\", \"types \", \"types {\\n $0\\n}\"),\n\tnativeDeclarationKeyword(\"namespace\", \"namespace \", `namespace \\${1:name} {\\n $0\\n}`)\n];\nconst namespaceNativeDeclarationKeywords = [nativeDeclarationKeyword(\"model\", \"model \", `model ${nameSnippetPlaceholder} {\\n $0\\n}`), nativeDeclarationKeyword(\"type\", \"type \", `type ${nameSnippetPlaceholder} {\\n $0\\n}`)];\nfunction providePslCompletionItems(input) {\n\tconst { context } = input;\n\tswitch (context.kind) {\n\t\tcase \"unsupported\": return [];\n\t\tcase \"spaceMember\": return [];\n\t\tcase \"genericBlockValue\": return [];\n\t\tcase \"declarationKeyword\": return provideDeclarationKeywordCompletionItems(context, input.sourceFile, input.candidates, input.clientSupportsSnippets);\n\t\tcase \"genericBlockKey\": return provideGenericBlockKeyCompletionItems(context, input.sourceFile, input.candidates);\n\t\tcase \"modelType\": return provideModelTypeCompletionItems(context, input.sourceFile, input.candidates);\n\t\tcase \"namespaceMember\": return provideNamespaceMemberCompletionItems(context, input.sourceFile, input.candidates);\n\t}\n}\nfunction provideDeclarationKeywordCompletionItems(context, sourceFile, source, clientSupportsSnippets) {\n\tconst replacementRange = {\n\t\tstart: sourceFile.positionAt(context.replacementStartOffset),\n\t\tend: sourceFile.positionAt(context.offset)\n\t};\n\treturn declarationKeywordCandidates(context.scope, source).map((candidate) => ({\n\t\tlabel: candidate.label,\n\t\tkind: candidate.kind,\n\t\tdetail: candidate.detail,\n\t\tsortText: declarationKeywordSortText(candidate),\n\t\tfilterText: candidate.label,\n\t\t...clientSupportsSnippets ? { insertTextFormat: InsertTextFormat.Snippet } : {},\n\t\ttextEdit: {\n\t\t\trange: replacementRange,\n\t\t\tnewText: clientSupportsSnippets ? candidate.snippetText : candidate.insertText\n\t\t}\n\t}));\n}\nfunction declarationKeywordCandidates(scope, source) {\n\treturn [...scope === \"namespace\" ? namespaceNativeDeclarationKeywords : documentNativeDeclarationKeywords, ...genericBlockDeclarationKeywordCandidates(source.pslBlockDescriptors)];\n}\nfunction nativeDeclarationKeyword(label, insertText, snippetText) {\n\treturn {\n\t\tcategory: \"native\",\n\t\tlabel,\n\t\tinsertText,\n\t\tsnippetText,\n\t\tdetail: \"PSL declaration keyword\",\n\t\tkind: CompletionItemKind.Keyword\n\t};\n}\nfunction genericBlockDeclarationKeywordCandidates(descriptors) {\n\treturn descriptorBlockKeywords(descriptors).map((keyword) => ({\n\t\tcategory: \"genericBlock\",\n\t\tlabel: keyword,\n\t\tinsertText: `${keyword} `,\n\t\tsnippetText: `${keyword} ${nameSnippetPlaceholder} {\\n $0\\n}`,\n\t\tdetail: \"Generic block keyword\",\n\t\tkind: CompletionItemKind.Keyword\n\t}));\n}\nfunction descriptorBlockKeywords(descriptors) {\n\tconst keywords = [];\n\tcollectDescriptorBlockKeywords(descriptors, keywords);\n\treturn sortedUnique(keywords);\n}\nfunction collectDescriptorBlockKeywords(descriptors, keywords) {\n\tfor (const value of Object.values(descriptors)) {\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tkeywords.push(value.keyword);\n\t\t\tcontinue;\n\t\t}\n\t\tcollectDescriptorBlockKeywords(value, keywords);\n\t}\n}\nfunction declarationKeywordSortText(candidate) {\n\treturn `${declarationKeywordCategoryOrder[candidate.category]}:${candidate.label}`;\n}\nfunction provideGenericBlockKeyCompletionItems(context, sourceFile, source) {\n\tconst descriptor = findBlockDescriptor(source.pslBlockDescriptors, context.blockKeyword);\n\tif (descriptor === void 0) return [];\n\tconst existing = existingGenericBlockParameterNames(context.block, context.offset);\n\tconst replacementRange = {\n\t\tstart: sourceFile.positionAt(context.replacementStartOffset),\n\t\tend: sourceFile.positionAt(context.offset)\n\t};\n\treturn Object.keys(descriptor.parameters).filter((parameterName) => !existing.has(parameterName)).map((parameterName, index) => ({\n\t\tlabel: parameterName,\n\t\tkind: CompletionItemKind.Property,\n\t\tdetail: \"Generic block parameter\",\n\t\tsortText: genericBlockParameterSortText(index, parameterName),\n\t\tfilterText: parameterName,\n\t\ttextEdit: {\n\t\t\trange: replacementRange,\n\t\t\tnewText: parameterName\n\t\t}\n\t}));\n}\nfunction existingGenericBlockParameterNames(block, cursorOffset) {\n\tconst names = /* @__PURE__ */ new Set();\n\tfor (const entry of block.entries()) {\n\t\tif (!entry.syntax.isOutside(cursorOffset)) continue;\n\t\tconst name = entry.key()?.name();\n\t\tif (name !== void 0) names.add(name);\n\t}\n\treturn names;\n}\nfunction provideModelTypeCompletionItems(context, sourceFile, source) {\n\treturn modelTypeCompletionItems(context, sourceFile, [\n\t\t...configuredScalarCandidates(source.scalarTypes),\n\t\t...topLevelSymbolCandidates(source.symbolTable, source.scalarTypes),\n\t\t...allNamespaceCandidates(source.symbolTable)\n\t]);\n}\nfunction provideNamespaceMemberCompletionItems(context, sourceFile, source) {\n\tif (context.space !== void 0) return [];\n\treturn modelTypeCompletionItems(context, sourceFile, namespaceCandidates(source.symbolTable.topLevel.namespaces[context.namespace]));\n}\nfunction modelTypeCompletionItems(context, sourceFile, candidates) {\n\tconst replacementRange = {\n\t\tstart: sourceFile.positionAt(context.replacementStartOffset),\n\t\tend: sourceFile.positionAt(context.offset)\n\t};\n\treturn candidates.map((candidate) => ({\n\t\tlabel: candidate.label,\n\t\tkind: candidate.kind,\n\t\tdetail: candidate.detail,\n\t\tsortText: sortText(candidate),\n\t\tfilterText: candidate.filterText,\n\t\ttextEdit: {\n\t\t\trange: replacementRange,\n\t\t\tnewText: candidate.insertText\n\t\t}\n\t}));\n}\nfunction configuredScalarCandidates(scalarTypes) {\n\treturn sortedUnique(scalarTypes).map((name) => ({\n\t\tcategory: \"configuredScalar\",\n\t\tlabel: name,\n\t\tinsertText: name,\n\t\tfilterText: name,\n\t\tdetail: \"Configured scalar type\",\n\t\tkind: CompletionItemKind.Keyword\n\t}));\n}\nfunction topLevelSymbolCandidates(symbolTable, scalarTypes) {\n\tconst { topLevel } = symbolTable;\n\tconst namedTypes = Object.values(topLevel.namedTypes);\n\tconst scalarRefinementNames = namedTypes.filter((symbol) => refinesScalarType(symbol, scalarTypes)).map((symbol) => symbol.name).sort(compareNames);\n\tconst aliasNames = namedTypes.filter((symbol) => !refinesScalarType(symbol, scalarTypes)).map((symbol) => symbol.name).sort(compareNames);\n\treturn [\n\t\t...symbolCandidates(recordNames(topLevel.models), \"topLevelModel\", \"Model\", CompletionItemKind.Class),\n\t\t...symbolCandidates(recordNames(topLevel.compositeTypes), \"topLevelCompositeType\", \"Composite type\", CompletionItemKind.Struct),\n\t\t...symbolCandidates(scalarRefinementNames, \"scalar\", \"Scalar type\", CompletionItemKind.Unit),\n\t\t...symbolCandidates(aliasNames, \"typeAlias\", \"Type alias\", CompletionItemKind.Reference)\n\t];\n}\nfunction allNamespaceCandidates(symbolTable) {\n\treturn Object.values(symbolTable.topLevel.namespaces).sort((left, right) => compareNames(left.name, right.name)).map(namespaceQualifierCandidate);\n}\nfunction namespaceCandidates(namespace) {\n\tif (namespace === void 0) return [];\n\treturn [...symbolCandidates(recordNames(namespace.models), \"namespaceModel\", `Model in namespace ${namespace.name}`, CompletionItemKind.Class), ...symbolCandidates(recordNames(namespace.compositeTypes), \"namespaceCompositeType\", `Composite type in namespace ${namespace.name}`, CompletionItemKind.Struct)];\n}\nfunction namespaceQualifierCandidate(namespace) {\n\treturn {\n\t\tcategory: \"namespace\",\n\t\tlabel: namespace.name,\n\t\tinsertText: namespace.name,\n\t\tfilterText: namespace.name,\n\t\tdetail: \"Namespace\",\n\t\tkind: CompletionItemKind.Module\n\t};\n}\nfunction symbolCandidates(names, category, detail, kind) {\n\treturn names.map((name) => ({\n\t\tcategory,\n\t\tlabel: name,\n\t\tinsertText: name,\n\t\tfilterText: name,\n\t\tdetail,\n\t\tkind\n\t}));\n}\nfunction recordNames(record) {\n\treturn Object.values(record).map((symbol) => symbol.name).sort(compareNames);\n}\nfunction sortedUnique(names) {\n\treturn [...new Set(names)].sort(compareNames);\n}\nfunction sortText(candidate) {\n\treturn `${categoryOrder[candidate.category]}:${candidate.label}`;\n}\nfunction genericBlockParameterSortText(index, label) {\n\treturn `${index.toString().padStart(4, \"0\")}:${label}`;\n}\nfunction compareNames(left, right) {\n\tif (left < right) return -1;\n\tif (left > right) return 1;\n\treturn 0;\n}\n//#endregion\n//#region src/schema-inputs.ts\nfunction hasPslInputs(config) {\n\tconst source = config.contract?.source;\n\treturn source?.format === \"psl\" && source.inputs !== void 0;\n}\nfunction resolveSchemaInputs(config) {\n\tconst inputs = hasPslInputs(config) ? config.contract?.source.inputs : void 0;\n\tconst uris = new Set(inputs?.map((input) => pathToFileURL(input).toString()));\n\treturn {\n\t\tincludes: (uri) => uris.has(uri),\n\t\turis: () => uris\n\t};\n}\n//#endregion\n//#region src/config-resolution.ts\nconst CONFIG_FILENAME = \"prisma-next.config.ts\";\nconst emptyPipelineInputs = {\n\tscalarTypes: [],\n\tpslBlockDescriptors: {}\n};\nasync function resolveConfigInputs(configPath) {\n\tconst config = await loadConfig(configPath);\n\tconst inputs = resolveSchemaInputs(config);\n\tif (!hasPslInputs(config)) return {\n\t\tinputs,\n\t\tcontrolStack: emptyPipelineInputs,\n\t\t...config.formatter === void 0 ? {} : { formatter: config.formatter }\n\t};\n\tconst stack = createControlStack(config);\n\tconst interpretation = resolveInterpretation(config, stack, inputs);\n\treturn {\n\t\tinputs,\n\t\tcontrolStack: pipelineInputsFromStack(stack),\n\t\t...config.formatter === void 0 ? {} : { formatter: config.formatter },\n\t\t...interpretation === void 0 ? {} : { interpretation }\n\t};\n}\nfunction pipelineInputsFromStack(stack) {\n\treturn {\n\t\tscalarTypes: [...stack.scalarTypes],\n\t\tpslBlockDescriptors: stack.authoringContributions.pslBlockDescriptors\n\t};\n}\nfunction resolveInterpretation(config, stack, inputs) {\n\tconst source = config.contract?.source;\n\tif (source === void 0 || !hasPslInterpreter(source)) return;\n\treturn {\n\t\tsource,\n\t\tcontext: {\n\t\t\tcomposedExtensions: stack.extensions.map((p) => p.id),\n\t\t\tcomposedExtensionContracts: stack.extensionContracts,\n\t\t\tauthoringContributions: stack.authoringContributions,\n\t\t\tcodecLookup: stack.codecLookup,\n\t\t\tcontrolMutationDefaults: stack.controlMutationDefaults,\n\t\t\tresolvedInputs: [...inputs.uris()],\n\t\t\tcapabilities: stack.capabilities\n\t\t}\n\t};\n}\n//#endregion\n//#region src/folding-ranges.ts\n/**\n* Computes folding ranges for block declarations in a PSL document.\n*\n* Block types that produce folding ranges:\n* - model (e.g., `model User { ... }`)\n* - composite type (e.g., `type Address { ... }`)\n* - namespace (e.g., `namespace billing { ... }`)\n* - generic blocks (generator, datasource, extension blocks)\n* - types block (e.g., `types { ... }`)\n*\n* The range spans from the line containing `{` to the line containing `}`.\n*/\nfunction computeFoldingRanges(document, sourceFile) {\n\tconst ranges = [];\n\tcollectFoldingRanges(document, sourceFile, ranges);\n\treturn ranges;\n}\nfunction collectFoldingRanges(document, sourceFile, ranges) {\n\tfor (const declaration of document.declarations()) {\n\t\taddFoldingRange(declaration, sourceFile, ranges);\n\t\tconst namespace = NamespaceDeclarationAst.cast(declaration.syntax);\n\t\tif (namespace !== void 0) for (const nested of namespace.declarations()) addFoldingRange(nested, sourceFile, ranges);\n\t}\n}\nfunction addFoldingRange(declaration, sourceFile, ranges) {\n\tconst lbrace = declaration.lbrace();\n\tconst rbrace = declaration.rbrace();\n\tif (lbrace === void 0 || rbrace === void 0) return;\n\tconst startLine = sourceFile.positionAt(lbrace.offset).line;\n\tconst endLine = sourceFile.positionAt(rbrace.offset).line;\n\tranges.push({\n\t\tstartLine,\n\t\tendLine,\n\t\tkind: FoldingRangeKind.Region\n\t});\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* Composes the stages exactly as the contract-psl provider does, so the editor\n* and the build agree: `parse` then `buildSymbolTable`, parse diagnostics ahead\n* of symbol-table diagnostics. Never throws on malformed input — `parse`\n* recovers and `buildSymbolTable` is documented not to throw.\n*/\nfunction runPipeline(text, inputs) {\n\tconst { document, sourceFile, diagnostics: parseDiagnostics } = parse(text);\n\tconst { table: symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\tdocument,\n\t\tsourceFile,\n\t\tpslBlockDescriptors: inputs.pslBlockDescriptors\n\t});\n\treturn {\n\t\tdocument,\n\t\tsourceFile,\n\t\tsymbolTable,\n\t\tdiagnostics: mapParseDiagnostics([...parseDiagnostics, ...symbolTableDiagnostics])\n\t};\n}\n//#endregion\n//#region src/document-diagnostics.ts\n/**\n* `null` (not a configured input) is distinct from a `DocumentDiagnostics` whose\n* `diagnostics` are `[]` (an input that parsed clean): the caller treats both as\n* \"publish no diagnostics\", but only the latter is a document we own and keep\n* diagnosing.\n*/\nfunction computeDocumentDiagnostics(uri, text, inputs, controlStack) {\n\tif (!inputs.includes(uri)) return null;\n\tconst { document, sourceFile, symbolTable, diagnostics } = runPipeline(text, controlStack);\n\treturn {\n\t\tdiagnostics,\n\t\tdocument,\n\t\tsourceFile,\n\t\tsymbolTable\n\t};\n}\n//#endregion\n//#region src/project-artifacts.ts\nfunction createProjectArtifacts(options) {\n\tconst { inputs, controlStack, getText, interpretation } = options;\n\tconst documents = /* @__PURE__ */ new Map();\n\tlet symbolTable;\n\tfunction createInterpretSlot(uri, computed) {\n\t\tif (interpretation === void 0) return () => [];\n\t\tlet memo;\n\t\treturn () => {\n\t\t\tif (memo === void 0) {\n\t\t\t\tconst result = interpretation.source.interpret({\n\t\t\t\t\tdocument: computed.document,\n\t\t\t\t\tsourceFile: computed.sourceFile,\n\t\t\t\t\tsymbolTable: computed.symbolTable,\n\t\t\t\t\tsourceId: uri\n\t\t\t\t}, interpretation.context);\n\t\t\t\tmemo = mapInterpreterDiagnostics(result.ok ? [] : result.failure.diagnostics, computed.sourceFile);\n\t\t\t}\n\t\t\treturn memo;\n\t\t};\n\t}\n\tfunction drop(uri) {\n\t\tif (documents.delete(uri)) symbolTable = void 0;\n\t}\n\tfunction readDocument(uri) {\n\t\tconst existing = documents.get(uri);\n\t\tif (existing !== void 0) return existing;\n\t\tconst text = getText(uri);\n\t\tif (text === void 0) return;\n\t\tconst computed = computeDocumentDiagnostics(uri, text, inputs, controlStack);\n\t\tif (computed === null) return;\n\t\tconst artifacts = {\n\t\t\tdocument: computed.document,\n\t\t\tsourceFile: computed.sourceFile,\n\t\t\tdiagnostics: computed.diagnostics,\n\t\t\tinterpretDiagnostics: createInterpretSlot(uri, computed)\n\t\t};\n\t\tdocuments.set(uri, artifacts);\n\t\tsymbolTable = computed.symbolTable;\n\t\treturn artifacts;\n\t}\n\treturn {\n\t\tdocument: readDocument,\n\t\tsymbolTable: () => {\n\t\t\tif (symbolTable !== void 0) return symbolTable;\n\t\t\tfor (const uri of inputs.uris()) {\n\t\t\t\tconst artifacts = readDocument(uri);\n\t\t\t\tif (artifacts === void 0) continue;\n\t\t\t\tsymbolTable ??= buildSymbolTable({\n\t\t\t\t\tdocument: artifacts.document,\n\t\t\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\t\t\tpslBlockDescriptors: controlStack.pslBlockDescriptors\n\t\t\t\t}).table;\n\t\t\t\treturn symbolTable;\n\t\t\t}\n\t\t\tthrow new InternalError(\"invariant violated: project has no open configured input — the server must drop such projects\");\n\t\t},\n\t\tdocumentChanged: drop,\n\t\tdocumentClosed: drop\n\t};\n}\n//#endregion\n//#region src/semantic-tokens.ts\nconst semanticTokenTypes = [\n\tSemanticTokenTypes.keyword,\n\tSemanticTokenTypes.namespace,\n\tSemanticTokenTypes.class,\n\tSemanticTokenTypes.struct,\n\tSemanticTokenTypes.type,\n\tSemanticTokenTypes.property,\n\tSemanticTokenTypes.decorator,\n\tSemanticTokenTypes.string,\n\tSemanticTokenTypes.number,\n\tSemanticTokenTypes.comment\n];\nconst semanticTokenModifiers = [SemanticTokenModifiers.declaration, SemanticTokenModifiers.defaultLibrary];\nconst semanticTokenModifierIndexes = {\n\tdeclaration: 0,\n\tdefaultLibrary: 1\n};\nconst semanticTokenModifierBits = {\n\tdeclaration: 1 << semanticTokenModifierIndexes.declaration,\n\tdefaultLibrary: 1 << semanticTokenModifierIndexes.defaultLibrary\n};\nconst semanticTokensLegend = {\n\ttokenTypes: [...semanticTokenTypes],\n\ttokenModifiers: [...semanticTokenModifiers]\n};\nfunction buildSemanticTokens(source, range) {\n\tconst builder = new SemanticTokensBuilder(source.sourceFile, range);\n\tfor (const token of collectSemanticTokenEvents(source)) builder.add(token);\n\treturn builder.build();\n}\nfunction collectSemanticTokenEvents(source) {\n\tconst comments = collectCommentTokens(source.document);\n\tconst tokens = [];\n\tcollectDeclarations(source, tokens);\n\treturn mergeSourceOrderedTokens(comments, tokens);\n}\nvar SemanticTokensBuilder = class {\n\t#data = [];\n\t#sourceFile;\n\t#rangeOffsets;\n\t#previousLine = 0;\n\t#previousCharacter = 0;\n\t#first = true;\n\tconstructor(sourceFile, range) {\n\t\tthis.#sourceFile = sourceFile;\n\t\tif (range !== void 0) {\n\t\t\tconst startOffset = sourceFile.offsetAt(range.start);\n\t\t\tconst endOffset = sourceFile.offsetAt(range.end);\n\t\t\tthis.#rangeOffsets = {\n\t\t\t\tlower: Math.min(startOffset, endOffset),\n\t\t\t\tupper: Math.max(startOffset, endOffset)\n\t\t\t};\n\t\t}\n\t}\n\tadd(token) {\n\t\tif (!this.#intersectsRange(token.startOffset, token.endOffset)) return;\n\t\tif (token.splitMultiline) {\n\t\t\tthis.#addMultilineSplitToken(token);\n\t\t\treturn;\n\t\t}\n\t\tthis.#encode(token.startOffset, token.endOffset, token.tokenTypeIndex, token.modifierBitset);\n\t}\n\tbuild() {\n\t\treturn { data: this.#data };\n\t}\n\t#intersectsRange(startOffset, endOffset) {\n\t\tconst rangeOffsets = this.#rangeOffsets;\n\t\treturn rangeOffsets === void 0 || startOffset < rangeOffsets.upper && endOffset > rangeOffsets.lower;\n\t}\n\t#addMultilineSplitToken(token) {\n\t\tconst start = this.#sourceFile.positionAt(token.startOffset);\n\t\tconst end = this.#sourceFile.positionAt(token.endOffset);\n\t\tif (start.line === end.line) {\n\t\t\tthis.#encode(token.startOffset, token.endOffset, token.tokenTypeIndex, token.modifierBitset);\n\t\t\treturn;\n\t\t}\n\t\tfor (let line = start.line; line <= end.line; line++) {\n\t\t\tconst startOffset = line === start.line ? token.startOffset : this.#sourceFile.lineStartOffset(line);\n\t\t\tconst endOffset = line === end.line ? token.endOffset : this.#sourceFile.lineEndOffset(line);\n\t\t\tif (endOffset > startOffset && this.#intersectsRange(startOffset, endOffset)) this.#encode(startOffset, endOffset, token.tokenTypeIndex, token.modifierBitset);\n\t\t}\n\t}\n\t#encode(startOffset, endOffset, tokenTypeIndex, modifierBitset) {\n\t\tconst start = this.#sourceFile.positionAt(startOffset);\n\t\tconst deltaLine = this.#first ? start.line : start.line - this.#previousLine;\n\t\tconst deltaStart = this.#first || deltaLine !== 0 ? start.character : start.character - this.#previousCharacter;\n\t\tthis.#data.push(deltaLine, deltaStart, endOffset - startOffset, tokenTypeIndex, modifierBitset);\n\t\tthis.#previousLine = start.line;\n\t\tthis.#previousCharacter = start.character;\n\t\tthis.#first = false;\n\t}\n};\nfunction collectCommentTokens(document) {\n\tconst tokens = [];\n\tfor (const token of document.syntax.tokens()) if (token.kind === \"Comment\") tokens.push(pendingTokenForToken(token, \"comment\"));\n\treturn tokens;\n}\nfunction collectDeclarations(source, tokens) {\n\tfor (const declaration of source.document.declarations()) collectDeclaration(declaration, source, tokens, void 0);\n}\nfunction collectDeclaration(declaration, source, tokens, namespace) {\n\tif (declaration instanceof ModelDeclarationAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\taddIdentifier(declaration.name(), \"class\", tokens, semanticTokenModifierBits.declaration);\n\t\tcollectBlockMembers(declaration.members(), source, tokens, namespace);\n\t\treturn;\n\t}\n\tif (declaration instanceof CompositeTypeDeclarationAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\taddIdentifier(declaration.name(), \"struct\", tokens, semanticTokenModifierBits.declaration);\n\t\tcollectBlockMembers(declaration.members(), source, tokens, namespace);\n\t\treturn;\n\t}\n\tif (declaration instanceof NamespaceDeclarationAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\taddIdentifier(declaration.name(), \"namespace\", tokens, semanticTokenModifierBits.declaration);\n\t\tconst nestedNamespace = declaration.name()?.name();\n\t\tfor (const nested of declaration.declarations()) collectDeclaration(nested, source, tokens, nestedNamespace);\n\t\treturn;\n\t}\n\tif (declaration instanceof TypesBlockAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\tfor (const namedType of declaration.declarations()) collectNamedTypeDeclaration(namedType, source, tokens, namespace);\n\t\treturn;\n\t}\n\taddToken(declaration.keyword(), \"keyword\", tokens);\n\taddIdentifier(declaration.name(), \"type\", tokens, semanticTokenModifierBits.declaration);\n\tcollectGenericBlockMembers(declaration.members(), source, tokens, namespace);\n}\nfunction collectNamedTypeDeclaration(declaration, source, tokens, namespace) {\n\taddIdentifier(declaration.name(), \"type\", tokens, semanticTokenModifierBits.declaration);\n\tcollectTypeAnnotation(declaration.typeAnnotation(), source, tokens, namespace);\n\tcollectAttributes(declaration.attributes(), source, tokens, namespace);\n}\nfunction collectGenericBlockMembers(members, source, tokens, namespace) {\n\tfor (const member of members) {\n\t\tif (\"key\" in member) {\n\t\t\taddIdentifier(member.key(), \"property\", tokens);\n\t\t\tcollectExpression(member.value(), source, tokens, namespace);\n\t\t\tcontinue;\n\t\t}\n\t\tcollectAttribute(member, source, tokens, namespace);\n\t}\n}\nfunction collectBlockMembers(members, source, tokens, namespace) {\n\tfor (const member of members) {\n\t\tif (member instanceof FieldDeclarationAst) {\n\t\t\tcollectField(member, source, tokens, namespace);\n\t\t\tcontinue;\n\t\t}\n\t\tcollectAttribute(member, source, tokens, namespace);\n\t}\n}\nfunction collectField(field, source, tokens, namespace) {\n\taddIdentifier(field.name(), \"property\", tokens, semanticTokenModifierBits.declaration);\n\tcollectTypeAnnotation(field.typeAnnotation(), source, tokens, namespace);\n\tcollectAttributes(field.attributes(), source, tokens, namespace);\n}\nfunction collectTypeAnnotation(annotation, source, tokens, namespace) {\n\tif (annotation === void 0) return;\n\tcollectTypeReference(annotation.name(), source, tokens, namespace);\n\tcollectAttributeArgList(annotation.argList(), source, tokens, namespace);\n}\nfunction collectAttributes(attributes, source, tokens, namespace) {\n\tfor (const attribute of attributes) collectAttribute(attribute, source, tokens, namespace);\n}\nfunction collectAttribute(attribute, source, tokens, namespace) {\n\tconst marker = findChildToken(attribute.syntax, \"At\") ?? findChildToken(attribute.syntax, \"DoubleAt\");\n\tcollectDecoratorName(attribute.name(), marker, tokens);\n\tcollectAttributeArgList(attribute.argList(), source, tokens, namespace);\n}\nfunction collectDecoratorName(name, marker, tokens) {\n\tif (name === void 0) return;\n\tconst segments = identifierSegments(name);\n\tfor (const [index, segment] of segments.entries()) tokens.push(rangeForDecoratorIdentifier(segment.identifier, index === 0 ? marker : void 0));\n}\nfunction collectAttributeArgList(argList, source, tokens, namespace) {\n\tif (argList === void 0) return;\n\tfor (const arg of argList.args()) collectAttributeArg(arg, source, tokens, namespace);\n}\nfunction collectAttributeArg(arg, source, tokens, namespace) {\n\tconst name = arg.name();\n\taddIdentifier(name, \"property\", tokens);\n\tcollectExpression(arg.value(), source, tokens, namespace, expressionContextForAttributeArg(name));\n}\nfunction collectExpression(expression, source, tokens, namespace, context = {}) {\n\tif (expression === void 0) return;\n\tif (expression instanceof StringLiteralExprAst) {\n\t\taddToken(expression.token(), \"string\", tokens);\n\t\treturn;\n\t}\n\tif (expression instanceof NumberLiteralExprAst) {\n\t\taddToken(expression.token(), \"number\", tokens);\n\t\treturn;\n\t}\n\tif (expression instanceof BooleanLiteralExprAst) {\n\t\taddToken(expression.token(), \"keyword\", tokens);\n\t\treturn;\n\t}\n\tif (expression instanceof FunctionCallAst) {\n\t\tcollectTypeReference(expression.name(), source, tokens, namespace);\n\t\tfor (const arg of expression.args()) collectAttributeArg(arg, source, tokens, namespace);\n\t\treturn;\n\t}\n\tif (expression instanceof ArrayLiteralAst) {\n\t\tfor (const element of expression.elements()) collectExpression(element, source, tokens, namespace, context);\n\t\treturn;\n\t}\n\tif (expression instanceof ObjectLiteralExprAst) {\n\t\tfor (const field of expression.fields()) {\n\t\t\taddIdentifier(field.key(), \"property\", tokens);\n\t\t\tcollectExpression(field.value(), source, tokens, namespace);\n\t\t}\n\t\treturn;\n\t}\n\tcollectIdentifierExpression(expression, source, tokens, namespace, context);\n}\nfunction collectIdentifierExpression(identifier, source, tokens, namespace, context) {\n\tconst text = identifier.name();\n\tif (text === void 0) return;\n\tconst bareIdentifierTokenType = context.bareIdentifierTokenType;\n\tif (bareIdentifierTokenType !== void 0) {\n\t\ttokens.push(rangeForIdentifier(identifier, bareIdentifierTokenType));\n\t\treturn;\n\t}\n\tconst classification = classifyTypeReference([text], source, namespace);\n\ttokens.push(rangeForIdentifier(identifier, classification.tokenType, classification.modifierBitset));\n}\nfunction expressionContextForAttributeArg(name) {\n\tconst argName = name?.name();\n\treturn argName === \"fields\" || argName === \"references\" ? { bareIdentifierTokenType: \"property\" } : {};\n}\nfunction collectTypeReference(name, source, tokens, namespace) {\n\tif (name === void 0) return;\n\tconst segments = identifierSegments(name);\n\tif (segments.length === 0) return;\n\tconst path = segments.map((segment) => segment.text);\n\tfor (const segment of segments.slice(0, -1)) if (isKnownNamespace(segment.text, source.symbolTable)) tokens.push(rangeForIdentifier(segment.identifier, \"namespace\"));\n\tconst finalSegment = segments[segments.length - 1];\n\tif (finalSegment === void 0) return;\n\tconst classification = classifyTypeReference(path, source, namespace);\n\ttokens.push(rangeForIdentifier(finalSegment.identifier, classification.tokenType, classification.modifierBitset));\n}\nfunction classifyTypeReference(path, source, namespace) {\n\tconst name = path[path.length - 1];\n\tif (name === void 0) return { tokenType: \"type\" };\n\tconst table = source.symbolTable;\n\tconst namespaceName = path.length > 1 ? path[path.length - 2] : namespace;\n\tconst namespaceScope = namespaceName !== void 0 ? table.topLevel.namespaces[namespaceName] : void 0;\n\tif (namespaceScope !== void 0) {\n\t\tif (Object.hasOwn(namespaceScope.models, name)) return { tokenType: \"class\" };\n\t\tif (Object.hasOwn(namespaceScope.compositeTypes, name)) return { tokenType: \"struct\" };\n\t\tif (Object.hasOwn(namespaceScope.blocks, name)) return { tokenType: \"type\" };\n\t}\n\tif (Object.hasOwn(table.topLevel.models, name)) return { tokenType: \"class\" };\n\tif (Object.hasOwn(table.topLevel.compositeTypes, name)) return { tokenType: \"struct\" };\n\tconst namedType = table.topLevel.namedTypes[name];\n\tif (namedType !== void 0) return refinesScalarType(namedType, source.scalarTypes) ? {\n\t\ttokenType: \"type\",\n\t\tmodifierBitset: semanticTokenModifierBits.defaultLibrary\n\t} : { tokenType: \"type\" };\n\tif (Object.hasOwn(table.topLevel.blocks, name)) return { tokenType: \"type\" };\n\tif (source.scalarTypes.includes(name)) return {\n\t\ttokenType: \"type\",\n\t\tmodifierBitset: semanticTokenModifierBits.defaultLibrary\n\t};\n\treturn { tokenType: \"type\" };\n}\nfunction isKnownNamespace(name, table) {\n\treturn Object.hasOwn(table.topLevel.namespaces, name);\n}\nfunction identifierSegments(name) {\n\tconst segments = [];\n\tfor (const identifier of filterChildren(name.syntax, IdentifierAst.cast)) {\n\t\tconst text = identifier.name();\n\t\tif (text !== void 0) segments.push({\n\t\t\tidentifier,\n\t\t\ttext\n\t\t});\n\t}\n\treturn segments;\n}\nfunction addIdentifier(identifier, tokenType, tokens, modifierBitset = 0) {\n\tif (identifier === void 0) return;\n\ttokens.push(rangeForIdentifier(identifier, tokenType, modifierBitset));\n}\nfunction addToken(token, tokenType, tokens, modifierBitset = 0) {\n\tif (token === void 0) return;\n\ttokens.push(pendingTokenForToken(token, tokenType, modifierBitset));\n}\nfunction rangeForIdentifier(identifier, tokenType, modifierBitset = 0) {\n\tconst token = identifier.token();\n\tif (token === void 0) return createPendingSemanticToken(identifier.syntax.offset, identifier.syntax.offset, tokenType, modifierBitset);\n\treturn pendingTokenForToken(token, tokenType, modifierBitset);\n}\nfunction rangeForDecoratorIdentifier(identifier, marker) {\n\tconst range = rangeForIdentifier(identifier, \"decorator\");\n\tif (marker === void 0 || marker.offset >= range.startOffset) return range;\n\treturn createPendingSemanticToken(marker.offset, range.endOffset, \"decorator\", range.modifierBitset);\n}\nfunction pendingTokenForToken(token, tokenType, modifierBitset = 0) {\n\treturn createPendingSemanticToken(token.offset, token.offset + token.text.length, tokenType, modifierBitset);\n}\nfunction mergeSourceOrderedTokens(left, right) {\n\tconst result = [];\n\tlet leftIndex = 0;\n\tlet rightIndex = 0;\n\twhile (leftIndex < left.length || rightIndex < right.length) {\n\t\tconst leftToken = left[leftIndex];\n\t\tconst rightToken = right[rightIndex];\n\t\tif (leftToken !== void 0 && (rightToken === void 0 || leftToken.startOffset <= rightToken.startOffset)) {\n\t\t\tresult.push(leftToken);\n\t\t\tleftIndex++;\n\t\t} else if (rightToken !== void 0) {\n\t\t\tresult.push(rightToken);\n\t\t\trightIndex++;\n\t\t}\n\t}\n\treturn result;\n}\nfunction createPendingSemanticToken(startOffset, endOffset, tokenType, modifierBitset = 0) {\n\treturn {\n\t\tstartOffset,\n\t\tendOffset,\n\t\ttokenTypeIndex: tokenTypeIndex(tokenType),\n\t\tmodifierBitset,\n\t\tsplitMultiline: tokenType === \"string\" || tokenType === \"comment\"\n\t};\n}\nfunction tokenTypeIndex(tokenType) {\n\treturn semanticTokenTypes.indexOf(tokenType);\n}\n//#endregion\n//#region src/server.ts\n/** The project a new load of this config could fall back to. */\nfunction lastGoodProject(entry) {\n\tif (entry === void 0 || entry.status === \"failed\") return;\n\treturn entry.status === \"loaded\" ? entry.project : entry.lastGood;\n}\nconst CONFIG_LOAD_FAILED_CODE = \"PRISMA_NEXT_CONFIG_LOAD_FAILED\";\nconst semanticTokenSourceLimit = 1e5;\nfunction createServer(connection) {\n\tconst documents = new TextDocuments(TextDocument);\n\tconst managedProjects = /* @__PURE__ */ new Map();\n\tconst documentConfigPaths = /* @__PURE__ */ new Map();\n\tlet rootPath = process.cwd();\n\tlet watchedConfigGlob = join(rootPath, \"**\", CONFIG_FILENAME);\n\tlet clientCapabilities = noClientCapabilities;\n\tlet disposed = false;\n\tfunction sendDiagnostics(params) {\n\t\tif (disposed) return;\n\t\tconnection.sendDiagnostics(params);\n\t}\n\tfunction logWarn(message) {\n\t\tif (disposed) return;\n\t\tconnection.console.warn(message);\n\t}\n\tasync function publish(uri) {\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return;\n\t\tif (documents.get(uri) === void 0) {\n\t\t\tdocumentConfigPaths.delete(uri);\n\t\t\treturn;\n\t\t}\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\tif (artifacts === void 0) {\n\t\t\tsendDiagnostics({\n\t\t\t\turi,\n\t\t\t\tdiagnostics: []\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tsendDiagnostics({\n\t\t\turi,\n\t\t\tdiagnostics: combinedDiagnostics(artifacts)\n\t\t});\n\t}\n\tfunction combinedDiagnostics(artifacts) {\n\t\treturn toDiagnostics([...artifacts.diagnostics, ...artifacts.interpretDiagnostics()]);\n\t}\n\t/**\n\t* Project-scoped so a future multi-input symbol table can attach\n\t* `relatedDocuments` for cross-file effects.\n\t*/\n\tfunction buildDocumentDiagnosticReport(project, uri) {\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\treturn {\n\t\t\tkind: DocumentDiagnosticReportKind.Full,\n\t\t\titems: artifacts === void 0 ? [] : combinedDiagnostics(artifacts)\n\t\t};\n\t}\n\tasync function resolveProjectForDocument(uri) {\n\t\tconst project = await projectForNearestConfig(uri);\n\t\tif (project === void 0 || project.inputs.includes(uri)) return project;\n\t\tdocumentConfigPaths.delete(uri);\n\t\tdropProjectWithoutManagedDocuments(project.configPath);\n\t}\n\tasync function projectForNearestConfig(uri) {\n\t\tconst knownConfigPath = documentConfigPaths.get(uri);\n\t\tif (knownConfigPath !== void 0) return resolveProjectIfLoadable(knownConfigPath);\n\t\tconst filePath = filePathFromUri(uri);\n\t\tif (filePath === void 0) return;\n\t\tlet configPath;\n\t\ttry {\n\t\t\tconfigPath = await findNearestConfigPathForFile(filePath);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tif (configPath === void 0) return;\n\t\tdocumentConfigPaths.set(uri, configPath);\n\t\treturn resolveProjectIfLoadable(configPath);\n\t}\n\tasync function resolveProjectIfLoadable(configPath) {\n\t\ttry {\n\t\t\treturn await resolveProject(configPath);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\tasync function resolveProject(configPath) {\n\t\tconst entry = managedProjects.get(configPath);\n\t\tif (entry === void 0 || entry.status === \"failed\") return startProjectLoad(configPath);\n\t\treturn entry.status === \"loaded\" ? entry.project : entry.load;\n\t}\n\tfunction refreshProject(configPath) {\n\t\treturn startProjectLoad(configPath);\n\t}\n\tfunction startProjectLoad(configPath) {\n\t\tconst existing = managedProjects.get(configPath);\n\t\tconst previousLoad = existing?.status === \"loading\" ? existing.load : void 0;\n\t\tconst lastGood = lastGoodProject(existing);\n\t\tconst load = (previousLoad ?? Promise.resolve(void 0)).catch(() => void 0).then(() => loadProject(configPath)).then((project) => {\n\t\t\tif (isCurrentLoad(configPath, load)) {\n\t\t\t\tif (hasManagedDocuments(configPath)) managedProjects.set(configPath, {\n\t\t\t\t\tstatus: \"loaded\",\n\t\t\t\t\tproject\n\t\t\t\t});\n\t\t\t\telse managedProjects.delete(configPath);\n\t\t\t\tclearConfigFailure(configPath);\n\t\t\t}\n\t\t\treturn project;\n\t\t}, (error) => {\n\t\t\tif (isCurrentLoad(configPath, load)) if (!hasManagedDocuments(configPath)) {\n\t\t\t\tmanagedProjects.delete(configPath);\n\t\t\t\tclearConfigFailure(configPath);\n\t\t\t} else {\n\t\t\t\tpublishConfigFailure(configPath, error);\n\t\t\t\tif (lastGood !== void 0) {\n\t\t\t\t\tmanagedProjects.set(configPath, {\n\t\t\t\t\t\tstatus: \"loaded\",\n\t\t\t\t\t\tproject: lastGood\n\t\t\t\t\t});\n\t\t\t\t\treturn lastGood;\n\t\t\t\t}\n\t\t\t\tmanagedProjects.set(configPath, { status: \"failed\" });\n\t\t\t\tunmanageDocuments(configPath);\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n\t\tmanagedProjects.set(configPath, {\n\t\t\tstatus: \"loading\",\n\t\t\tload,\n\t\t\tlastGood\n\t\t});\n\t\treturn load;\n\t}\n\tfunction publishConfigFailure(configPath, error) {\n\t\tsendDiagnostics({\n\t\t\turi: pathToFileURL(configPath).toString(),\n\t\t\tdiagnostics: [{\n\t\t\t\trange: {\n\t\t\t\t\tstart: {\n\t\t\t\t\t\tline: 0,\n\t\t\t\t\t\tcharacter: 0\n\t\t\t\t\t},\n\t\t\t\t\tend: {\n\t\t\t\t\t\tline: 0,\n\t\t\t\t\t\tcharacter: 1\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tmessage: configFailureMessage(error),\n\t\t\t\tcode: CONFIG_LOAD_FAILED_CODE,\n\t\t\t\tseverity: DiagnosticSeverity.Error,\n\t\t\t\tsource: \"prisma-next\"\n\t\t\t}]\n\t\t});\n\t}\n\tfunction configFailureMessage(error) {\n\t\tif (CliStructuredError.is(error)) return error.why ?? error.message;\n\t\treturn error instanceof Error ? error.message : String(error);\n\t}\n\tfunction clearConfigFailure(configPath) {\n\t\tsendDiagnostics({\n\t\t\turi: pathToFileURL(configPath).toString(),\n\t\t\tdiagnostics: []\n\t\t});\n\t}\n\tfunction isCurrentLoad(configPath, load) {\n\t\tconst entry = managedProjects.get(configPath);\n\t\treturn entry?.status === \"loading\" && entry.load === load;\n\t}\n\tasync function loadProject(configPath) {\n\t\tconst resolution = await resolveConfigInputs(configPath);\n\t\tconst artifacts = createProjectArtifacts({\n\t\t\tinputs: resolution.inputs,\n\t\t\tcontrolStack: resolution.controlStack,\n\t\t\tgetText: (uri) => documents.get(uri)?.getText(),\n\t\t\t...resolution.interpretation === void 0 ? {} : { interpretation: resolution.interpretation }\n\t\t});\n\t\treturn {\n\t\t\tconfigPath,\n\t\t\tinputs: resolution.inputs,\n\t\t\tcontrolStack: resolution.controlStack,\n\t\t\tartifacts,\n\t\t\t...resolution.formatter === void 0 ? {} : { formatter: resolution.formatter },\n\t\t\t...resolution.interpretation === void 0 ? {} : { interpretation: resolution.interpretation }\n\t\t};\n\t}\n\tfunction unmanageDocuments(configPath) {\n\t\tfor (const document of documents.all()) if (documentConfigPaths.get(document.uri) === configPath) documentConfigPaths.delete(document.uri);\n\t}\n\tasync function republishOpenDocumentsForConfig(configPath) {\n\t\tfor (const document of documents.all()) {\n\t\t\tif (documentConfigPaths.get(document.uri) === configPath) {\n\t\t\t\tif (await resolveProjectForDocument(document.uri) === void 0) {\n\t\t\t\t\tsendDiagnostics({\n\t\t\t\t\t\turi: document.uri,\n\t\t\t\t\t\tdiagnostics: []\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tawait publish(document.uri);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst filePath = filePathFromUri(document.uri);\n\t\t\tif (filePath === void 0) continue;\n\t\t\tif (await findNearestConfigPathForFile(filePath) === configPath) {\n\t\t\t\tdocumentConfigPaths.set(document.uri, configPath);\n\t\t\t\tawait publish(document.uri);\n\t\t\t}\n\t\t}\n\t}\n\tfunction publishSafely(uri) {\n\t\tpublish(uri).catch((error) => {\n\t\t\tif (disposed) return;\n\t\t\ttry {\n\t\t\t\tconnection.console.error(error instanceof Error ? error.message : String(error));\n\t\t\t} catch {}\n\t\t});\n\t}\n\tasync function formatDocument(uri) {\n\t\tconst document = documents.get(uri);\n\t\tif (document === void 0) return [];\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return [];\n\t\tconst source = document.getText();\n\t\tlet formatted;\n\t\ttry {\n\t\t\tformatted = format(source, project.formatter);\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\tif (formatted === source) return [];\n\t\treturn [{\n\t\t\trange: {\n\t\t\t\tstart: {\n\t\t\t\t\tline: 0,\n\t\t\t\t\tcharacter: 0\n\t\t\t\t},\n\t\t\t\tend: document.positionAt(source.length)\n\t\t\t},\n\t\t\tnewText: formatted\n\t\t}];\n\t}\n\tasync function semanticTokensForDocument(uri, range) {\n\t\tconst document = documents.get(uri);\n\t\tif (document === void 0) return emptySemanticTokens();\n\t\tif (document.getText().length > semanticTokenSourceLimit) return emptySemanticTokens();\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return emptySemanticTokens();\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\tif (artifacts === void 0) return emptySemanticTokens();\n\t\treturn buildSemanticTokens({\n\t\t\tdocument: artifacts.document,\n\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\tsymbolTable: project.artifacts.symbolTable(),\n\t\t\tscalarTypes: project.controlStack.scalarTypes\n\t\t}, range);\n\t}\n\tasync function completeDocument(uri, position) {\n\t\tif (documents.get(uri) === void 0) return [];\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return [];\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\tif (artifacts === void 0) return [];\n\t\ttry {\n\t\t\treturn [...providePslCompletionItems({\n\t\t\t\tcontext: classifyPslCompletionContext({\n\t\t\t\t\tdocument: artifacts.document,\n\t\t\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\t\t\tposition\n\t\t\t\t}),\n\t\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\t\tcandidates: {\n\t\t\t\t\tscalarTypes: project.controlStack.scalarTypes,\n\t\t\t\t\tpslBlockDescriptors: project.controlStack.pslBlockDescriptors,\n\t\t\t\t\tsymbolTable: project.artifacts.symbolTable()\n\t\t\t\t},\n\t\t\t\tclientSupportsSnippets: clientCapabilities.completionSnippets\n\t\t\t})];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\tconnection.onInitialize(async (params) => {\n\t\trootPath = resolveRootPath(params);\n\t\twatchedConfigGlob = join(rootPath, \"**\", CONFIG_FILENAME);\n\t\tclientCapabilities = resolveClientCapabilities(params);\n\t\treturn { capabilities: {\n\t\t\ttextDocumentSync: TextDocumentSyncKind.Incremental,\n\t\t\tdocumentFormattingProvider: true,\n\t\t\tfoldingRangeProvider: true,\n\t\t\tsemanticTokensProvider: {\n\t\t\t\tlegend: semanticTokensLegend,\n\t\t\t\tfull: true,\n\t\t\t\trange: true\n\t\t\t},\n\t\t\tcompletionProvider: { triggerCharacters: [\".\"] },\n\t\t\t...clientCapabilities.pullDiagnostics ? { diagnosticProvider: {\n\t\t\t\tinterFileDependencies: false,\n\t\t\t\tworkspaceDiagnostics: false\n\t\t\t} } : {}\n\t\t} };\n\t});\n\tconnection.onInitialized(() => {\n\t\tif (clientCapabilities.watchedFilesRegistration) connection.sendRequest(RegistrationRequest.type, { registrations: [{\n\t\t\tid: \"prisma-8-config-watcher\",\n\t\t\tmethod: DidChangeWatchedFilesNotification.type.method,\n\t\t\tregisterOptions: { watchers: [{ globPattern: watchedConfigGlob }] }\n\t\t}] }).catch(() => void 0);\n\t\telse logWarn(\"Client does not support dynamic file-watcher registration; Prisma Next config changes will not be picked up without a restart.\");\n\t});\n\tconnection.onDidChangeWatchedFiles(async (params) => {\n\t\tconst changedConfigPaths = configPathsFromWatchedChanges(params.changes.map((change) => filePathFromUri(change.uri)));\n\t\tfor (const configPath of changedConfigPaths) {\n\t\t\tif (managedProjects.has(configPath)) try {\n\t\t\t\tawait refreshProject(configPath);\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!clientCapabilities.pullDiagnostics) await republishOpenDocumentsForConfig(configPath);\n\t\t}\n\t\tif (clientCapabilities.pullDiagnostics && clientCapabilities.diagnosticsRefresh && changedConfigPaths.size > 0 && !disposed) connection.languages.diagnostics.refresh().catch(() => void 0);\n\t});\n\tconnection.onDocumentFormatting((params) => formatDocument(params.textDocument.uri));\n\tconnection.onCompletion((params) => completeDocument(params.textDocument.uri, params.position));\n\tconnection.languages.semanticTokens.on((params) => semanticTokensForDocument(params.textDocument.uri));\n\tconnection.languages.semanticTokens.onRange((params) => semanticTokensForDocument(params.textDocument.uri, params.range));\n\tconnection.languages.diagnostics.on(async (params) => {\n\t\tconst project = await resolveProjectForDocument(params.textDocument.uri);\n\t\tif (project === void 0) return {\n\t\t\tkind: DocumentDiagnosticReportKind.Full,\n\t\t\titems: []\n\t\t};\n\t\treturn buildDocumentDiagnosticReport(project, params.textDocument.uri);\n\t});\n\tconnection.onFoldingRanges(async (params) => {\n\t\tconst project = await resolveProjectForDocument(params.textDocument.uri);\n\t\tif (project === void 0) return [];\n\t\tconst artifacts = project.artifacts.document(params.textDocument.uri);\n\t\tif (artifacts === void 0) return [];\n\t\treturn computeFoldingRanges(artifacts.document, artifacts.sourceFile);\n\t});\n\tdocuments.onDidOpen((event) => {\n\t\tartifactsForDocument(event.document.uri)?.documentChanged(event.document.uri);\n\t\tif (clientCapabilities.pullDiagnostics) return;\n\t\tpublishSafely(event.document.uri);\n\t});\n\tdocuments.onDidChangeContent((event) => {\n\t\tartifactsForDocument(event.document.uri)?.documentChanged(event.document.uri);\n\t\tif (clientCapabilities.pullDiagnostics) return;\n\t\tpublishSafely(event.document.uri);\n\t});\n\tdocuments.onDidClose((event) => {\n\t\tconst uri = event.document.uri;\n\t\tconst configPath = documentConfigPaths.get(uri);\n\t\tartifactsForDocument(uri)?.documentClosed(uri);\n\t\tdocumentConfigPaths.delete(uri);\n\t\tif (configPath !== void 0) dropProjectWithoutManagedDocuments(configPath);\n\t\tif (!clientCapabilities.pullDiagnostics) sendDiagnostics({\n\t\t\turi,\n\t\t\tdiagnostics: []\n\t\t});\n\t});\n\tdocuments.listen(connection);\n\tconnection.listen();\n\tfunction artifactsForDocument(uri) {\n\t\tconst configPath = documentConfigPaths.get(uri);\n\t\tif (configPath === void 0) return;\n\t\tconst entry = managedProjects.get(configPath);\n\t\treturn entry?.status === \"loaded\" ? entry.project.artifacts : void 0;\n\t}\n\tfunction hasManagedDocuments(configPath) {\n\t\tfor (const managedConfigPath of documentConfigPaths.values()) if (managedConfigPath === configPath) return true;\n\t\treturn false;\n\t}\n\tfunction dropProjectWithoutManagedDocuments(configPath) {\n\t\tif (hasManagedDocuments(configPath)) return;\n\t\tconst entry = managedProjects.get(configPath);\n\t\tif (entry === void 0 || entry.status === \"loading\") return;\n\t\tmanagedProjects.delete(configPath);\n\t\tclearConfigFailure(configPath);\n\t}\n\treturn {\n\t\tdispose: () => {\n\t\t\tdisposed = true;\n\t\t\tconnection.dispose();\n\t\t},\n\t\tgetDocumentAst: (uri) => artifactsForDocument(uri)?.document(uri),\n\t\tgetProjectSymbolTable: (uri) => artifactsForDocument(uri)?.symbolTable()\n\t};\n}\nfunction emptySemanticTokens() {\n\treturn { data: [] };\n}\nfunction toDiagnostics(computed) {\n\treturn computed.map((diagnostic) => ({\n\t\trange: diagnostic.range,\n\t\tmessage: diagnostic.message,\n\t\tcode: diagnostic.code,\n\t\tseverity: toLspSeverity(diagnostic.severity),\n\t\tsource: \"prisma-next\"\n\t}));\n}\nfunction toLspSeverity(severity) {\n\tswitch (severity) {\n\t\tcase ParseDiagnosticSeverity.Warning: return DiagnosticSeverity.Warning;\n\t\tcase ParseDiagnosticSeverity.Information: return DiagnosticSeverity.Information;\n\t\tcase ParseDiagnosticSeverity.Hint: return DiagnosticSeverity.Hint;\n\t\tdefault: return DiagnosticSeverity.Error;\n\t}\n}\nconst noClientCapabilities = {\n\twatchedFilesRegistration: false,\n\tcompletionSnippets: false,\n\tpullDiagnostics: false,\n\tdiagnosticsRefresh: false\n};\nfunction resolveClientCapabilities(params) {\n\treturn {\n\t\twatchedFilesRegistration: params.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration === true,\n\t\tcompletionSnippets: params.capabilities.textDocument?.completion?.completionItem?.snippetSupport === true,\n\t\tpullDiagnostics: params.capabilities.textDocument?.diagnostic !== void 0,\n\t\tdiagnosticsRefresh: params.capabilities.workspace?.diagnostics?.refreshSupport === true\n\t};\n}\nfunction resolveRootPath(params) {\n\tconst workspaceFolder = params.workspaceFolders?.[0];\n\tif (workspaceFolder !== void 0) return fileURLToPath(workspaceFolder.uri);\n\tif (params.rootUri) return fileURLToPath(params.rootUri);\n\tif (params.rootPath) return params.rootPath;\n\treturn process.cwd();\n}\nfunction filePathFromUri(uri) {\n\ttry {\n\t\treturn fileURLToPath(uri);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction configPathsFromWatchedChanges(paths) {\n\tconst configPaths = /* @__PURE__ */ new Set();\n\tfor (const path of paths) if (path?.endsWith(\"prisma-next.config.ts\")) configPaths.add(path);\n\treturn configPaths;\n}\n//#endregion\n//#region src/start-server.ts\nfunction startServer() {\n\treturn createServer(createConnection(ProposedFeatures.all));\n}\n//#endregion\nexport { ParseDiagnosticSeverity, createServer, mapParseDiagnostics, startServer };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,0BAA0B;CAC/B,OAAO;CACP,SAAS;CACT,aAAa;CACb,MAAM;AACP;AACA,SAAS,oBAAoB,aAAa;CACzC,OAAO,YAAY,KAAK,gBAAgB;EACvC,OAAO,WAAW;EAClB,SAAS,WAAW;EACpB,MAAM,WAAW;EACjB,UAAU,wBAAwB;CACnC,EAAE;AACH;AACA,MAAM,qBAAqB;CAC1B,OAAO;EACN,MAAM;EACN,WAAW;CACZ;CACA,KAAK;EACJ,MAAM;EACN,WAAW;CACZ;AACD;AACA,SAAS,0BAA0B,aAAa,YAAY;CAC3D,OAAO,YAAY,KAAK,gBAAgB;EACvC,OAAO,WAAW,SAAS,KAAK,IAAI,qBAAqB,eAAe,WAAW,MAAM,UAAU;EACnG,SAAS,WAAW;EACpB,MAAM,WAAW;EACjB,UAAU,wBAAwB;CACnC,EAAE;AACH;AACA,SAAS,eAAe,MAAM,YAAY;CACzC,OAAO;EACN,OAAO,WAAW,WAAW,KAAK,MAAM,MAAM;EAC9C,KAAK,WAAW,WAAW,KAAK,IAAI,MAAM;CAC3C;AACD;AAGA,MAAM,cAAc,EAAE,MAAM,cAAc;AAC1C,SAAS,6BAA6B,OAAO;CAC5C,MAAM,OAAO,MAAM,SAAS;CAC5B,MAAM,SAAS,MAAM,WAAW,SAAS,MAAM,QAAQ;CACv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B,mBAAmB;EACrG,iBAAiB,OAAO,aAAa,cAAc,eAAe,KAAK;EACvE,oBAAoB,OAAO,aAAa,WAAW,aAAa,mBAAmB;CACpF;AACD;AACA,SAAS,gBAAgB,QAAQ;CAChC,MAAM,kBAAkB,OAAO,mBAAmB;CAClD,IAAI,oBAAoB,KAAK,GAAG,OAAO,cAAc,gBAAgB,GAAG;CACxE,IAAI,OAAO,SAAS,OAAO,cAAc,OAAO,OAAO;CACvD,IAAI,OAAO,UAAU,OAAO,OAAO;CACnC,OAAO,QAAQ,IAAI;AACpB;AACA,SAAS,gBAAgB,KAAK;CAC7B,IAAI;EACH,OAAO,cAAc,GAAG;CACzB,QAAQ;EACP;CACD;AACD;AACA,SAAS,8BAA8B,OAAO;CAC7C,MAAM,8BAA8B,IAAI,IAAI;CAC5C,KAAK,MAAM,QAAQ,OAAO,IAAI,MAAM,SAAS,uBAAuB,GAAG,YAAY,IAAI,IAAI;CAC3F,OAAO;AACR;AAGA,SAAS,cAAc;CACtB,OAAO,aAAa,iBAAiB,iBAAiB,GAAG,CAAC;AAC3D"}
|
|
1
|
+
{"version":3,"file":"exports-BnihzVhw.mjs","names":["#sourceFile","#rangeOffsets","#intersectsRange","#addMultilineSplitToken","#encode","#data","#first","#previousLine","#previousCharacter"],"sources":["../../../../1-framework/3-tooling/language-server/dist/exports/index.mjs"],"sourcesContent":["import { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { findNearestConfigPathForFile, loadConfig } from \"@internal/config-loader\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { format } from \"@internal/psl-parser/format\";\nimport { join } from \"pathe\";\nimport { CompletionItemKind, DiagnosticSeverity, DidChangeWatchedFilesNotification, DocumentDiagnosticReportKind, FoldingRangeKind, InsertTextFormat, RegistrationRequest, SemanticTokenModifiers, SemanticTokenTypes, TextDocumentSyncKind, TextDocuments } from \"vscode-languageserver\";\nimport { TextDocument } from \"vscode-languageserver-textdocument\";\nimport { ArrayLiteralAst, AttributeArgListAst, BooleanLiteralExprAst, CompositeTypeDeclarationAst, FieldAttributeAst, FieldDeclarationAst, FunctionCallAst, GenericBlockDeclarationAst, IdentifierAst, KeyValuePairAst, ModelAttributeAst, ModelDeclarationAst, NamespaceDeclarationAst, NumberLiteralExprAst, ObjectLiteralExprAst, StringLiteralExprAst, TypesBlockAst, any, filterChildren, findChildToken, parse, skipTriviaToken } from \"@internal/psl-parser/syntax\";\nimport { isAuthoringPslBlockDescriptor } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, findBlockDescriptor } from \"@internal/psl-parser\";\nimport { createControlStack } from \"@internal/framework-components/control\";\nimport { hasPslInterpreter } from \"@internal/psl-parser/interpret\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { ProposedFeatures, createConnection } from \"vscode-languageserver/node\";\n//#region src/diagnostic-mapping.ts\nconst ParseDiagnosticSeverity = {\n\tError: 1,\n\tWarning: 2,\n\tInformation: 3,\n\tHint: 4\n};\nfunction mapParseDiagnostics(diagnostics) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\trange: diagnostic.range,\n\t\tmessage: diagnostic.message,\n\t\tcode: diagnostic.code,\n\t\tseverity: ParseDiagnosticSeverity.Error\n\t}));\n}\nconst documentStartRange = {\n\tstart: {\n\t\tline: 0,\n\t\tcharacter: 0\n\t},\n\tend: {\n\t\tline: 0,\n\t\tcharacter: 1\n\t}\n};\nfunction mapInterpreterDiagnostics(diagnostics, sourceFile) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\trange: diagnostic.span === void 0 ? documentStartRange : pslSpanToRange(diagnostic.span, sourceFile),\n\t\tmessage: diagnostic.message,\n\t\tcode: diagnostic.code,\n\t\tseverity: ParseDiagnosticSeverity.Error\n\t}));\n}\nfunction pslSpanToRange(span, sourceFile) {\n\treturn {\n\t\tstart: sourceFile.positionAt(span.start.offset),\n\t\tend: sourceFile.positionAt(span.end.offset)\n\t};\n}\n//#endregion\n//#region src/completion-context.ts\nconst UNSUPPORTED = { kind: \"unsupported\" };\nfunction classifyPslCompletionContext(input) {\n\tconst root = input.document.syntax;\n\tconst offset = input.sourceFile.offsetAt(input.position);\n\tconst at = root.tokenAtOffset(offset);\n\tif (at.leftBiased()?.kind === \"Comment\") return UNSUPPORTED;\n\tconst edit = cursorIdentifier(at, offset);\n\tconst preceding = precedingToken(at, edit);\n\tconst precedingNode = preceding?.parent;\n\tconst replacementStartOffset = edit?.offset ?? offset;\n\tconst declarationKeywordContext = classifyDeclarationKeyword({\n\t\tnode: precedingNode,\n\t\toffset,\n\t\treplacementStartOffset\n\t});\n\tif (declarationKeywordContext !== void 0) return declarationKeywordContext;\n\tconst genericBlockContext = classifyGenericBlockParameter({\n\t\toffset,\n\t\tat,\n\t\tprecedingToken: preceding,\n\t\treplacementStartOffset\n\t});\n\tif (genericBlockContext !== void 0) return genericBlockContext;\n\tconst field = fieldForTypeSlot(precedingNode);\n\tif (field === void 0) return UNSUPPORTED;\n\tif (field.syntax.findAncestor(any(ModelDeclarationAst.cast, CompositeTypeDeclarationAst.cast)) === void 0) return UNSUPPORTED;\n\treturn classifyModelFieldType({\n\t\tfield,\n\t\toffset,\n\t\treplacementStartOffset,\n\t\tprecedingToken: preceding\n\t});\n}\n/**\n* Locates the field whose type position the cursor occupies. The preceding token\n* climbs to the field whether the cursor sits inside a present type (the type\n* identifier's predecessor still belongs to the field) or in the empty type slot\n* of a typeless field (whose trailing trivia lives in the enclosing block, so\n* the nearest significant token to the left is the field's own name).\n*/\nfunction fieldForTypeSlot(precedingNode) {\n\treturn precedingNode?.findAncestor(FieldDeclarationAst.cast);\n}\nfunction classifyModelFieldType(input) {\n\tconst fieldName = input.field.name();\n\tif (fieldName === void 0) return UNSUPPORTED;\n\tconst fieldNameText = fieldName.name();\n\tif (fieldNameText === void 0) return UNSUPPORTED;\n\tif (fieldName.syntax.isInside(input.offset)) return UNSUPPORTED;\n\tconst typeAnnotation = input.field.typeAnnotation();\n\tif (typeAnnotation === void 0) {\n\t\tif (input.precedingToken !== void 0 && fieldName.syntax.isInside(input.precedingToken.offset)) return {\n\t\t\tkind: \"modelType\",\n\t\t\toffset: input.offset,\n\t\t\tfieldName: fieldNameText,\n\t\t\treplacementStartOffset: input.offset\n\t\t};\n\t\treturn UNSUPPORTED;\n\t}\n\tif (typeAnnotation.syntax.isOutside(input.offset)) return UNSUPPORTED;\n\tif (typeAnnotation.argList()?.syntax.isInside(input.offset)) return UNSUPPORTED;\n\tconst name = typeAnnotation.name();\n\tif (name === void 0) return UNSUPPORTED;\n\tif (name.syntax.isOutside(input.offset)) return UNSUPPORTED;\n\tif (name.isOverQualified()) return UNSUPPORTED;\n\treturn classifyTypePosition(name, input.offset, fieldNameText, input.replacementStartOffset);\n}\n/**\n* Builds the type-completion context for a qualified name. Roles are read\n* straight off the separator-positional accessors: a populated namespace\n* segment is a `.`-qualified name, a populated space segment is a `:`-qualified\n* name, and the absence of both is a bare model type.\n*\n* Behaviour change: a `:`-qualified name with no `.` (e.g. `supabase:`,\n* `supabase:U`) is a `spaceMember` position rather than falling through to bare\n* model-type completions. A malformed leading-separator name (`:User`, `.User`)\n* carries no populated segment and resolves to `modelType` rather than\n* `unsupported`.\n*/\nfunction classifyTypePosition(name, offset, fieldName, replacementStartOffset) {\n\tconst namespace = name.namespace()?.name();\n\tif (namespace !== void 0 && namespace.length > 0) {\n\t\tconst namespaceSpace = name.space()?.name();\n\t\treturn {\n\t\t\tkind: \"namespaceMember\",\n\t\t\toffset,\n\t\t\tfieldName,\n\t\t\treplacementStartOffset,\n\t\t\tnamespace,\n\t\t\t...namespaceSpace !== void 0 && namespaceSpace.length > 0 ? { space: namespaceSpace } : {}\n\t\t};\n\t}\n\tconst space = name.space()?.name();\n\tif (space !== void 0 && space.length > 0) return {\n\t\tkind: \"spaceMember\",\n\t\toffset,\n\t\tfieldName,\n\t\treplacementStartOffset,\n\t\tspace\n\t};\n\treturn {\n\t\tkind: \"modelType\",\n\t\toffset,\n\t\tfieldName,\n\t\treplacementStartOffset\n\t};\n}\nconst declarationCast = any(ModelDeclarationAst.cast, CompositeTypeDeclarationAst.cast, TypesBlockAst.cast, GenericBlockDeclarationAst.cast, NamespaceDeclarationAst.cast);\nfunction classifyDeclarationKeyword(input) {\n\tconst precedingDeclaration = input.node?.findAncestor(declarationCast);\n\tconst namespace = input.node?.findAncestor(NamespaceDeclarationAst.cast);\n\tconst inNamespaceBody = blockBodyContainsOffset(namespace, input.offset);\n\tif (precedingDeclaration !== void 0 && !canCompleteDeclaration(precedingDeclaration, input.offset, inNamespaceBody)) return;\n\treturn {\n\t\tkind: \"declarationKeyword\",\n\t\toffset: input.offset,\n\t\tscope: inNamespaceBody ? \"namespace\" : \"document\",\n\t\treplacementStartOffset: input.replacementStartOffset\n\t};\n}\n/**\n* Whether a new declaration can begin at the cursor, given the nearest enclosing\n* declaration. Allowed when that declaration is still nascent (only its keyword\n* typed, no name or body yet), when it is a namespace whose body holds further\n* declarations, or when the cursor sits past its closing `}`.\n*/\nfunction canCompleteDeclaration(precedingDeclaration, offset, inNamespaceBody) {\n\tif (precedingDeclaration.lbrace() === void 0 && (precedingDeclaration instanceof TypesBlockAst || precedingDeclaration.name() === void 0)) return true;\n\tif (precedingDeclaration instanceof NamespaceDeclarationAst && inNamespaceBody) return true;\n\tconst rbrace = precedingDeclaration.rbrace();\n\treturn rbrace !== void 0 && offset >= rbrace.endOffset;\n}\nfunction blockBodyContainsOffset(block, offset) {\n\tif (block === void 0) return false;\n\tconst lbrace = block.lbrace();\n\tif (lbrace === void 0) return false;\n\tconst bodyStart = lbrace.endOffset;\n\tconst bodyEnd = block.rbrace()?.offset ?? block.syntax.endOffset;\n\treturn offset >= bodyStart && offset <= bodyEnd;\n}\nfunction classifyGenericBlockParameter(input) {\n\tconst node = input.at.leftBiased()?.parent;\n\tconst block = node?.findAncestor(GenericBlockDeclarationAst.cast);\n\tif (block === void 0) return;\n\tif (hasUnsupportedAncestor(node)) return UNSUPPORTED;\n\tif (!blockBodyContainsOffset(block, input.offset)) return UNSUPPORTED;\n\tif ((node?.findAncestor(FieldDeclarationAst.cast))?.syntax.isInside(input.offset)) return UNSUPPORTED;\n\tconst keyword = block.keyword()?.text;\n\tif (keyword === void 0 || keyword.length === 0) return UNSUPPORTED;\n\tif (input.precedingToken?.kind === \"Equals\") return {\n\t\tkind: \"genericBlockValue\",\n\t\toffset: input.offset,\n\t\tblockKeyword: keyword,\n\t\treplacementStartOffset: input.replacementStartOffset\n\t};\n\tconst activePair = activeKeyValuePair(node, input.offset);\n\tif (activePair !== void 0 && isAfterEquals(activePair, input.offset)) return UNSUPPORTED;\n\treturn {\n\t\tkind: \"genericBlockKey\",\n\t\toffset: input.offset,\n\t\tblockKeyword: keyword,\n\t\treplacementStartOffset: input.replacementStartOffset,\n\t\tblock\n\t};\n}\nfunction activeKeyValuePair(node, offset) {\n\tconst pair = node?.findAncestor(KeyValuePairAst.cast);\n\tif (pair === void 0 || pair.syntax.isOutside(offset)) return;\n\treturn pair;\n}\nfunction isAfterEquals(pair, offset) {\n\tconst equals = pair.equals();\n\treturn equals !== void 0 && offset > equals.offset;\n}\nfunction hasUnsupportedAncestor(node) {\n\treturn node?.findAncestor(any(AttributeArgListAst.cast, FieldAttributeAst.cast, ModelAttributeAst.cast)) !== void 0;\n}\n/** The significant token preceding the cursor — the in-progress edit identifier\n* is skipped, so the result is the token the classifier anchors on. */\nfunction precedingToken(at, edit) {\n\tconst start = edit !== void 0 ? edit.prevToken : at.leftBiased();\n\treturn start === void 0 ? void 0 : skipTriviaToken(start, \"prev\");\n}\n/** The identifier token the cursor is editing, if any. */\nfunction cursorIdentifier(at, offset) {\n\tconst right = at.rightBiased();\n\tif (right?.kind === \"Ident\" && offset < right.endOffset) return right;\n\tconst left = at.leftBiased();\n\tif (left?.kind === \"Ident\" && left.endOffset === offset) return left;\n}\n//#endregion\n//#region src/named-type-classification.ts\n/**\n* Presentation-level classification of a `types {}` binding: a\n* non-constructor binding whose base is a configured scalar type refines that\n* scalar (rendered as a default-library type); everything else reads as a\n* plain alias. The authoritative scalar-or-not pronouncement lives in the\n* interpreter's named-type resolution — this mirrors it for display only.\n*/\nfunction refinesScalarType(symbol, scalarTypes) {\n\treturn !symbol.isConstructor && symbol.baseType !== void 0 && scalarTypes.includes(symbol.baseType);\n}\n//#endregion\n//#region src/completion-provider.ts\nconst categoryOrder = {\n\tconfiguredScalar: 0,\n\ttopLevelModel: 1,\n\ttopLevelCompositeType: 2,\n\tscalar: 3,\n\ttypeAlias: 4,\n\tnamespace: 5,\n\tnamespaceModel: 6,\n\tnamespaceCompositeType: 7\n};\nconst declarationKeywordCategoryOrder = {\n\tnative: 0,\n\tgenericBlock: 1\n};\nconst nameSnippetPlaceholder = \"${1:Name}\";\nconst documentNativeDeclarationKeywords = [\n\tnativeDeclarationKeyword(\"model\", \"model \", `model ${nameSnippetPlaceholder} {\\n $0\\n}`),\n\tnativeDeclarationKeyword(\"type\", \"type \", `type ${nameSnippetPlaceholder} {\\n $0\\n}`),\n\tnativeDeclarationKeyword(\"types\", \"types \", \"types {\\n $0\\n}\"),\n\tnativeDeclarationKeyword(\"namespace\", \"namespace \", `namespace \\${1:name} {\\n $0\\n}`)\n];\nconst namespaceNativeDeclarationKeywords = [nativeDeclarationKeyword(\"model\", \"model \", `model ${nameSnippetPlaceholder} {\\n $0\\n}`), nativeDeclarationKeyword(\"type\", \"type \", `type ${nameSnippetPlaceholder} {\\n $0\\n}`)];\nfunction providePslCompletionItems(input) {\n\tconst { context } = input;\n\tswitch (context.kind) {\n\t\tcase \"unsupported\": return [];\n\t\tcase \"spaceMember\": return [];\n\t\tcase \"genericBlockValue\": return [];\n\t\tcase \"declarationKeyword\": return provideDeclarationKeywordCompletionItems(context, input.sourceFile, input.candidates, input.clientSupportsSnippets);\n\t\tcase \"genericBlockKey\": return provideGenericBlockKeyCompletionItems(context, input.sourceFile, input.candidates);\n\t\tcase \"modelType\": return provideModelTypeCompletionItems(context, input.sourceFile, input.candidates);\n\t\tcase \"namespaceMember\": return provideNamespaceMemberCompletionItems(context, input.sourceFile, input.candidates);\n\t}\n}\nfunction provideDeclarationKeywordCompletionItems(context, sourceFile, source, clientSupportsSnippets) {\n\tconst replacementRange = {\n\t\tstart: sourceFile.positionAt(context.replacementStartOffset),\n\t\tend: sourceFile.positionAt(context.offset)\n\t};\n\treturn declarationKeywordCandidates(context.scope, source).map((candidate) => ({\n\t\tlabel: candidate.label,\n\t\tkind: candidate.kind,\n\t\tdetail: candidate.detail,\n\t\tsortText: declarationKeywordSortText(candidate),\n\t\tfilterText: candidate.label,\n\t\t...clientSupportsSnippets ? { insertTextFormat: InsertTextFormat.Snippet } : {},\n\t\ttextEdit: {\n\t\t\trange: replacementRange,\n\t\t\tnewText: clientSupportsSnippets ? candidate.snippetText : candidate.insertText\n\t\t}\n\t}));\n}\nfunction declarationKeywordCandidates(scope, source) {\n\treturn [...scope === \"namespace\" ? namespaceNativeDeclarationKeywords : documentNativeDeclarationKeywords, ...genericBlockDeclarationKeywordCandidates(source.pslBlockDescriptors)];\n}\nfunction nativeDeclarationKeyword(label, insertText, snippetText) {\n\treturn {\n\t\tcategory: \"native\",\n\t\tlabel,\n\t\tinsertText,\n\t\tsnippetText,\n\t\tdetail: \"PSL declaration keyword\",\n\t\tkind: CompletionItemKind.Keyword\n\t};\n}\nfunction genericBlockDeclarationKeywordCandidates(descriptors) {\n\treturn descriptorBlockKeywords(descriptors).map((keyword) => ({\n\t\tcategory: \"genericBlock\",\n\t\tlabel: keyword,\n\t\tinsertText: `${keyword} `,\n\t\tsnippetText: `${keyword} ${nameSnippetPlaceholder} {\\n $0\\n}`,\n\t\tdetail: \"Generic block keyword\",\n\t\tkind: CompletionItemKind.Keyword\n\t}));\n}\nfunction descriptorBlockKeywords(descriptors) {\n\tconst keywords = [];\n\tcollectDescriptorBlockKeywords(descriptors, keywords);\n\treturn sortedUnique(keywords);\n}\nfunction collectDescriptorBlockKeywords(descriptors, keywords) {\n\tfor (const value of Object.values(descriptors)) {\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tkeywords.push(value.keyword);\n\t\t\tcontinue;\n\t\t}\n\t\tcollectDescriptorBlockKeywords(value, keywords);\n\t}\n}\nfunction declarationKeywordSortText(candidate) {\n\treturn `${declarationKeywordCategoryOrder[candidate.category]}:${candidate.label}`;\n}\nfunction provideGenericBlockKeyCompletionItems(context, sourceFile, source) {\n\tconst descriptor = findBlockDescriptor(source.pslBlockDescriptors, context.blockKeyword);\n\tif (descriptor === void 0) return [];\n\tconst existing = existingGenericBlockParameterNames(context.block, context.offset);\n\tconst replacementRange = {\n\t\tstart: sourceFile.positionAt(context.replacementStartOffset),\n\t\tend: sourceFile.positionAt(context.offset)\n\t};\n\treturn Object.keys(descriptor.parameters).filter((parameterName) => !existing.has(parameterName)).map((parameterName, index) => ({\n\t\tlabel: parameterName,\n\t\tkind: CompletionItemKind.Property,\n\t\tdetail: \"Generic block parameter\",\n\t\tsortText: genericBlockParameterSortText(index, parameterName),\n\t\tfilterText: parameterName,\n\t\ttextEdit: {\n\t\t\trange: replacementRange,\n\t\t\tnewText: parameterName\n\t\t}\n\t}));\n}\nfunction existingGenericBlockParameterNames(block, cursorOffset) {\n\tconst names = /* @__PURE__ */ new Set();\n\tfor (const entry of block.entries()) {\n\t\tif (!entry.syntax.isOutside(cursorOffset)) continue;\n\t\tconst name = entry.key()?.name();\n\t\tif (name !== void 0) names.add(name);\n\t}\n\treturn names;\n}\nfunction provideModelTypeCompletionItems(context, sourceFile, source) {\n\treturn modelTypeCompletionItems(context, sourceFile, [\n\t\t...configuredScalarCandidates(source.scalarTypes),\n\t\t...topLevelSymbolCandidates(source.symbolTable, source.scalarTypes),\n\t\t...allNamespaceCandidates(source.symbolTable)\n\t]);\n}\nfunction provideNamespaceMemberCompletionItems(context, sourceFile, source) {\n\tif (context.space !== void 0) return [];\n\treturn modelTypeCompletionItems(context, sourceFile, namespaceCandidates(source.symbolTable.topLevel.namespaces[context.namespace]));\n}\nfunction modelTypeCompletionItems(context, sourceFile, candidates) {\n\tconst replacementRange = {\n\t\tstart: sourceFile.positionAt(context.replacementStartOffset),\n\t\tend: sourceFile.positionAt(context.offset)\n\t};\n\treturn candidates.map((candidate) => ({\n\t\tlabel: candidate.label,\n\t\tkind: candidate.kind,\n\t\tdetail: candidate.detail,\n\t\tsortText: sortText(candidate),\n\t\tfilterText: candidate.filterText,\n\t\ttextEdit: {\n\t\t\trange: replacementRange,\n\t\t\tnewText: candidate.insertText\n\t\t}\n\t}));\n}\nfunction configuredScalarCandidates(scalarTypes) {\n\treturn sortedUnique(scalarTypes).map((name) => ({\n\t\tcategory: \"configuredScalar\",\n\t\tlabel: name,\n\t\tinsertText: name,\n\t\tfilterText: name,\n\t\tdetail: \"Configured scalar type\",\n\t\tkind: CompletionItemKind.Keyword\n\t}));\n}\nfunction topLevelSymbolCandidates(symbolTable, scalarTypes) {\n\tconst { topLevel } = symbolTable;\n\tconst namedTypes = Object.values(topLevel.namedTypes);\n\tconst scalarRefinementNames = namedTypes.filter((symbol) => refinesScalarType(symbol, scalarTypes)).map((symbol) => symbol.name).sort(compareNames);\n\tconst aliasNames = namedTypes.filter((symbol) => !refinesScalarType(symbol, scalarTypes)).map((symbol) => symbol.name).sort(compareNames);\n\treturn [\n\t\t...symbolCandidates(recordNames(topLevel.models), \"topLevelModel\", \"Model\", CompletionItemKind.Class),\n\t\t...symbolCandidates(recordNames(topLevel.compositeTypes), \"topLevelCompositeType\", \"Composite type\", CompletionItemKind.Struct),\n\t\t...symbolCandidates(scalarRefinementNames, \"scalar\", \"Scalar type\", CompletionItemKind.Unit),\n\t\t...symbolCandidates(aliasNames, \"typeAlias\", \"Type alias\", CompletionItemKind.Reference)\n\t];\n}\nfunction allNamespaceCandidates(symbolTable) {\n\treturn Object.values(symbolTable.topLevel.namespaces).sort((left, right) => compareNames(left.name, right.name)).map(namespaceQualifierCandidate);\n}\nfunction namespaceCandidates(namespace) {\n\tif (namespace === void 0) return [];\n\treturn [...symbolCandidates(recordNames(namespace.models), \"namespaceModel\", `Model in namespace ${namespace.name}`, CompletionItemKind.Class), ...symbolCandidates(recordNames(namespace.compositeTypes), \"namespaceCompositeType\", `Composite type in namespace ${namespace.name}`, CompletionItemKind.Struct)];\n}\nfunction namespaceQualifierCandidate(namespace) {\n\treturn {\n\t\tcategory: \"namespace\",\n\t\tlabel: namespace.name,\n\t\tinsertText: namespace.name,\n\t\tfilterText: namespace.name,\n\t\tdetail: \"Namespace\",\n\t\tkind: CompletionItemKind.Module\n\t};\n}\nfunction symbolCandidates(names, category, detail, kind) {\n\treturn names.map((name) => ({\n\t\tcategory,\n\t\tlabel: name,\n\t\tinsertText: name,\n\t\tfilterText: name,\n\t\tdetail,\n\t\tkind\n\t}));\n}\nfunction recordNames(record) {\n\treturn Object.values(record).map((symbol) => symbol.name).sort(compareNames);\n}\nfunction sortedUnique(names) {\n\treturn [...new Set(names)].sort(compareNames);\n}\nfunction sortText(candidate) {\n\treturn `${categoryOrder[candidate.category]}:${candidate.label}`;\n}\nfunction genericBlockParameterSortText(index, label) {\n\treturn `${index.toString().padStart(4, \"0\")}:${label}`;\n}\nfunction compareNames(left, right) {\n\tif (left < right) return -1;\n\tif (left > right) return 1;\n\treturn 0;\n}\n//#endregion\n//#region src/schema-inputs.ts\nfunction hasPslInputs(config) {\n\tconst source = config.contract?.source;\n\treturn source?.format === \"psl\" && source.inputs !== void 0;\n}\nfunction resolveSchemaInputs(config) {\n\tconst inputs = hasPslInputs(config) ? config.contract?.source.inputs : void 0;\n\tconst uris = new Set(inputs?.map((input) => pathToFileURL(input).toString()));\n\treturn {\n\t\tincludes: (uri) => uris.has(uri),\n\t\turis: () => uris\n\t};\n}\n//#endregion\n//#region src/config-resolution.ts\nconst CONFIG_FILENAME = \"prisma-next.config.ts\";\nconst emptyPipelineInputs = {\n\tscalarTypes: [],\n\tpslBlockDescriptors: {}\n};\nasync function resolveConfigInputs(configPath) {\n\tconst config = await loadConfig(configPath);\n\tconst inputs = resolveSchemaInputs(config);\n\tif (!hasPslInputs(config)) return {\n\t\tinputs,\n\t\tcontrolStack: emptyPipelineInputs,\n\t\t...config.formatter === void 0 ? {} : { formatter: config.formatter }\n\t};\n\tconst stack = createControlStack(config);\n\tconst interpretation = resolveInterpretation(config, stack, inputs);\n\treturn {\n\t\tinputs,\n\t\tcontrolStack: pipelineInputsFromStack(stack),\n\t\t...config.formatter === void 0 ? {} : { formatter: config.formatter },\n\t\t...interpretation === void 0 ? {} : { interpretation }\n\t};\n}\nfunction pipelineInputsFromStack(stack) {\n\treturn {\n\t\tscalarTypes: [...stack.scalarTypes],\n\t\tpslBlockDescriptors: stack.authoringContributions.pslBlockDescriptors\n\t};\n}\nfunction resolveInterpretation(config, stack, inputs) {\n\tconst source = config.contract?.source;\n\tif (source === void 0 || !hasPslInterpreter(source)) return;\n\treturn {\n\t\tsource,\n\t\tcontext: {\n\t\t\tcomposedExtensions: stack.extensions.map((p) => p.id),\n\t\t\tcomposedExtensionContracts: stack.extensionContracts,\n\t\t\tauthoringContributions: stack.authoringContributions,\n\t\t\tcodecLookup: stack.codecLookup,\n\t\t\tcontrolMutationDefaults: stack.controlMutationDefaults,\n\t\t\tresolvedInputs: [...inputs.uris()],\n\t\t\tcapabilities: stack.capabilities\n\t\t}\n\t};\n}\n//#endregion\n//#region src/folding-ranges.ts\n/**\n* Computes folding ranges for block declarations in a PSL document.\n*\n* Block types that produce folding ranges:\n* - model (e.g., `model User { ... }`)\n* - composite type (e.g., `type Address { ... }`)\n* - namespace (e.g., `namespace billing { ... }`)\n* - generic blocks (generator, datasource, extension blocks)\n* - types block (e.g., `types { ... }`)\n*\n* The range spans from the line containing `{` to the line containing `}`.\n*/\nfunction computeFoldingRanges(document, sourceFile) {\n\tconst ranges = [];\n\tcollectFoldingRanges(document, sourceFile, ranges);\n\treturn ranges;\n}\nfunction collectFoldingRanges(document, sourceFile, ranges) {\n\tfor (const declaration of document.declarations()) {\n\t\taddFoldingRange(declaration, sourceFile, ranges);\n\t\tconst namespace = NamespaceDeclarationAst.cast(declaration.syntax);\n\t\tif (namespace !== void 0) for (const nested of namespace.declarations()) addFoldingRange(nested, sourceFile, ranges);\n\t}\n}\nfunction addFoldingRange(declaration, sourceFile, ranges) {\n\tconst lbrace = declaration.lbrace();\n\tconst rbrace = declaration.rbrace();\n\tif (lbrace === void 0 || rbrace === void 0) return;\n\tconst startLine = sourceFile.positionAt(lbrace.offset).line;\n\tconst endLine = sourceFile.positionAt(rbrace.offset).line;\n\tranges.push({\n\t\tstartLine,\n\t\tendLine,\n\t\tkind: FoldingRangeKind.Region\n\t});\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* Composes the stages exactly as the contract-psl provider does, so the editor\n* and the build agree: `parse` then `buildSymbolTable`, parse diagnostics ahead\n* of symbol-table diagnostics. Never throws on malformed input — `parse`\n* recovers and `buildSymbolTable` is documented not to throw.\n*/\nfunction runPipeline(text, inputs) {\n\tconst { document, sourceFile, diagnostics: parseDiagnostics } = parse(text);\n\tconst { table: symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\tdocument,\n\t\tsourceFile,\n\t\tpslBlockDescriptors: inputs.pslBlockDescriptors\n\t});\n\treturn {\n\t\tdocument,\n\t\tsourceFile,\n\t\tsymbolTable,\n\t\tdiagnostics: mapParseDiagnostics([...parseDiagnostics, ...symbolTableDiagnostics])\n\t};\n}\n//#endregion\n//#region src/document-diagnostics.ts\n/**\n* `null` (not a configured input) is distinct from a `DocumentDiagnostics` whose\n* `diagnostics` are `[]` (an input that parsed clean): the caller treats both as\n* \"publish no diagnostics\", but only the latter is a document we own and keep\n* diagnosing.\n*/\nfunction computeDocumentDiagnostics(uri, text, inputs, controlStack) {\n\tif (!inputs.includes(uri)) return null;\n\tconst { document, sourceFile, symbolTable, diagnostics } = runPipeline(text, controlStack);\n\treturn {\n\t\tdiagnostics,\n\t\tdocument,\n\t\tsourceFile,\n\t\tsymbolTable\n\t};\n}\n//#endregion\n//#region src/project-artifacts.ts\nfunction createProjectArtifacts(options) {\n\tconst { inputs, controlStack, getText, interpretation } = options;\n\tconst documents = /* @__PURE__ */ new Map();\n\tlet symbolTable;\n\tfunction createInterpretSlot(uri, computed) {\n\t\tif (interpretation === void 0) return () => [];\n\t\tlet memo;\n\t\treturn () => {\n\t\t\tif (memo === void 0) {\n\t\t\t\tconst result = interpretation.source.interpret({\n\t\t\t\t\tdocument: computed.document,\n\t\t\t\t\tsourceFile: computed.sourceFile,\n\t\t\t\t\tsymbolTable: computed.symbolTable,\n\t\t\t\t\tsourceId: uri\n\t\t\t\t}, interpretation.context);\n\t\t\t\tmemo = mapInterpreterDiagnostics(result.ok ? [] : result.failure.diagnostics, computed.sourceFile);\n\t\t\t}\n\t\t\treturn memo;\n\t\t};\n\t}\n\tfunction drop(uri) {\n\t\tif (documents.delete(uri)) symbolTable = void 0;\n\t}\n\tfunction readDocument(uri) {\n\t\tconst existing = documents.get(uri);\n\t\tif (existing !== void 0) return existing;\n\t\tconst text = getText(uri);\n\t\tif (text === void 0) return;\n\t\tconst computed = computeDocumentDiagnostics(uri, text, inputs, controlStack);\n\t\tif (computed === null) return;\n\t\tconst artifacts = {\n\t\t\tdocument: computed.document,\n\t\t\tsourceFile: computed.sourceFile,\n\t\t\tdiagnostics: computed.diagnostics,\n\t\t\tinterpretDiagnostics: createInterpretSlot(uri, computed)\n\t\t};\n\t\tdocuments.set(uri, artifacts);\n\t\tsymbolTable = computed.symbolTable;\n\t\treturn artifacts;\n\t}\n\treturn {\n\t\tdocument: readDocument,\n\t\tsymbolTable: () => {\n\t\t\tif (symbolTable !== void 0) return symbolTable;\n\t\t\tfor (const uri of inputs.uris()) {\n\t\t\t\tconst artifacts = readDocument(uri);\n\t\t\t\tif (artifacts === void 0) continue;\n\t\t\t\tsymbolTable ??= buildSymbolTable({\n\t\t\t\t\tdocument: artifacts.document,\n\t\t\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\t\t\tpslBlockDescriptors: controlStack.pslBlockDescriptors\n\t\t\t\t}).table;\n\t\t\t\treturn symbolTable;\n\t\t\t}\n\t\t\tthrow new InternalError(\"invariant violated: project has no open configured input — the server must drop such projects\");\n\t\t},\n\t\tdocumentChanged: drop,\n\t\tdocumentClosed: drop\n\t};\n}\n//#endregion\n//#region src/semantic-tokens.ts\nconst semanticTokenTypes = [\n\tSemanticTokenTypes.keyword,\n\tSemanticTokenTypes.namespace,\n\tSemanticTokenTypes.class,\n\tSemanticTokenTypes.struct,\n\tSemanticTokenTypes.type,\n\tSemanticTokenTypes.property,\n\tSemanticTokenTypes.decorator,\n\tSemanticTokenTypes.string,\n\tSemanticTokenTypes.number,\n\tSemanticTokenTypes.comment\n];\nconst semanticTokenModifiers = [SemanticTokenModifiers.declaration, SemanticTokenModifiers.defaultLibrary];\nconst semanticTokenModifierIndexes = {\n\tdeclaration: 0,\n\tdefaultLibrary: 1\n};\nconst semanticTokenModifierBits = {\n\tdeclaration: 1 << semanticTokenModifierIndexes.declaration,\n\tdefaultLibrary: 1 << semanticTokenModifierIndexes.defaultLibrary\n};\nconst semanticTokensLegend = {\n\ttokenTypes: [...semanticTokenTypes],\n\ttokenModifiers: [...semanticTokenModifiers]\n};\nfunction buildSemanticTokens(source, range) {\n\tconst builder = new SemanticTokensBuilder(source.sourceFile, range);\n\tfor (const token of collectSemanticTokenEvents(source)) builder.add(token);\n\treturn builder.build();\n}\nfunction collectSemanticTokenEvents(source) {\n\tconst comments = collectCommentTokens(source.document);\n\tconst tokens = [];\n\tcollectDeclarations(source, tokens);\n\treturn mergeSourceOrderedTokens(comments, tokens);\n}\nvar SemanticTokensBuilder = class {\n\t#data = [];\n\t#sourceFile;\n\t#rangeOffsets;\n\t#previousLine = 0;\n\t#previousCharacter = 0;\n\t#first = true;\n\tconstructor(sourceFile, range) {\n\t\tthis.#sourceFile = sourceFile;\n\t\tif (range !== void 0) {\n\t\t\tconst startOffset = sourceFile.offsetAt(range.start);\n\t\t\tconst endOffset = sourceFile.offsetAt(range.end);\n\t\t\tthis.#rangeOffsets = {\n\t\t\t\tlower: Math.min(startOffset, endOffset),\n\t\t\t\tupper: Math.max(startOffset, endOffset)\n\t\t\t};\n\t\t}\n\t}\n\tadd(token) {\n\t\tif (!this.#intersectsRange(token.startOffset, token.endOffset)) return;\n\t\tif (token.splitMultiline) {\n\t\t\tthis.#addMultilineSplitToken(token);\n\t\t\treturn;\n\t\t}\n\t\tthis.#encode(token.startOffset, token.endOffset, token.tokenTypeIndex, token.modifierBitset);\n\t}\n\tbuild() {\n\t\treturn { data: this.#data };\n\t}\n\t#intersectsRange(startOffset, endOffset) {\n\t\tconst rangeOffsets = this.#rangeOffsets;\n\t\treturn rangeOffsets === void 0 || startOffset < rangeOffsets.upper && endOffset > rangeOffsets.lower;\n\t}\n\t#addMultilineSplitToken(token) {\n\t\tconst start = this.#sourceFile.positionAt(token.startOffset);\n\t\tconst end = this.#sourceFile.positionAt(token.endOffset);\n\t\tif (start.line === end.line) {\n\t\t\tthis.#encode(token.startOffset, token.endOffset, token.tokenTypeIndex, token.modifierBitset);\n\t\t\treturn;\n\t\t}\n\t\tfor (let line = start.line; line <= end.line; line++) {\n\t\t\tconst startOffset = line === start.line ? token.startOffset : this.#sourceFile.lineStartOffset(line);\n\t\t\tconst endOffset = line === end.line ? token.endOffset : this.#sourceFile.lineEndOffset(line);\n\t\t\tif (endOffset > startOffset && this.#intersectsRange(startOffset, endOffset)) this.#encode(startOffset, endOffset, token.tokenTypeIndex, token.modifierBitset);\n\t\t}\n\t}\n\t#encode(startOffset, endOffset, tokenTypeIndex, modifierBitset) {\n\t\tconst start = this.#sourceFile.positionAt(startOffset);\n\t\tconst deltaLine = this.#first ? start.line : start.line - this.#previousLine;\n\t\tconst deltaStart = this.#first || deltaLine !== 0 ? start.character : start.character - this.#previousCharacter;\n\t\tthis.#data.push(deltaLine, deltaStart, endOffset - startOffset, tokenTypeIndex, modifierBitset);\n\t\tthis.#previousLine = start.line;\n\t\tthis.#previousCharacter = start.character;\n\t\tthis.#first = false;\n\t}\n};\nfunction collectCommentTokens(document) {\n\tconst tokens = [];\n\tfor (const token of document.syntax.tokens()) if (token.kind === \"Comment\") tokens.push(pendingTokenForToken(token, \"comment\"));\n\treturn tokens;\n}\nfunction collectDeclarations(source, tokens) {\n\tfor (const declaration of source.document.declarations()) collectDeclaration(declaration, source, tokens, void 0);\n}\nfunction collectDeclaration(declaration, source, tokens, namespace) {\n\tif (declaration instanceof ModelDeclarationAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\taddIdentifier(declaration.name(), \"class\", tokens, semanticTokenModifierBits.declaration);\n\t\tcollectBlockMembers(declaration.members(), source, tokens, namespace);\n\t\treturn;\n\t}\n\tif (declaration instanceof CompositeTypeDeclarationAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\taddIdentifier(declaration.name(), \"struct\", tokens, semanticTokenModifierBits.declaration);\n\t\tcollectBlockMembers(declaration.members(), source, tokens, namespace);\n\t\treturn;\n\t}\n\tif (declaration instanceof NamespaceDeclarationAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\taddIdentifier(declaration.name(), \"namespace\", tokens, semanticTokenModifierBits.declaration);\n\t\tconst nestedNamespace = declaration.name()?.name();\n\t\tfor (const nested of declaration.declarations()) collectDeclaration(nested, source, tokens, nestedNamespace);\n\t\treturn;\n\t}\n\tif (declaration instanceof TypesBlockAst) {\n\t\taddToken(declaration.keyword(), \"keyword\", tokens);\n\t\tfor (const namedType of declaration.declarations()) collectNamedTypeDeclaration(namedType, source, tokens, namespace);\n\t\treturn;\n\t}\n\taddToken(declaration.keyword(), \"keyword\", tokens);\n\taddIdentifier(declaration.name(), \"type\", tokens, semanticTokenModifierBits.declaration);\n\tcollectGenericBlockMembers(declaration.members(), source, tokens, namespace);\n}\nfunction collectNamedTypeDeclaration(declaration, source, tokens, namespace) {\n\taddIdentifier(declaration.name(), \"type\", tokens, semanticTokenModifierBits.declaration);\n\tcollectTypeAnnotation(declaration.typeAnnotation(), source, tokens, namespace);\n\tcollectAttributes(declaration.attributes(), source, tokens, namespace);\n}\nfunction collectGenericBlockMembers(members, source, tokens, namespace) {\n\tfor (const member of members) {\n\t\tif (\"key\" in member) {\n\t\t\taddIdentifier(member.key(), \"property\", tokens);\n\t\t\tcollectExpression(member.value(), source, tokens, namespace);\n\t\t\tcontinue;\n\t\t}\n\t\tcollectAttribute(member, source, tokens, namespace);\n\t}\n}\nfunction collectBlockMembers(members, source, tokens, namespace) {\n\tfor (const member of members) {\n\t\tif (member instanceof FieldDeclarationAst) {\n\t\t\tcollectField(member, source, tokens, namespace);\n\t\t\tcontinue;\n\t\t}\n\t\tcollectAttribute(member, source, tokens, namespace);\n\t}\n}\nfunction collectField(field, source, tokens, namespace) {\n\taddIdentifier(field.name(), \"property\", tokens, semanticTokenModifierBits.declaration);\n\tcollectTypeAnnotation(field.typeAnnotation(), source, tokens, namespace);\n\tcollectAttributes(field.attributes(), source, tokens, namespace);\n}\nfunction collectTypeAnnotation(annotation, source, tokens, namespace) {\n\tif (annotation === void 0) return;\n\tcollectTypeReference(annotation.name(), source, tokens, namespace);\n\tcollectAttributeArgList(annotation.argList(), source, tokens, namespace);\n}\nfunction collectAttributes(attributes, source, tokens, namespace) {\n\tfor (const attribute of attributes) collectAttribute(attribute, source, tokens, namespace);\n}\nfunction collectAttribute(attribute, source, tokens, namespace) {\n\tconst marker = findChildToken(attribute.syntax, \"At\") ?? findChildToken(attribute.syntax, \"DoubleAt\");\n\tcollectDecoratorName(attribute.name(), marker, tokens);\n\tcollectAttributeArgList(attribute.argList(), source, tokens, namespace);\n}\nfunction collectDecoratorName(name, marker, tokens) {\n\tif (name === void 0) return;\n\tconst segments = identifierSegments(name);\n\tfor (const [index, segment] of segments.entries()) tokens.push(rangeForDecoratorIdentifier(segment.identifier, index === 0 ? marker : void 0));\n}\nfunction collectAttributeArgList(argList, source, tokens, namespace) {\n\tif (argList === void 0) return;\n\tfor (const arg of argList.args()) collectAttributeArg(arg, source, tokens, namespace);\n}\nfunction collectAttributeArg(arg, source, tokens, namespace) {\n\tconst name = arg.name();\n\taddIdentifier(name, \"property\", tokens);\n\tcollectExpression(arg.value(), source, tokens, namespace, expressionContextForAttributeArg(name));\n}\nfunction collectExpression(expression, source, tokens, namespace, context = {}) {\n\tif (expression === void 0) return;\n\tif (expression instanceof StringLiteralExprAst) {\n\t\taddToken(expression.token(), \"string\", tokens);\n\t\treturn;\n\t}\n\tif (expression instanceof NumberLiteralExprAst) {\n\t\taddToken(expression.token(), \"number\", tokens);\n\t\treturn;\n\t}\n\tif (expression instanceof BooleanLiteralExprAst) {\n\t\taddToken(expression.token(), \"keyword\", tokens);\n\t\treturn;\n\t}\n\tif (expression instanceof FunctionCallAst) {\n\t\tcollectTypeReference(expression.name(), source, tokens, namespace);\n\t\tfor (const arg of expression.args()) collectAttributeArg(arg, source, tokens, namespace);\n\t\treturn;\n\t}\n\tif (expression instanceof ArrayLiteralAst) {\n\t\tfor (const element of expression.elements()) collectExpression(element, source, tokens, namespace, context);\n\t\treturn;\n\t}\n\tif (expression instanceof ObjectLiteralExprAst) {\n\t\tfor (const field of expression.fields()) {\n\t\t\taddIdentifier(field.key(), \"property\", tokens);\n\t\t\tcollectExpression(field.value(), source, tokens, namespace);\n\t\t}\n\t\treturn;\n\t}\n\tcollectIdentifierExpression(expression, source, tokens, namespace, context);\n}\nfunction collectIdentifierExpression(identifier, source, tokens, namespace, context) {\n\tconst text = identifier.name();\n\tif (text === void 0) return;\n\tconst bareIdentifierTokenType = context.bareIdentifierTokenType;\n\tif (bareIdentifierTokenType !== void 0) {\n\t\ttokens.push(rangeForIdentifier(identifier, bareIdentifierTokenType));\n\t\treturn;\n\t}\n\tconst classification = classifyTypeReference([text], source, namespace);\n\ttokens.push(rangeForIdentifier(identifier, classification.tokenType, classification.modifierBitset));\n}\nfunction expressionContextForAttributeArg(name) {\n\tconst argName = name?.name();\n\treturn argName === \"fields\" || argName === \"references\" ? { bareIdentifierTokenType: \"property\" } : {};\n}\nfunction collectTypeReference(name, source, tokens, namespace) {\n\tif (name === void 0) return;\n\tconst segments = identifierSegments(name);\n\tif (segments.length === 0) return;\n\tconst path = segments.map((segment) => segment.text);\n\tfor (const segment of segments.slice(0, -1)) if (isKnownNamespace(segment.text, source.symbolTable)) tokens.push(rangeForIdentifier(segment.identifier, \"namespace\"));\n\tconst finalSegment = segments[segments.length - 1];\n\tif (finalSegment === void 0) return;\n\tconst classification = classifyTypeReference(path, source, namespace);\n\ttokens.push(rangeForIdentifier(finalSegment.identifier, classification.tokenType, classification.modifierBitset));\n}\nfunction classifyTypeReference(path, source, namespace) {\n\tconst name = path[path.length - 1];\n\tif (name === void 0) return { tokenType: \"type\" };\n\tconst table = source.symbolTable;\n\tconst namespaceName = path.length > 1 ? path[path.length - 2] : namespace;\n\tconst namespaceScope = namespaceName !== void 0 ? table.topLevel.namespaces[namespaceName] : void 0;\n\tif (namespaceScope !== void 0) {\n\t\tif (Object.hasOwn(namespaceScope.models, name)) return { tokenType: \"class\" };\n\t\tif (Object.hasOwn(namespaceScope.compositeTypes, name)) return { tokenType: \"struct\" };\n\t\tif (Object.hasOwn(namespaceScope.blocks, name)) return { tokenType: \"type\" };\n\t}\n\tif (Object.hasOwn(table.topLevel.models, name)) return { tokenType: \"class\" };\n\tif (Object.hasOwn(table.topLevel.compositeTypes, name)) return { tokenType: \"struct\" };\n\tconst namedType = table.topLevel.namedTypes[name];\n\tif (namedType !== void 0) return refinesScalarType(namedType, source.scalarTypes) ? {\n\t\ttokenType: \"type\",\n\t\tmodifierBitset: semanticTokenModifierBits.defaultLibrary\n\t} : { tokenType: \"type\" };\n\tif (Object.hasOwn(table.topLevel.blocks, name)) return { tokenType: \"type\" };\n\tif (source.scalarTypes.includes(name)) return {\n\t\ttokenType: \"type\",\n\t\tmodifierBitset: semanticTokenModifierBits.defaultLibrary\n\t};\n\treturn { tokenType: \"type\" };\n}\nfunction isKnownNamespace(name, table) {\n\treturn Object.hasOwn(table.topLevel.namespaces, name);\n}\nfunction identifierSegments(name) {\n\tconst segments = [];\n\tfor (const identifier of filterChildren(name.syntax, IdentifierAst.cast)) {\n\t\tconst text = identifier.name();\n\t\tif (text !== void 0) segments.push({\n\t\t\tidentifier,\n\t\t\ttext\n\t\t});\n\t}\n\treturn segments;\n}\nfunction addIdentifier(identifier, tokenType, tokens, modifierBitset = 0) {\n\tif (identifier === void 0) return;\n\ttokens.push(rangeForIdentifier(identifier, tokenType, modifierBitset));\n}\nfunction addToken(token, tokenType, tokens, modifierBitset = 0) {\n\tif (token === void 0) return;\n\ttokens.push(pendingTokenForToken(token, tokenType, modifierBitset));\n}\nfunction rangeForIdentifier(identifier, tokenType, modifierBitset = 0) {\n\tconst token = identifier.token();\n\tif (token === void 0) return createPendingSemanticToken(identifier.syntax.offset, identifier.syntax.offset, tokenType, modifierBitset);\n\treturn pendingTokenForToken(token, tokenType, modifierBitset);\n}\nfunction rangeForDecoratorIdentifier(identifier, marker) {\n\tconst range = rangeForIdentifier(identifier, \"decorator\");\n\tif (marker === void 0 || marker.offset >= range.startOffset) return range;\n\treturn createPendingSemanticToken(marker.offset, range.endOffset, \"decorator\", range.modifierBitset);\n}\nfunction pendingTokenForToken(token, tokenType, modifierBitset = 0) {\n\treturn createPendingSemanticToken(token.offset, token.offset + token.text.length, tokenType, modifierBitset);\n}\nfunction mergeSourceOrderedTokens(left, right) {\n\tconst result = [];\n\tlet leftIndex = 0;\n\tlet rightIndex = 0;\n\twhile (leftIndex < left.length || rightIndex < right.length) {\n\t\tconst leftToken = left[leftIndex];\n\t\tconst rightToken = right[rightIndex];\n\t\tif (leftToken !== void 0 && (rightToken === void 0 || leftToken.startOffset <= rightToken.startOffset)) {\n\t\t\tresult.push(leftToken);\n\t\t\tleftIndex++;\n\t\t} else if (rightToken !== void 0) {\n\t\t\tresult.push(rightToken);\n\t\t\trightIndex++;\n\t\t}\n\t}\n\treturn result;\n}\nfunction createPendingSemanticToken(startOffset, endOffset, tokenType, modifierBitset = 0) {\n\treturn {\n\t\tstartOffset,\n\t\tendOffset,\n\t\ttokenTypeIndex: tokenTypeIndex(tokenType),\n\t\tmodifierBitset,\n\t\tsplitMultiline: tokenType === \"string\" || tokenType === \"comment\"\n\t};\n}\nfunction tokenTypeIndex(tokenType) {\n\treturn semanticTokenTypes.indexOf(tokenType);\n}\n//#endregion\n//#region src/server.ts\n/** The project a new load of this config could fall back to. */\nfunction lastGoodProject(entry) {\n\tif (entry === void 0 || entry.status === \"failed\") return;\n\treturn entry.status === \"loaded\" ? entry.project : entry.lastGood;\n}\nconst CONFIG_LOAD_FAILED_CODE = \"PRISMA_NEXT_CONFIG_LOAD_FAILED\";\nconst semanticTokenSourceLimit = 1e5;\nfunction createServer(connection) {\n\tconst documents = new TextDocuments(TextDocument);\n\tconst managedProjects = /* @__PURE__ */ new Map();\n\tconst documentConfigPaths = /* @__PURE__ */ new Map();\n\tlet rootPath = process.cwd();\n\tlet watchedConfigGlob = join(rootPath, \"**\", CONFIG_FILENAME);\n\tlet clientCapabilities = noClientCapabilities;\n\tlet disposed = false;\n\tfunction sendDiagnostics(params) {\n\t\tif (disposed) return;\n\t\tconnection.sendDiagnostics(params);\n\t}\n\tfunction logWarn(message) {\n\t\tif (disposed) return;\n\t\tconnection.console.warn(message);\n\t}\n\tasync function publish(uri) {\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return;\n\t\tif (documents.get(uri) === void 0) {\n\t\t\tdocumentConfigPaths.delete(uri);\n\t\t\treturn;\n\t\t}\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\tif (artifacts === void 0) {\n\t\t\tsendDiagnostics({\n\t\t\t\turi,\n\t\t\t\tdiagnostics: []\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tsendDiagnostics({\n\t\t\turi,\n\t\t\tdiagnostics: combinedDiagnostics(artifacts)\n\t\t});\n\t}\n\tfunction combinedDiagnostics(artifacts) {\n\t\treturn toDiagnostics([...artifacts.diagnostics, ...artifacts.interpretDiagnostics()]);\n\t}\n\t/**\n\t* Project-scoped so a future multi-input symbol table can attach\n\t* `relatedDocuments` for cross-file effects.\n\t*/\n\tfunction buildDocumentDiagnosticReport(project, uri) {\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\treturn {\n\t\t\tkind: DocumentDiagnosticReportKind.Full,\n\t\t\titems: artifacts === void 0 ? [] : combinedDiagnostics(artifacts)\n\t\t};\n\t}\n\tasync function resolveProjectForDocument(uri) {\n\t\tconst project = await projectForNearestConfig(uri);\n\t\tif (project === void 0 || project.inputs.includes(uri)) return project;\n\t\tdocumentConfigPaths.delete(uri);\n\t\tdropProjectWithoutManagedDocuments(project.configPath);\n\t}\n\tasync function projectForNearestConfig(uri) {\n\t\tconst knownConfigPath = documentConfigPaths.get(uri);\n\t\tif (knownConfigPath !== void 0) return resolveProjectIfLoadable(knownConfigPath);\n\t\tconst filePath = filePathFromUri(uri);\n\t\tif (filePath === void 0) return;\n\t\tlet configPath;\n\t\ttry {\n\t\t\tconfigPath = await findNearestConfigPathForFile(filePath);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tif (configPath === void 0) return;\n\t\tdocumentConfigPaths.set(uri, configPath);\n\t\treturn resolveProjectIfLoadable(configPath);\n\t}\n\tasync function resolveProjectIfLoadable(configPath) {\n\t\ttry {\n\t\t\treturn await resolveProject(configPath);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\tasync function resolveProject(configPath) {\n\t\tconst entry = managedProjects.get(configPath);\n\t\tif (entry === void 0 || entry.status === \"failed\") return startProjectLoad(configPath);\n\t\treturn entry.status === \"loaded\" ? entry.project : entry.load;\n\t}\n\tfunction refreshProject(configPath) {\n\t\treturn startProjectLoad(configPath);\n\t}\n\tfunction startProjectLoad(configPath) {\n\t\tconst existing = managedProjects.get(configPath);\n\t\tconst previousLoad = existing?.status === \"loading\" ? existing.load : void 0;\n\t\tconst lastGood = lastGoodProject(existing);\n\t\tconst load = (previousLoad ?? Promise.resolve(void 0)).catch(() => void 0).then(() => loadProject(configPath)).then((project) => {\n\t\t\tif (isCurrentLoad(configPath, load)) {\n\t\t\t\tif (hasManagedDocuments(configPath)) managedProjects.set(configPath, {\n\t\t\t\t\tstatus: \"loaded\",\n\t\t\t\t\tproject\n\t\t\t\t});\n\t\t\t\telse managedProjects.delete(configPath);\n\t\t\t\tclearConfigFailure(configPath);\n\t\t\t}\n\t\t\treturn project;\n\t\t}, (error) => {\n\t\t\tif (isCurrentLoad(configPath, load)) if (!hasManagedDocuments(configPath)) {\n\t\t\t\tmanagedProjects.delete(configPath);\n\t\t\t\tclearConfigFailure(configPath);\n\t\t\t} else {\n\t\t\t\tpublishConfigFailure(configPath, error);\n\t\t\t\tif (lastGood !== void 0) {\n\t\t\t\t\tmanagedProjects.set(configPath, {\n\t\t\t\t\t\tstatus: \"loaded\",\n\t\t\t\t\t\tproject: lastGood\n\t\t\t\t\t});\n\t\t\t\t\treturn lastGood;\n\t\t\t\t}\n\t\t\t\tmanagedProjects.set(configPath, { status: \"failed\" });\n\t\t\t\tunmanageDocuments(configPath);\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n\t\tmanagedProjects.set(configPath, {\n\t\t\tstatus: \"loading\",\n\t\t\tload,\n\t\t\tlastGood\n\t\t});\n\t\treturn load;\n\t}\n\tfunction publishConfigFailure(configPath, error) {\n\t\tsendDiagnostics({\n\t\t\turi: pathToFileURL(configPath).toString(),\n\t\t\tdiagnostics: [{\n\t\t\t\trange: {\n\t\t\t\t\tstart: {\n\t\t\t\t\t\tline: 0,\n\t\t\t\t\t\tcharacter: 0\n\t\t\t\t\t},\n\t\t\t\t\tend: {\n\t\t\t\t\t\tline: 0,\n\t\t\t\t\t\tcharacter: 1\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tmessage: configFailureMessage(error),\n\t\t\t\tcode: CONFIG_LOAD_FAILED_CODE,\n\t\t\t\tseverity: DiagnosticSeverity.Error,\n\t\t\t\tsource: \"prisma-next\"\n\t\t\t}]\n\t\t});\n\t}\n\tfunction configFailureMessage(error) {\n\t\tif (CliStructuredError.is(error)) return error.why ?? error.message;\n\t\treturn error instanceof Error ? error.message : String(error);\n\t}\n\tfunction clearConfigFailure(configPath) {\n\t\tsendDiagnostics({\n\t\t\turi: pathToFileURL(configPath).toString(),\n\t\t\tdiagnostics: []\n\t\t});\n\t}\n\tfunction isCurrentLoad(configPath, load) {\n\t\tconst entry = managedProjects.get(configPath);\n\t\treturn entry?.status === \"loading\" && entry.load === load;\n\t}\n\tasync function loadProject(configPath) {\n\t\tconst resolution = await resolveConfigInputs(configPath);\n\t\tconst artifacts = createProjectArtifacts({\n\t\t\tinputs: resolution.inputs,\n\t\t\tcontrolStack: resolution.controlStack,\n\t\t\tgetText: (uri) => documents.get(uri)?.getText(),\n\t\t\t...resolution.interpretation === void 0 ? {} : { interpretation: resolution.interpretation }\n\t\t});\n\t\treturn {\n\t\t\tconfigPath,\n\t\t\tinputs: resolution.inputs,\n\t\t\tcontrolStack: resolution.controlStack,\n\t\t\tartifacts,\n\t\t\t...resolution.formatter === void 0 ? {} : { formatter: resolution.formatter },\n\t\t\t...resolution.interpretation === void 0 ? {} : { interpretation: resolution.interpretation }\n\t\t};\n\t}\n\tfunction unmanageDocuments(configPath) {\n\t\tfor (const document of documents.all()) if (documentConfigPaths.get(document.uri) === configPath) documentConfigPaths.delete(document.uri);\n\t}\n\tasync function republishOpenDocumentsForConfig(configPath) {\n\t\tfor (const document of documents.all()) {\n\t\t\tif (documentConfigPaths.get(document.uri) === configPath) {\n\t\t\t\tif (await resolveProjectForDocument(document.uri) === void 0) {\n\t\t\t\t\tsendDiagnostics({\n\t\t\t\t\t\turi: document.uri,\n\t\t\t\t\t\tdiagnostics: []\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tawait publish(document.uri);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst filePath = filePathFromUri(document.uri);\n\t\t\tif (filePath === void 0) continue;\n\t\t\tif (await findNearestConfigPathForFile(filePath) === configPath) {\n\t\t\t\tdocumentConfigPaths.set(document.uri, configPath);\n\t\t\t\tawait publish(document.uri);\n\t\t\t}\n\t\t}\n\t}\n\tfunction publishSafely(uri) {\n\t\tpublish(uri).catch((error) => {\n\t\t\tif (disposed) return;\n\t\t\ttry {\n\t\t\t\tconnection.console.error(error instanceof Error ? error.message : String(error));\n\t\t\t} catch {}\n\t\t});\n\t}\n\tasync function formatDocument(uri) {\n\t\tconst document = documents.get(uri);\n\t\tif (document === void 0) return [];\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return [];\n\t\tconst source = document.getText();\n\t\tlet formatted;\n\t\ttry {\n\t\t\tformatted = format(source, project.formatter);\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\tif (formatted === source) return [];\n\t\treturn [{\n\t\t\trange: {\n\t\t\t\tstart: {\n\t\t\t\t\tline: 0,\n\t\t\t\t\tcharacter: 0\n\t\t\t\t},\n\t\t\t\tend: document.positionAt(source.length)\n\t\t\t},\n\t\t\tnewText: formatted\n\t\t}];\n\t}\n\tasync function semanticTokensForDocument(uri, range) {\n\t\tconst document = documents.get(uri);\n\t\tif (document === void 0) return emptySemanticTokens();\n\t\tif (document.getText().length > semanticTokenSourceLimit) return emptySemanticTokens();\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return emptySemanticTokens();\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\tif (artifacts === void 0) return emptySemanticTokens();\n\t\treturn buildSemanticTokens({\n\t\t\tdocument: artifacts.document,\n\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\tsymbolTable: project.artifacts.symbolTable(),\n\t\t\tscalarTypes: project.controlStack.scalarTypes\n\t\t}, range);\n\t}\n\tasync function completeDocument(uri, position) {\n\t\tif (documents.get(uri) === void 0) return [];\n\t\tconst project = await resolveProjectForDocument(uri);\n\t\tif (project === void 0) return [];\n\t\tconst artifacts = project.artifacts.document(uri);\n\t\tif (artifacts === void 0) return [];\n\t\ttry {\n\t\t\treturn [...providePslCompletionItems({\n\t\t\t\tcontext: classifyPslCompletionContext({\n\t\t\t\t\tdocument: artifacts.document,\n\t\t\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\t\t\tposition\n\t\t\t\t}),\n\t\t\t\tsourceFile: artifacts.sourceFile,\n\t\t\t\tcandidates: {\n\t\t\t\t\tscalarTypes: project.controlStack.scalarTypes,\n\t\t\t\t\tpslBlockDescriptors: project.controlStack.pslBlockDescriptors,\n\t\t\t\t\tsymbolTable: project.artifacts.symbolTable()\n\t\t\t\t},\n\t\t\t\tclientSupportsSnippets: clientCapabilities.completionSnippets\n\t\t\t})];\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\tconnection.onInitialize(async (params) => {\n\t\trootPath = resolveRootPath(params);\n\t\twatchedConfigGlob = join(rootPath, \"**\", CONFIG_FILENAME);\n\t\tclientCapabilities = resolveClientCapabilities(params);\n\t\treturn { capabilities: {\n\t\t\ttextDocumentSync: TextDocumentSyncKind.Incremental,\n\t\t\tdocumentFormattingProvider: true,\n\t\t\tfoldingRangeProvider: true,\n\t\t\tsemanticTokensProvider: {\n\t\t\t\tlegend: semanticTokensLegend,\n\t\t\t\tfull: true,\n\t\t\t\trange: true\n\t\t\t},\n\t\t\tcompletionProvider: { triggerCharacters: [\".\"] },\n\t\t\t...clientCapabilities.pullDiagnostics ? { diagnosticProvider: {\n\t\t\t\tinterFileDependencies: false,\n\t\t\t\tworkspaceDiagnostics: false\n\t\t\t} } : {}\n\t\t} };\n\t});\n\tconnection.onInitialized(() => {\n\t\tif (clientCapabilities.watchedFilesRegistration) connection.sendRequest(RegistrationRequest.type, { registrations: [{\n\t\t\tid: \"prisma-8-config-watcher\",\n\t\t\tmethod: DidChangeWatchedFilesNotification.type.method,\n\t\t\tregisterOptions: { watchers: [{ globPattern: watchedConfigGlob }] }\n\t\t}] }).catch(() => void 0);\n\t\telse logWarn(\"Client does not support dynamic file-watcher registration; Prisma Next config changes will not be picked up without a restart.\");\n\t});\n\tconnection.onDidChangeWatchedFiles(async (params) => {\n\t\tconst changedConfigPaths = configPathsFromWatchedChanges(params.changes.map((change) => filePathFromUri(change.uri)));\n\t\tfor (const configPath of changedConfigPaths) {\n\t\t\tif (managedProjects.has(configPath)) try {\n\t\t\t\tawait refreshProject(configPath);\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!clientCapabilities.pullDiagnostics) await republishOpenDocumentsForConfig(configPath);\n\t\t}\n\t\tif (clientCapabilities.pullDiagnostics && clientCapabilities.diagnosticsRefresh && changedConfigPaths.size > 0 && !disposed) connection.languages.diagnostics.refresh().catch(() => void 0);\n\t});\n\tconnection.onDocumentFormatting((params) => formatDocument(params.textDocument.uri));\n\tconnection.onCompletion((params) => completeDocument(params.textDocument.uri, params.position));\n\tconnection.languages.semanticTokens.on((params) => semanticTokensForDocument(params.textDocument.uri));\n\tconnection.languages.semanticTokens.onRange((params) => semanticTokensForDocument(params.textDocument.uri, params.range));\n\tconnection.languages.diagnostics.on(async (params) => {\n\t\tconst project = await resolveProjectForDocument(params.textDocument.uri);\n\t\tif (project === void 0) return {\n\t\t\tkind: DocumentDiagnosticReportKind.Full,\n\t\t\titems: []\n\t\t};\n\t\treturn buildDocumentDiagnosticReport(project, params.textDocument.uri);\n\t});\n\tconnection.onFoldingRanges(async (params) => {\n\t\tconst project = await resolveProjectForDocument(params.textDocument.uri);\n\t\tif (project === void 0) return [];\n\t\tconst artifacts = project.artifacts.document(params.textDocument.uri);\n\t\tif (artifacts === void 0) return [];\n\t\treturn computeFoldingRanges(artifacts.document, artifacts.sourceFile);\n\t});\n\tdocuments.onDidOpen((event) => {\n\t\tartifactsForDocument(event.document.uri)?.documentChanged(event.document.uri);\n\t\tif (clientCapabilities.pullDiagnostics) return;\n\t\tpublishSafely(event.document.uri);\n\t});\n\tdocuments.onDidChangeContent((event) => {\n\t\tartifactsForDocument(event.document.uri)?.documentChanged(event.document.uri);\n\t\tif (clientCapabilities.pullDiagnostics) return;\n\t\tpublishSafely(event.document.uri);\n\t});\n\tdocuments.onDidClose((event) => {\n\t\tconst uri = event.document.uri;\n\t\tconst configPath = documentConfigPaths.get(uri);\n\t\tartifactsForDocument(uri)?.documentClosed(uri);\n\t\tdocumentConfigPaths.delete(uri);\n\t\tif (configPath !== void 0) dropProjectWithoutManagedDocuments(configPath);\n\t\tif (!clientCapabilities.pullDiagnostics) sendDiagnostics({\n\t\t\turi,\n\t\t\tdiagnostics: []\n\t\t});\n\t});\n\tdocuments.listen(connection);\n\tconnection.listen();\n\tfunction artifactsForDocument(uri) {\n\t\tconst configPath = documentConfigPaths.get(uri);\n\t\tif (configPath === void 0) return;\n\t\tconst entry = managedProjects.get(configPath);\n\t\treturn entry?.status === \"loaded\" ? entry.project.artifacts : void 0;\n\t}\n\tfunction hasManagedDocuments(configPath) {\n\t\tfor (const managedConfigPath of documentConfigPaths.values()) if (managedConfigPath === configPath) return true;\n\t\treturn false;\n\t}\n\tfunction dropProjectWithoutManagedDocuments(configPath) {\n\t\tif (hasManagedDocuments(configPath)) return;\n\t\tconst entry = managedProjects.get(configPath);\n\t\tif (entry === void 0 || entry.status === \"loading\") return;\n\t\tmanagedProjects.delete(configPath);\n\t\tclearConfigFailure(configPath);\n\t}\n\treturn {\n\t\tdispose: () => {\n\t\t\tdisposed = true;\n\t\t\tconnection.dispose();\n\t\t},\n\t\tgetDocumentAst: (uri) => artifactsForDocument(uri)?.document(uri),\n\t\tgetProjectSymbolTable: (uri) => artifactsForDocument(uri)?.symbolTable()\n\t};\n}\nfunction emptySemanticTokens() {\n\treturn { data: [] };\n}\nfunction toDiagnostics(computed) {\n\treturn computed.map((diagnostic) => ({\n\t\trange: diagnostic.range,\n\t\tmessage: diagnostic.message,\n\t\tcode: diagnostic.code,\n\t\tseverity: toLspSeverity(diagnostic.severity),\n\t\tsource: \"prisma-next\"\n\t}));\n}\nfunction toLspSeverity(severity) {\n\tswitch (severity) {\n\t\tcase ParseDiagnosticSeverity.Warning: return DiagnosticSeverity.Warning;\n\t\tcase ParseDiagnosticSeverity.Information: return DiagnosticSeverity.Information;\n\t\tcase ParseDiagnosticSeverity.Hint: return DiagnosticSeverity.Hint;\n\t\tdefault: return DiagnosticSeverity.Error;\n\t}\n}\nconst noClientCapabilities = {\n\twatchedFilesRegistration: false,\n\tcompletionSnippets: false,\n\tpullDiagnostics: false,\n\tdiagnosticsRefresh: false\n};\nfunction resolveClientCapabilities(params) {\n\treturn {\n\t\twatchedFilesRegistration: params.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration === true,\n\t\tcompletionSnippets: params.capabilities.textDocument?.completion?.completionItem?.snippetSupport === true,\n\t\tpullDiagnostics: params.capabilities.textDocument?.diagnostic !== void 0,\n\t\tdiagnosticsRefresh: params.capabilities.workspace?.diagnostics?.refreshSupport === true\n\t};\n}\nfunction resolveRootPath(params) {\n\tconst workspaceFolder = params.workspaceFolders?.[0];\n\tif (workspaceFolder !== void 0) return fileURLToPath(workspaceFolder.uri);\n\tif (params.rootUri) return fileURLToPath(params.rootUri);\n\tif (params.rootPath) return params.rootPath;\n\treturn process.cwd();\n}\nfunction filePathFromUri(uri) {\n\ttry {\n\t\treturn fileURLToPath(uri);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction configPathsFromWatchedChanges(paths) {\n\tconst configPaths = /* @__PURE__ */ new Set();\n\tfor (const path of paths) if (path?.endsWith(\"prisma-next.config.ts\")) configPaths.add(path);\n\treturn configPaths;\n}\n//#endregion\n//#region src/start-server.ts\nfunction startServer() {\n\treturn createServer(createConnection(ProposedFeatures.all));\n}\n//#endregion\nexport { ParseDiagnosticSeverity, createServer, mapParseDiagnostics, startServer };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,0BAA0B;CAC/B,OAAO;CACP,SAAS;CACT,aAAa;CACb,MAAM;AACP;AACA,SAAS,oBAAoB,aAAa;CACzC,OAAO,YAAY,KAAK,gBAAgB;EACvC,OAAO,WAAW;EAClB,SAAS,WAAW;EACpB,MAAM,WAA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ACR;AAGA,SAAS,cAAc;CACtB,OAAO,aAAa,iBAAiB,iBAAiB,GAAG,CAAC;AAC3D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getEmittedArtifactPaths } from "./exports-
|
|
1
|
+
import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-okAfZydo.mjs";
|
|
2
2
|
import { CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorUnexpected } from "@prisma/orm-framework/errors/control";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
4
|
import { dirname, join, resolve } from "pathe";
|
|
@@ -116,4 +116,4 @@ async function loadConfigForFile(filePath) {
|
|
|
116
116
|
//#endregion
|
|
117
117
|
export { loadConfigForFile as i, findNearestConfigPathForFile as n, loadConfig as r, finalizeConfig as t };
|
|
118
118
|
|
|
119
|
-
//# sourceMappingURL=exports-
|
|
119
|
+
//# sourceMappingURL=exports-CDX9kZuw.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports-
|
|
1
|
+
{"version":3,"file":"exports-CDX9kZuw.mjs","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs"],"sourcesContent":["import { normalizeContractConfig } from \"@internal/config/config-types\";\nimport { dirname, join, resolve } from \"pathe\";\nimport { access } from \"node:fs/promises\";\nimport { validateConfig } from \"@internal/config/config-validation\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorUnexpected } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\n//#region src/finalize-config.ts\nfunction finalizeContractSource(source, configDir) {\n\tconst resolvedInputs = source.inputs?.map((input) => resolve(configDir, input));\n\tif (resolvedInputs === void 0) return source;\n\treturn {\n\t\t...source,\n\t\tinputs: resolvedInputs\n\t};\n}\nfunction finalizeConfig(config, configDir) {\n\tif (!config.contract) return config;\n\tconst contract = normalizeContractConfig(config.contract);\n\tconst source = finalizeContractSource(contract.source, configDir);\n\tconst output = resolve(configDir, contract.output);\n\treturn {\n\t\t...config,\n\t\tcontract: {\n\t\t\t...contract,\n\t\t\tsource,\n\t\t\toutput\n\t\t}\n\t};\n}\n//#endregion\n//#region src/load.ts\nconst CONFIG_FILENAME = \"prisma-next.config.ts\";\nfunction throwValidation(field, why) {\n\tthrow structuredError(\"CONFIG.VALIDATION_FAILED\", why, {\n\t\twhy,\n\t\tmeta: { field }\n\t});\n}\nfunction validateNoOutputsAreInputs(inputs, output) {\n\tif (inputs === void 0 || output === void 0) return;\n\tlet emittedArtifactPaths;\n\ttry {\n\t\temittedArtifactPaths = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\tthrowValidation(\"contract.output\", error instanceof Error ? error.message : String(error));\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([emittedArtifactPaths.jsonPath, emittedArtifactPaths.dtsPath]);\n\tfor (const input of inputs) if (emittedPaths.has(input)) throwValidation(\"contract.source.inputs[]\", \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\");\n}\nasync function findNearestConfigPathForFile(filePath) {\n\tlet current = dirname(resolve(process.cwd(), filePath));\n\twhile (true) {\n\t\tconst candidate = join(current, CONFIG_FILENAME);\n\t\tif (await fileExists(candidate)) return candidate;\n\t\tconst parent = dirname(current);\n\t\tif (parent === current) return;\n\t\tcurrent = parent;\n\t}\n}\nasync function fileExists(path) {\n\ttry {\n\t\tawait access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nasync function discoverAndFinalizeConfig(configPath) {\n\tconst cwd = process.cwd();\n\tconst resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;\n\tconst configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;\n\tconst result = await (await import(\"c12\")).loadConfig({\n\t\tname: \"prisma-next\",\n\t\t...ifDefined(\"configFile\", resolvedConfigPath),\n\t\tcwd: configCwd\n\t});\n\tif (resolvedConfigPath && result.configFile !== resolvedConfigPath) throw errorConfigFileNotFound(resolvedConfigPath);\n\tif (!result.config || Object.keys(result.config).length === 0) throw errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath);\n\tvalidateConfig(result.config);\n\t/* v8 ignore next -- @preserve */\n\tconst loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;\n\tconst config = finalizeConfig(result.config, loadedConfigDir);\n\tvalidateNoOutputsAreInputs(config.contract?.source.inputs, config.contract?.output);\n\treturn config;\n}\nfunction hasStringCode(error) {\n\treturn \"code\" in error && typeof error.code === \"string\";\n}\nfunction toStructuredConfigError(error, configPath) {\n\tif (isStructuredError(error) && error.code === \"CONFIG.VALIDATION_FAILED\" && !(error instanceof CliStructuredError)) return errorConfigValidation(typeof error.meta?.[\"field\"] === \"string\" ? error.meta[\"field\"] : \"config\", { why: error.why ?? error.message });\n\tif (error instanceof Error && hasStringCode(error)) return error;\n\tif (error instanceof Error) {\n\t\tif (error.message.includes(\"not found\") || error.message.includes(\"Cannot find\") || error.message.includes(\"ENOENT\")) return errorConfigFileNotFound(configPath ? resolve(process.cwd(), configPath) : void 0, { why: error.message });\n\t\treturn errorUnexpected(error.message, { why: `Failed to load config: ${error.message}` });\n\t}\n\treturn errorUnexpected(String(error));\n}\n/**\n* Loads, validates, and finalizes the Prisma Next config, mapping every failure\n* to a structured `@internal/errors/control` error (`CliStructuredError`).\n* This is the sole public entry point: callers that need to degrade gracefully\n* (e.g. the language server) branch on the structured error's stable `.code`.\n*/\nasync function loadConfig(configPath) {\n\ttry {\n\t\treturn await discoverAndFinalizeConfig(configPath);\n\t} catch (error) {\n\t\tthrow toStructuredConfigError(error, configPath);\n\t}\n}\nasync function loadConfigForFile(filePath) {\n\tconst configPath = await findNearestConfigPathForFile(filePath);\n\tif (configPath === void 0) throw errorConfigFileNotFound(join(dirname(resolve(process.cwd(), filePath)), CONFIG_FILENAME));\n\treturn loadConfig(configPath);\n}\n//#endregion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D,IAAI,iBAAiB,OAAO;EAC3B,IAAI,MAAM,QAAQ,SAAS,WAAW,KAAK,MAAM,QAAQ,SAAS,aAAa,KAAK,MAAM,QAAQ,SAAS,QAAQ,GAAG,OAAO,wBAAwB,aAAa,QAAQ,QAAQ,IAAI,GAAG,UAAU,IAAI,KAAK,GAAG,EAAE,KAAK,MAAM,QAAQ,CAAC;EACrO,OAAO,gBAAgB,MAAM,SAAS,EAAE,KAAK,0BAA0B,MAAM,UAAU,CAAC;CACzF;CACA,OAAO,gBAAgB,OAAO,KAAK,CAAC;AACrC;;;;;;;AAOA,eAAe,WAAW,YAAY;CACrC,IAAI;EACH,OAAO,MAAM,0BAA0B,UAAU;CAClD,SAAS,OAAO;EACf,MAAM,wBAAwB,OAAO,UAAU;CAChD;AACD;AACA,eAAe,kBAAkB,UAAU;CAC1C,MAAM,aAAa,MAAM,6BAA6B,QAAQ;CAC9D,IAAI,eAAe,KAAK,GAAG,MAAM,wBAAwB,KAAK,QAAQ,QAAQ,QAAQ,IAAI,GAAG,QAAQ,CAAC,GAAG,eAAe,CAAC;CACzH,OAAO,WAAW,UAAU;AAC7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { N as errorUnexpected, O as errorRuntime$1, W as formatStyledHeader, ct as setCommandExamples, o as createTerminalUI, q as handleResult, r as addGlobalOptions, st as setCommandDescriptions, t as CliStructuredError$1, tt as parseGlobalFlagsOrExit } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
|
|
2
|
-
import { r as loadConfig } from "./exports-
|
|
2
|
+
import { r as loadConfig } from "./exports-CDX9kZuw.mjs";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
4
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
5
5
|
import { relative, resolve } from "pathe";
|
|
@@ -98,4 +98,4 @@ function createFormatCommand() {
|
|
|
98
98
|
//#endregion
|
|
99
99
|
export { createFormatCommand as t };
|
|
100
100
|
|
|
101
|
-
//# sourceMappingURL=format-ByDm2goZ-
|
|
101
|
+
//# sourceMappingURL=format-ByDm2goZ-BIRlFoo6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-ByDm2goZ-
|
|
1
|
+
{"version":3,"file":"format-ByDm2goZ-BIRlFoo6.mjs","names":["CliStructuredError","errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/format-ByDm2goZ.mjs"],"sourcesContent":["import { A as formatStyledHeader, F as CliStructuredError, _ as createTerminalUI, ct as errorUnexpected, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, rt as errorRuntime, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { relative, resolve } from \"pathe\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { EOL } from \"node:os\";\nimport { format } from \"@internal/psl-parser/format\";\n//#region src/control-api/operations/format.ts\nfunction resolveNewline(formatterNewline, eol) {\n\tif (formatterNewline !== void 0) return formatterNewline;\n\treturn eol === \"\\r\\n\" ? \"CRLF\" : \"LF\";\n}\nasync function executeFormat(options) {\n\tconst eol = options.eol ?? EOL;\n\tlet config;\n\ttry {\n\t\tconfig = await loadConfig(options.configPath);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));\n\t}\n\tconst source = config.contract?.source;\n\tif (source?.format !== \"psl\") return ok({ formatted: false });\n\tconst inputPath = source.inputs?.[0];\n\tif (inputPath === void 0) return ok({ formatted: false });\n\tlet contents;\n\ttry {\n\t\tcontents = await readFile(inputPath, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"Failed to read contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} exists and is readable.`\n\t\t}));\n\t}\n\tconst formatOptions = {\n\t\tindent: config.formatter?.indent ?? 2,\n\t\tnewline: resolveNewline(config.formatter?.newline, eol)\n\t};\n\tlet formatted;\n\ttry {\n\t\tformatted = format(contents, formatOptions);\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"PSL.PARSE_FAILED\") return notOk(errorRuntime(\"Cannot format PSL with parse errors\", {\n\t\t\twhy: error.message,\n\t\t\tfix: \"Fix the parse errors in your schema and try again.\",\n\t\t\tmeta: { diagnostics: error.meta?.[\"diagnostics\"] }\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));\n\t}\n\ttry {\n\t\tawait writeFile(inputPath, formatted, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"Failed to write formatted contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} is writable.`\n\t\t}));\n\t}\n\treturn ok({\n\t\tformatted: true,\n\t\tpath: inputPath\n\t});\n}\n//#endregion\n//#region src/commands/format.ts\nfunction createFormatCommand() {\n\tconst command = new Command(\"format\");\n\tsetCommandDescriptions(command, \"Format your PSL contract source\", \"Formats the Prisma schema (PSL) contract source declared in your config\\n(contract.source.inputs[0]) in place. Only runs when contract.source.format\\nis 'psl'; a TypeScript or unset source is left untouched. Indent and newline are\\nread from the optional formatter config section, defaulting to two spaces and the\\nsystem newline.\");\n\tsetCommandExamples(command, [\"prisma-next format\", \"prisma-next format --config ./custom-config.ts\"]);\n\taddGlobalOptions(command).option(\"--config <path>\", \"Path to prisma-next.config.ts\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (!flags.json && !flags.quiet) {\n\t\t\tconst displayConfigPath = options.config ? relative(process.cwd(), resolve(options.config)) : \"prisma-next.config.ts\";\n\t\t\tui.stderr(formatStyledHeader({\n\t\t\t\tcommand: \"format\",\n\t\t\t\tdescription: \"Format your PSL contract source\",\n\t\t\t\tdetails: [{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: displayConfigPath\n\t\t\t\t}],\n\t\t\t\tflags\n\t\t\t}));\n\t\t}\n\t\tconst exitCode = handleResult(await executeFormat({ ...ifDefined(\"configPath\", options.config) }), flags, ui, (value) => {\n\t\t\tif (flags.json) {\n\t\t\t\tui.output(JSON.stringify(value));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (flags.quiet) return;\n\t\t\tif (value.formatted) ui.success(`Formatted ${relative(process.cwd(), value.path ?? \"\")}`);\n\t\t\telse ui.info(\"Nothing to format (contract source is not PSL).\");\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createFormatCommand as t };\n\n//# sourceMappingURL=format-ByDm2goZ.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,eAAe,kBAAkB,KAAK;CAC9C,IAAI,qBAAqB,KAAK,GAAG,OAAO;CACxC,OAAO,QAAQ,SAAS,SAAS;AAClC;AACA,eAAe,cAAc,SAAS;CACrC,MAAM,MAAM,QAAQ,OAAO;CAC3B,IAAI;CACJ,IAAI;EACH,SAAS,MAAM,WAAW,QAAQ,UAAU;CAC7C,SAAS,OAAO;EACf,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,OAAO,MAAM,gBAAgB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,CAAC;CACrF;CACA,MAAM,SAAS,OAAO,UAAU;CAChC,IAAI,QAAQ,WAAW,OAAO,OAAO,GAAG,EAAE,WAAW,MAAM,CAAC;CAC5D,MAAM,YAAY,OAAO,SAAS;CAClC,IAAI,cAAc,KAAK,GAAG,OAAO,GAAG,EAAE,WAAW,MAAM,CAAC;CACxD,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,SAAS,WAAW,O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