@cratis/screenplay-language 4.218.1 → 4.219.0

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.
Files changed (56) hide show
  1. package/dist/bundles/code-actions.js +1 -1
  2. package/dist/bundles/code-actions.js.map +1 -1
  3. package/dist/bundles/compiler/Authoring/QuickFixes.js +1 -1
  4. package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
  5. package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js +7 -0
  6. package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js.map +1 -0
  7. package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js +5 -0
  8. package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js.map +1 -0
  9. package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js +2 -0
  10. package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js.map +1 -0
  11. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
  12. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
  13. package/dist/bundles/compiler/Files/AuthoredOrder.js +1 -1
  14. package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -1
  15. package/dist/bundles/compiler/Files/OrderingRoot.js +2 -1
  16. package/dist/bundles/compiler/Files/OrderingRoot.js.map +1 -0
  17. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
  18. package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
  19. package/dist/bundles/compiler/Files/PlayDocumentSource.js +2 -0
  20. package/dist/bundles/compiler/Files/PlayDocumentSource.js.map +1 -0
  21. package/dist/bundles/compiler/Files/PlayGlob.js +2 -0
  22. package/dist/bundles/compiler/Files/PlayGlob.js.map +1 -0
  23. package/dist/bundles/compiler/Files/PlayImports.js +2 -1
  24. package/dist/bundles/compiler/Files/PlayImports.js.map +1 -0
  25. package/dist/bundles/compiler/Files/PlayPlacement.js +1 -1
  26. package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -1
  27. package/dist/bundles/compiler/Files/TimelineOrder.js +1 -1
  28. package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -1
  29. package/dist/bundles/compiler/Parsing/ImportDiscovery.js +2 -1
  30. package/dist/bundles/compiler/Parsing/ImportDiscovery.js.map +1 -0
  31. package/dist/bundles/compiler/Parsing/MatchAmbiguity.js +2 -0
  32. package/dist/bundles/compiler/Parsing/MatchAmbiguity.js.map +1 -0
  33. package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js +2 -0
  34. package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js.map +1 -0
  35. package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js +2 -0
  36. package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js.map +1 -0
  37. package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js +2 -0
  38. package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js.map +1 -0
  39. package/dist/bundles/compiler/Parsing/MatchOperandValidation.js +1 -1
  40. package/dist/bundles/compiler/Parsing/MatchOperandValidation.js.map +1 -1
  41. package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js +2 -0
  42. package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js.map +1 -0
  43. package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js +2 -0
  44. package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js.map +1 -0
  45. package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
  46. package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
  47. package/dist/bundles/compiler/index.js +1 -1
  48. package/dist/bundles/diagnostic-codes.js +1 -1
  49. package/dist/bundles/diagnostic-codes.js.map +1 -1
  50. package/dist/bundles/validation.js +1 -1
  51. package/dist/bundles/validation.js.map +1 -1
  52. package/dist/code-actions.d.ts +2 -2
  53. package/dist/code-actions.d.ts.map +1 -1
  54. package/dist/diagnostic-codes.d.ts +1 -0
  55. package/dist/diagnostic-codes.d.ts.map +1 -1
  56. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import"./_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"./compiler/Diagnostics/DiagnosticCodes.js";import{isQuickFixDiagnostic as t,prepareQuickFixes as n}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";const r=`source.screenplay.migrateOptional`,i=`source.screenplay.migrateCompliance`,migrationKind=t=>t===e.LegacyComplianceMarker?i:r,containsKind=(e,t)=>e===``||e===t||t.startsWith(`${e}.`);function intersects(e,t){return(e.startLineNumber<t.endLineNumber||e.startLineNumber===t.endLineNumber&&e.startColumn<=t.endColumn)&&(t.startLineNumber<e.endLineNumber||t.startLineNumber===e.endLineNumber&&t.startColumn<=e.endColumn)}function createCodeActionProvider(a){let o=/* @__PURE__ */ new WeakMap;return{provideCodeActions(s,c,l,u){let d=l.only!==void 0&&[r,i].some(e=>containsKind(l.only,e)),f=l.only!==void 0&&d&&!containsKind(l.only,`quickfix`);if(u.isCancellationRequested||l.only!==void 0&&!d&&!containsKind(l.only,`quickfix`))return{actions:[],dispose(){}};let p=l.markers.filter(e=>{let n=typeof e.code==`object`?e.code.value:e.code;return t(n)&&intersects(e,c)});if(!d&&p.length===0)return{actions:[],dispose(){}};let m=s.getVersionId(),h=JSON.stringify(a)??``,g=o.get(s);(g?.version!==m||g.placement!==h)&&(g={version:m,placement:h,fixes:n(s.getValue(),{placement:a})},o.set(s,g));let _=[...f?[]:g.fixes(p.map(e=>({line:e.startLineNumber,diagnosticCode:String(typeof e.code==`object`?e.code.value:e.code)}))).filter(e=>e.scope===`occurrence`),...l.only===void 0||d?[e.LegacyOptionalSuffix,e.LegacyComplianceMarker].flatMap(e=>g.fixes(void 0,e)):[]].filter(e=>l.only===void 0||containsKind(l.only,e.scope===`document`?migrationKind(e.diagnosticCode):`quickfix`));return u.isCancellationRequested||s.getVersionId()!==m?{actions:[],dispose(){}}:{actions:_.map(e=>({title:e.title,kind:e.scope===`document`?migrationKind(e.diagnosticCode):`quickfix`,isPreferred:e.scope===`occurrence`,edit:{edits:e.edits.map(e=>{let t=s.getPositionAt(e.start),n=s.getPositionAt(e.start+e.length);return{resource:s.uri,versionId:m,textEdit:{range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:n.lineNumber,endColumn:n.column},text:e.text}}})}})),dispose(){}}}}}export{createCodeActionProvider};
1
+ import"./_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"./compiler/Diagnostics/DiagnosticCodes.js";import{isQuickFixDiagnostic as t,prepareQuickFixes as n}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";const r=`source.screenplay.migrateOptional`,i=`source.screenplay.migrateCompliance`,migrationKind=t=>t===e.LegacyComplianceMarker?i:r,containsKind=(e,t)=>e===``||e===t||t.startsWith(`${e}.`);function intersects(e,t){return(e.startLineNumber<t.endLineNumber||e.startLineNumber===t.endLineNumber&&e.startColumn<=t.endColumn)&&(t.startLineNumber<e.endLineNumber||t.startLineNumber===e.endLineNumber&&t.startColumn<=e.endColumn)}function createCodeActionProvider(a,o){let s=/* @__PURE__ */ new WeakMap;return{provideCodeActions(c,l,u,d){let f=u.only!==void 0&&[r,i].some(e=>containsKind(u.only,e)),p=u.only!==void 0&&f&&!containsKind(u.only,`quickfix`);if(d.isCancellationRequested||u.only!==void 0&&!f&&!containsKind(u.only,`quickfix`))return{actions:[],dispose(){}};let m=u.markers.filter(e=>{let n=typeof e.code==`object`?e.code.value:e.code;return t(n)&&intersects(e,l)});if(!f&&m.length===0)return{actions:[],dispose(){}};let h=c.getVersionId(),g=o?.(),_=g===void 0?void 0:[...g].find(([,e])=>e===c)?.[0];if(g!==void 0&&_===void 0)return{actions:[],dispose(){}};let v=new Map([...g?.values()??[c]].map(e=>[e,e.getVersionId()])),y=JSON.stringify([a,g===void 0?void 0:[...g].map(([e,t])=>[e,t.uri.toString(),v.get(t)])]),b=s.get(c);(b?.version!==h||b.placement!==y)&&(b={version:h,placement:y,fixes:n(c.getValue(),{placement:a,path:_,documents:g===void 0?void 0:new Map([...g].map(([e,t])=>[e,t.getValue()]))})},s.set(c,b));let x=[...p?[]:b.fixes(m.map(e=>({line:e.startLineNumber,diagnosticCode:String(typeof e.code==`object`?e.code.value:e.code)}))).filter(e=>e.scope===`occurrence`),...u.only===void 0||f?[e.LegacyOptionalSuffix,e.LegacyComplianceMarker].flatMap(e=>b.fixes(void 0,e)):[]].filter(e=>u.only===void 0||containsKind(u.only,e.scope===`document`?migrationKind(e.diagnosticCode):`quickfix`));return d.isCancellationRequested||[...v].some(([e,t])=>e.getVersionId()!==t)?{actions:[],dispose(){}}:{actions:x.filter(e=>e.edits.every(e=>e.path===void 0||g?.has(e.path))).map(t=>({title:t.title,kind:t.scope===`document`?migrationKind(t.diagnosticCode):`quickfix`,isPreferred:t.scope===`occurrence`,edit:{edits:t.edits.map(e=>{let t=e.path===void 0?c:g.get(e.path),n=t.getPositionAt(e.start),r=t.getPositionAt(e.start+e.length);return{resource:t.uri,versionId:v.get(t),textEdit:{range:{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:r.lineNumber,endColumn:r.column},text:e.text}}}).concat(t.diagnosticCode!==e.EventFromLaterSlice||g===void 0?[]:[...g].filter(([e])=>!t.edits.some(t=>t.path===e)).map(([,e])=>({resource:e.uri,versionId:v.get(e),textEdit:{range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},text:``}})))}})),dispose(){}}}}}export{createCodeActionProvider};
2
2
  //# sourceMappingURL=code-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-actions.js","names":["migrateOptional","migrateCompliance","code","DiagnosticCodes","requested","kind","left","right","cache","migrationRequested","context","migrationOnly","token","diagnostics","marker","isQuickFixDiagnostic","range","version","model","placementKey","placement","analysis","prepareQuickFixes","fixes","diagnostic","fix","start","edit","end"],"sources":["../../code-actions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor, IRange, languages } from 'monaco-editor';\nimport { DiagnosticCodes, isQuickFixDiagnostic, prepareQuickFixes } from '@cratis/screenplay-compiler';\n\nconst migrateOptional = 'source.screenplay.migrateOptional';\nconst migrateCompliance = 'source.screenplay.migrateCompliance';\nconst migrationKind = (code: string) => code === DiagnosticCodes.LegacyComplianceMarker ? migrateCompliance : migrateOptional;\nconst containsKind = (requested: string, kind: string) => requested === '' || requested === kind || kind.startsWith(`${requested}.`);\n\nfunction intersects(left: IRange, right: IRange): boolean {\n return (left.startLineNumber < right.endLineNumber || (left.startLineNumber === right.endLineNumber && left.startColumn <= right.endColumn)) &&\n (right.startLineNumber < left.endLineNumber || (right.startLineNumber === left.endLineNumber && right.startColumn <= left.endColumn));\n}\n\n// The compiler owns recipes and verification. The adapter only translates verified offsets and pins\n// edits to the analyzed buffer version, so future fixes need no editor-specific parsing or .NET bridge.\nexport function createCodeActionProvider(placement?: readonly string[]): languages.CodeActionProvider {\n const cache = new WeakMap<editor.ITextModel, { version: number; placement: string; fixes: ReturnType<typeof prepareQuickFixes> }>();\n return {\n provideCodeActions(model, range, context, token) {\n const migrationRequested = context.only !== undefined && [migrateOptional, migrateCompliance].some(kind => containsKind(context.only!, kind));\n const migrationOnly = context.only !== undefined && migrationRequested && !containsKind(context.only, 'quickfix');\n if (token.isCancellationRequested || (context.only !== undefined && !migrationRequested && !containsKind(context.only, 'quickfix'))) return { actions: [], dispose() {} };\n const diagnostics = context.markers.filter(marker => {\n const code = typeof marker.code === 'object' ? marker.code.value : marker.code;\n return isQuickFixDiagnostic(code) && intersects(marker, range);\n });\n if (!migrationRequested && diagnostics.length === 0) return { actions: [], dispose() {} };\n const version = model.getVersionId();\n const placementKey = JSON.stringify(placement) ?? '';\n let analysis = cache.get(model);\n if (analysis?.version !== version || analysis.placement !== placementKey) {\n analysis = { version, placement: placementKey, fixes: prepareQuickFixes(model.getValue(), { placement }) };\n cache.set(model, analysis);\n }\n const occurrences = migrationOnly ? [] : analysis.fixes(diagnostics.map(diagnostic => ({\n line: diagnostic.startLineNumber,\n diagnosticCode: String(typeof diagnostic.code === 'object' ? diagnostic.code.value : diagnostic.code),\n }))).filter(fix => fix.scope === 'occurrence');\n const requested = [...occurrences, ...(context.only === undefined || migrationRequested ? [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker].flatMap(code => analysis.fixes(undefined, code)) : [])];\n const fixes = requested.filter(fix => context.only === undefined || containsKind(context.only, fix.scope === 'document' ? migrationKind(fix.diagnosticCode) : 'quickfix'));\n if (token.isCancellationRequested || model.getVersionId() !== version) return { actions: [], dispose() {} };\n return {\n actions: fixes.map(fix => ({\n title: fix.title,\n kind: fix.scope === 'document' ? migrationKind(fix.diagnosticCode) : 'quickfix',\n isPreferred: fix.scope === 'occurrence',\n edit: { edits: fix.edits.map(edit => {\n const start = model.getPositionAt(edit.start);\n const end = model.getPositionAt(edit.start + edit.length);\n return { resource: model.uri, versionId: version, textEdit: {\n range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column },\n text: edit.text,\n } };\n }) },\n })),\n dispose() {},\n };\n },\n };\n}\n"],"mappings":"0PAMA,MAAMA,EAAkB,oCAClBC,EAAoB,sCACpB,cAAiB,GAAiBC,IAASC,EAAgB,uBAAyBF,EAAoBD,EACxG,cAAgB,EAAmB,IAAiBI,IAAc,IAAMA,IAAcC,GAAQA,EAAK,WAAW,GAAGD,EAAU,EAAE,EAEnI,SAAS,WAAW,EAAc,EAAwB,CACtD,OAAQE,EAAK,gBAAkBC,EAAM,eAAkBD,EAAK,kBAAoBC,EAAM,eAAiBD,EAAK,aAAeC,EAAM,aAC5HA,EAAM,gBAAkBD,EAAK,eAAkBC,EAAM,kBAAoBD,EAAK,eAAiBC,EAAM,aAAeD,EAAK,UAClI,CAIA,SAAgB,yBAAyB,EAA6D,CAClG,IAAME,kBAAQ,IAAI,QAClB,MAAO,CACH,m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AaD,EAAqB,CAACN,EAAgB,qBAAsBA,EAAgB,sBAAsB,CAAC,CAAC,QAAQ,GAAQkB,EAAS,MAAM,IAAA,GAAWnB,CAAI,CAAC,EAAI,CAAC,CACvM,CAAC,CAAC,OAAO,GAAOQ,EAAQ,OAAS,IAAA,IAAa,aAAaA,EAAQ,KAAMe,EAAI,QAAU,WAAa,cAAcA,EAAI,cAAc,EAAI,UAAU,CAAC,EAEzK,OADIb,EAAM,yBAA2BM,EAAM,aAAa,IAAMD,EAAgB,CAAE,QAAS,CAAC,EAAG,SAAU,CAAC,CAAE,EACnG,CACH,QAASM,EAAM,IAAI,IAAQ,CACvB,MAAOE,EAAI,MACX,KAAMA,EAAI,QAAU,WAAa,cAAcA,EAAI,cAAc,EAAI,WACrE,YAAaA,EAAI,QAAU,aAC3B,KAAM,CAAE,MAAOA,EAAI,MAAM,IAAI,GAAQ,CACjC,IAAMC,EAAQR,EAAM,cAAcS,EAAK,KAAK,EACtCC,EAAMV,EAAM,cAAcS,EAAK,MAAQA,EAAK,MAAM,EACxD,MAAO,CAAE,SAAUT,EAAM,IAAK,UAAWD,EAAS,SAAU,CACxD,MAAO,CAAE,gBAAiBS,EAAM,WAAY,YAAaA,EAAM,OAAQ,cAAeE,EAAI,WAAY,UAAWA,EAAI,MAAO,EAC5H,KAAMD,EAAK,IACf,CAAE,CACN,CAAC,CAAE,CACP,EAAE,EACF,SAAU,CAAC,CACf,CACJ,CACJ,CACJ"}
1
+ {"version":3,"file":"code-actions.js","names":["migrateOptional","migrateCompliance","code","DiagnosticCodes","requested","kind","left","right","cache","migrationRequested","context","migrationOnly","token","diagnostics","marker","isQuickFixDiagnostic","range","version","model","models","applicationModels","path","document","versions","placementKey","placement","analysis","prepareQuickFixes","fixes","diagnostic","fix","edit","start","end"],"sources":["../../code-actions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor, IRange, languages } from 'monaco-editor';\nimport { DiagnosticCodes, isQuickFixDiagnostic, prepareQuickFixes } from '@cratis/screenplay-compiler';\n\nconst migrateOptional = 'source.screenplay.migrateOptional';\nconst migrateCompliance = 'source.screenplay.migrateCompliance';\nconst migrationKind = (code: string) => code === DiagnosticCodes.LegacyComplianceMarker ? migrateCompliance : migrateOptional;\nconst containsKind = (requested: string, kind: string) => requested === '' || requested === kind || kind.startsWith(`${requested}.`);\n\nfunction intersects(left: IRange, right: IRange): boolean {\n return (left.startLineNumber < right.endLineNumber || (left.startLineNumber === right.endLineNumber && left.startColumn <= right.endColumn)) &&\n (right.startLineNumber < left.endLineNumber || (right.startLineNumber === left.endLineNumber && right.startColumn <= left.endColumn));\n}\n\n// The compiler owns recipes and verification. The adapter only translates verified offsets and pins\n// edits to the analyzed buffer version, so future fixes need no editor-specific parsing or .NET bridge.\nexport function createCodeActionProvider(placement?: readonly string[], applicationModels?: () => ReadonlyMap<string, editor.ITextModel>): languages.CodeActionProvider {\n const cache = new WeakMap<editor.ITextModel, { version: number; placement: string; fixes: ReturnType<typeof prepareQuickFixes> }>();\n return {\n provideCodeActions(model, range, context, token) {\n const migrationRequested = context.only !== undefined && [migrateOptional, migrateCompliance].some(kind => containsKind(context.only!, kind));\n const migrationOnly = context.only !== undefined && migrationRequested && !containsKind(context.only, 'quickfix');\n if (token.isCancellationRequested || (context.only !== undefined && !migrationRequested && !containsKind(context.only, 'quickfix'))) return { actions: [], dispose() {} };\n const diagnostics = context.markers.filter(marker => {\n const code = typeof marker.code === 'object' ? marker.code.value : marker.code;\n return isQuickFixDiagnostic(code) && intersects(marker, range);\n });\n if (!migrationRequested && diagnostics.length === 0) return { actions: [], dispose() {} };\n const version = model.getVersionId();\n const models = applicationModels?.();\n const path = models === undefined ? undefined : [...models].find(([, document]) => document === model)?.[0];\n if (models !== undefined && path === undefined) return { actions: [], dispose() {} };\n const versions = new Map([...(models?.values() ?? [model])].map(document => [document, document.getVersionId()]));\n const placementKey = JSON.stringify([placement, models === undefined ? undefined : [...models].map(([path, document]) => [path, document.uri.toString(), versions.get(document)])]);\n let analysis = cache.get(model);\n if (analysis?.version !== version || analysis.placement !== placementKey) {\n analysis = { version, placement: placementKey, fixes: prepareQuickFixes(model.getValue(), { placement, path, documents: models === undefined ? undefined : new Map([...models].map(([path, document]) => [path, document.getValue()])) }) };\n cache.set(model, analysis);\n }\n const occurrences = migrationOnly ? [] : analysis.fixes(diagnostics.map(diagnostic => ({\n line: diagnostic.startLineNumber,\n diagnosticCode: String(typeof diagnostic.code === 'object' ? diagnostic.code.value : diagnostic.code),\n }))).filter(fix => fix.scope === 'occurrence');\n const requested = [...occurrences, ...(context.only === undefined || migrationRequested ? [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker].flatMap(code => analysis.fixes(undefined, code)) : [])];\n const fixes = requested.filter(fix => context.only === undefined || containsKind(context.only, fix.scope === 'document' ? migrationKind(fix.diagnosticCode) : 'quickfix'));\n if (token.isCancellationRequested || [...versions].some(([document, version]) => document.getVersionId() !== version)) return { actions: [], dispose() {} };\n const supported = fixes.filter(fix => fix.edits.every(edit => edit.path === undefined || models?.has(edit.path)));\n return {\n actions: supported.map(fix => ({\n title: fix.title,\n kind: fix.scope === 'document' ? migrationKind(fix.diagnosticCode) : 'quickfix',\n isPreferred: fix.scope === 'occurrence',\n edit: { edits: fix.edits.map(edit => {\n const document = edit.path === undefined ? model : models!.get(edit.path)!;\n const start = document.getPositionAt(edit.start);\n const end = document.getPositionAt(edit.start + edit.length);\n return { resource: document.uri, versionId: versions.get(document)!, textEdit: {\n range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column },\n text: edit.text,\n } };\n }).concat(fix.diagnosticCode !== DiagnosticCodes.EventFromLaterSlice || models === undefined ? [] : [...models].filter(([path]) => !fix.edits.some(edit => edit.path === path)).map(([, document]) => ({\n // A sibling change can invalidate the ordering proof. Empty edits pin every\n // analyzed model, including those whose source is not changed by the repair.\n resource: document.uri, versionId: versions.get(document)!, textEdit: { range: { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 }, text: '' },\n }))) },\n })),\n dispose() {},\n };\n },\n };\n}\n"],"mappings":"0PAMA,MAAMA,EAAkB,oCAClBC,EAAoB,sCACpB,cAAiB,GAAiBC,IAASC,EAAgB,uBAAyBF,EAAoBD,EACxG,cAAgB,EAAmB,IAAiBI,IAAc,IAAMA,IAAcC,GAAQA,EAAK,WAAW,GAAGD,EAAU,EAAE,EAEnI,SAAS,WAAW,EAAc,EAAwB,CACtD,OAAQE,EAAK,gBAAkBC,EAAM,eAAkBD,EAAK,kBAAoBC,EAAM,eAAiBD,EAAK,aAAeC,EAAM,aAC5HA,EAAM,gBAAkBD,EAAK,eAAkBC,EAAM,kBAAoBD,EAAK,eAAiBC,EAAM,aAAeD,EAAK,UAClI,CAIA,SAAgB,yBAAyB,EAA+B,EAAgG,CACpK,IAAME,kBAAQ,IAAI,QAClB,MAAO,CACH,mBAAmB,EAAO,EAAO,EAAS,EAAO,CAC7C,IAAMC,EAAqBC,EAAQ,OAAS,IAAA,IAAa,CAACV,EAAiBC,CAAiB,CAAC,CAAC,KAAK,GAAQ,aAAaS,EAAQ,KAAOL,CAAI,CAAC,EACtIM,EAAgBD,EAAQ,OAAS,IAAA,IAAaD,GAAsB,CAAC,aAAaC,EAAQ,KAAM,UAAU,EAChH,GAAIE,EAAM,yBAA4BF,EAAQ,OAAS,IAAA,IAAa,CAACD,GAAsB,CAAC,aAAaC,EAAQ,KAAM,UAAU,EAAI,MAAO,CAAE,QAAS,CAAC,EAAG,SAAU,CAAC,CAAE,EACxK,IAAMG,EAAcH,EAAQ,QAAQ,OAAO,GAAU,CACjD,IAAMR,EAAO,OAAOY,EAAO,MAAS,SAAWA,EAAO,KAAK,MAAQA,EAAO,KAC1E,OAAOC,EAAqBb,CAAI,GAAK,WAAWY,EAAQE,CAAK,CACjE,CAAC,EACD,GAAI,CAACP,GAAsBI,EAAY,SAAW,EAAG,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AC,CAAC,OAAOD,EAAI,iBAAmB3B,EAAgB,qBAAuBgB,IAAW,IAAA,GAAY,CAAC,EAAI,CAAC,GAAGA,CAAM,CAAC,CAAC,QAAQ,CAACE,KAAU,CAACS,EAAI,MAAM,KAAK,GAAQC,EAAK,OAASV,CAAI,CAAC,CAAC,CAAC,KAAK,EAAGC,MAAe,CAGnM,SAAUA,EAAS,IAAK,UAAWC,EAAS,IAAID,CAAQ,EAAI,SAAU,CAAE,MAAO,CAAE,gBAAiB,EAAG,YAAa,EAAG,cAAe,EAAG,UAAW,CAAE,EAAG,KAAM,EAAG,CACpK,EAAE,CAAC,CAAE,CACT,EAAE,EACF,SAAU,CAAC,CACf,CACJ,CACJ,CACJ"}
@@ -1,4 +1,4 @@
1
- import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{checkPortableMatchPattern as t}from"../Parsing/checkPortableMatchPattern.js";import{stringBodyPattern as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{complianceWireName as i}from"../Parsing/ConceptComplianceParser.js";import{commentStart as a,splitLines as o}from"../Parsing/SourceLineSplitter.js";import{ScreenplaySyntaxWalker as s}from"../Syntax/ScreenplaySyntaxWalker.js";import{parseForAuthoring as c}from"../ScreenplayCompiler.js";function isQuickFixDiagnostic(t){return t===e.DeprecatedStudioTextRulePattern||t===e.DuplicateComplianceMarker||t===e.LegacyOptionalSuffix||t===e.LegacyComplianceMarker||t===e.RedundantEventId||t===e.PublicTranslationRequiresDirection||t===e.LegacyProfileLayout}function legacyOptionalTypeLength(t,n){return n.code===e.LegacyOptionalSuffix?/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?\?/u.exec(t.slice(n.location.column-1))?.[0].length??0:0}function prepareQuickFixes(r,i={}){let l=c(r,void 0,i.placement),u=new Set(Array.from({length:14},(e,t)=>`PLAY0${607+t}`)),acceptable=e=>e.success||e.diagnostics.every(e=>e.severity!==`error`||u.has(e.code)),errorCodes=e=>new Set(e.diagnostics.filter(e=>e.severity===`error`).map(e=>e.code));if(!acceptable(l))return()=>[];let d=o(r),f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Map,m=/* @__PURE__ */ new Map;new class extends s{visitValidationRule(e){m.set(e.location.line,e),super.visitValidationRule(e)}visitEvent(e){f.set(e.location.line,e)}visitSlice(e){p.set(e.location.line,e),super.visitSlice(e)}}().visitApplication(l.value);let h=/* @__PURE__ */ new Map,g=/* @__PURE__ */ new Map,_=/* @__PURE__ */ new Map,v=/* @__PURE__ */ new Map,y=/* @__PURE__ */ new Map,b;for(let e of d)b=f.get(e.number)??b,b!==void 0&&y.set(e.number,b);for(let o of l.diagnostics){h.set(o.code,(h.get(o.code)??0)+1);let s=d[o.location.line-1];if(o.code===e.DuplicateComplianceMarker){let e=duplicateComplianceMarkerEdit(s.raw,s.startOffset);e!==void 0&&_.set(s.number,{diagnosticCode:o.code,title:`Remove duplicate compliance markers`,scope:`occurrence`,edits:[e]})}let u=legacyOptionalTypeLength(s.raw,o);if(u>0)g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Use 'optional' instead of '?'`,scope:`occurrence`,edits:[{start:s.startOffset+o.location.column+u-2,length:1,text:` optional`}]}});else if(o.code===e.DeprecatedStudioTextRulePattern){let e=m.get(s.number);if(e?.rule!==`Matches`||e.value?.kind!==`LiteralExpressionSyntax`||typeof e.value.value!=`string`)continue;let r=t(e.value.value).replacement,i=RegExp(`\\bmatches\\s+"${n}"`).exec(s.raw);if(r===void 0||i===null)continue;let a={Equal:`==`,NotEqual:`!=`,Contains:`contains`,NotContains:`not contains`,StartsWith:`starts with`,EndsWith:`ends with`},c=`"`+r.value.replace(/["\\\n\r\t]/g,e=>JSON.stringify(e).slice(1,-1))+`"`;g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Use the equivalent ordinal text rule`,scope:`occurrence`,edits:[{start:s.startOffset+i.index,length:i[0].length,text:a[r.kind]+` `+c}]},change:{node:e,replacement:{...e,rule:r.kind,value:{...e.value,value:r.value}}}})}else if(o.code===e.LegacyComplianceMarker){let e=complianceMarkerEdit(s.raw,s.startOffset);e!==void 0&&g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Use bare pii and secret compliance markers`,scope:`occurrence`,edits:[e]}})}else if(o.code===e.PublicTranslationRequiresDirection){let t=p.get(s.number),n=/^\s*/.exec(s.raw)[0],a=r.includes(`\r
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{checkPortableMatchPattern as t}from"../Parsing/checkPortableMatchPattern.js";import{stringBodyPattern as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{complianceWireName as i}from"../Parsing/ConceptComplianceParser.js";import{commentStart as a,splitLines as o}from"../Parsing/SourceLineSplitter.js";import{ScreenplaySyntaxWalker as s}from"../Syntax/ScreenplaySyntaxWalker.js";import{parseForAuthoring as c}from"../ScreenplayCompiler.js";import{prepareTimelineQuickFixes as l}from"./TimelineQuickFixes.js";function isQuickFixDiagnostic(t){return t===e.EventFromLaterSlice||t===e.DeprecatedStudioTextRulePattern||t===e.DuplicateComplianceMarker||t===e.LegacyOptionalSuffix||t===e.LegacyComplianceMarker||t===e.RedundantEventId||t===e.PublicTranslationRequiresDirection||t===e.LegacyProfileLayout}function legacyOptionalTypeLength(t,n){return n.code===e.LegacyOptionalSuffix?/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?\?/u.exec(t.slice(n.location.column-1))?.[0].length??0:0}function prepareQuickFixes(t,n={}){let r=prepareLocalQuickFixes(t,n),i;return(a,o)=>{let s=typeof a==`number`?[{line:a,diagnosticCode:o}]:a??[],c=r(a,o),u=s.filter(t=>t.diagnosticCode===e.EventFromLaterSlice||t.diagnosticCode===void 0&&c.length===0),d=u.length===0?[]:[...new Set(u.map(e=>e.line))].flatMap(e=>(i??=l(t,n))(e));return[...c,...d]}}function prepareLocalQuickFixes(r,i){let l=c(r,void 0,i.placement),u=new Set(Array.from({length:14},(e,t)=>`PLAY0${607+t}`)),acceptable=e=>e.success||e.diagnostics.every(e=>e.severity!==`error`||u.has(e.code)),errorCodes=e=>new Set(e.diagnostics.filter(e=>e.severity===`error`).map(e=>e.code));if(!acceptable(l))return()=>[];let d=o(r),f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Map,m=/* @__PURE__ */ new Map;new class extends s{visitValidationRule(e){m.set(e.location.line,e),super.visitValidationRule(e)}visitEvent(e){f.set(e.location.line,e)}visitSlice(e){p.set(e.location.line,e),super.visitSlice(e)}}().visitApplication(l.value);let h=/* @__PURE__ */ new Map,g=/* @__PURE__ */ new Map,_=/* @__PURE__ */ new Map,v=/* @__PURE__ */ new Map,y=/* @__PURE__ */ new Map,b;for(let e of d)b=f.get(e.number)??b,b!==void 0&&y.set(e.number,b);for(let o of l.diagnostics){h.set(o.code,(h.get(o.code)??0)+1);let s=d[o.location.line-1];if(o.code===e.DuplicateComplianceMarker){let e=duplicateComplianceMarkerEdit(s.raw,s.startOffset);e!==void 0&&_.set(s.number,{diagnosticCode:o.code,title:`Remove duplicate compliance markers`,scope:`occurrence`,edits:[e]})}let u=legacyOptionalTypeLength(s.raw,o);if(u>0)g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Use 'optional' instead of '?'`,scope:`occurrence`,edits:[{start:s.startOffset+o.location.column+u-2,length:1,text:` optional`}]}});else if(o.code===e.DeprecatedStudioTextRulePattern){let e=m.get(s.number);if(e?.rule!==`Matches`||e.value?.kind!==`LiteralExpressionSyntax`||typeof e.value.value!=`string`)continue;let r=t(e.value.value).replacement,i=RegExp(`\\bmatches\\s+"${n}"`).exec(s.raw);if(r===void 0||i===null)continue;let a={Equal:`==`,NotEqual:`!=`,Contains:`contains`,NotContains:`not contains`,StartsWith:`starts with`,EndsWith:`ends with`},c=`"`+r.value.replace(/["\\\n\r\t]/g,e=>JSON.stringify(e).slice(1,-1))+`"`;g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Use the equivalent ordinal text rule`,scope:`occurrence`,edits:[{start:s.startOffset+i.index,length:i[0].length,text:a[r.kind]+` `+c}]},change:{node:e,replacement:{...e,rule:r.kind,value:{...e.value,value:r.value}}}})}else if(o.code===e.LegacyComplianceMarker){let e=complianceMarkerEdit(s.raw,s.startOffset);e!==void 0&&g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Use bare pii and secret compliance markers`,scope:`occurrence`,edits:[e]}})}else if(o.code===e.PublicTranslationRequiresDirection){let t=p.get(s.number),n=/^\s*/.exec(s.raw)[0],a=r.includes(`\r
2
2
  `)?`\r
3
3
  `:`
4
4
  `,u=[`Inbound`,`Outbound`].map(e=>({direction:e,text:`${a}${n} direction ${e===`Inbound`?`inbound`:`outbound`}`})).filter(t=>{let n=applyQuickFixEdits(r,[{start:s.startOffset+s.raw.length,length:0,text:t.text}]),a=c(n,void 0,i.placement),o=errorCodes(l);return acceptable(a)&&![...errorCodes(a)].some(t=>t===e.PublicTranslationRequiresDirection||!o.has(t))});if(u.length===1){let[{direction:e,text:n}]=u;g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Declare 'direction ${e===`Inbound`?`inbound`:`outbound`}'`,scope:`occurrence`,edits:[{start:s.startOffset+s.raw.length,length:0,text:n}]},change:{node:t,replacement:{...t,direction:e}}})}}else if(o.code===e.LegacyProfileLayout){let e=legacyProfileLayoutFix(d,s.number-1,o.code);e!==void 0&&g.set(s.number,{line:s.number,fix:e})}else if(o.code===e.RedundantEventId&&a(s.raw)<0){let e=y.get(s.number);if(e?.id!==e?.name||e===void 0)continue;g.set(s.number,{line:s.number,fix:{diagnosticCode:o.code,title:`Remove the redundant event id`,scope:`occurrence`,edits:[{start:s.startOffset,length:(d[s.number]?.startOffset??r.length)-s.startOffset,text:``}]},change:{node:e,replacement:{...e,id:null}}})}}let x=[e.LegacyOptionalSuffix,e.LegacyComplianceMarker],S=verificationShape(l),C=/* @__PURE__ */ new Map,w,T=/* @__PURE__ */ new Set,E=/* @__PURE__ */ new Map,verify=(e,t)=>{let n=applyQuickFixEdits(r,e.edits);if(n===void 0)return;let a=c(n,void 0,i.placement);if(acceptable(a)&&verificationShape(a)===(t===void 0?S:verificationShape(l,[t])))return a.diagnostics.filter(t=>t.code===e.diagnosticCode).length===(h.get(e.diagnosticCode)??0)-e.edits.length?e:void 0};return(t,n)=>{let a=typeof t==`number`||t===void 0?void 0:t,o=a===void 0?typeof t==`number`&&(n===void 0||n===e.DuplicateComplianceMarker)?[t]:[]:a.filter(t=>t.diagnosticCode===e.DuplicateComplianceMarker).map(e=>e.line),s=[...new Set(o)].flatMap(e=>{let t=_.get(e);if(t===void 0)return[];v.has(e)||v.set(e,verify(t));let n=v.get(e);return n===void 0?[]:[n]}),u=x.filter(e=>a===void 0?n===void 0||n===e:a.some(t=>t.diagnosticCode===e));for(let t of u.filter(e=>!T.has(e))){let n=[...g.values()].filter(e=>e.fix.diagnosticCode===t);if(n.length>0){let r=verify({diagnosticCode:t,title:t===e.LegacyOptionalSuffix?`Use 'optional' throughout this document`:`Use bare pii and secret throughout this document`,scope:`document`,edits:n.flatMap(e=>e.fix.edits)});r!==void 0&&E.set(t,r)}T.add(t)}let f=u.flatMap(e=>E.has(e)?[E.get(e)]:[]);if(a!==void 0){if(w===void 0){w=/* @__PURE__ */ new Map;let e=d.flatMap(e=>g.has(e.number)?[g.get(e.number)]:[]),t=e.flatMap(e=>e.fix.edits),n=applyQuickFixEdits(r,t);if(t.length>0&&n!==void 0){let t=c(n,void 0,i.placement),r=e.flatMap(e=>e.change===void 0?[]:[e.change]);if(acceptable(t)&&verificationShape(t)===verificationShape(l,r)){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let e of t.diagnostics)n.set(e.code,(n.get(e.code)??0)+1);for(let t of e)r.set(t.fix.diagnosticCode,(r.get(t.fix.diagnosticCode)??0)+t.fix.edits.length);if([...r].every(([e,t])=>(n.get(e)??0)===(h.get(e)??0)-t))for(let t of e)w.set(t.line,t.fix)}}}let e=/* @__PURE__ */ new Map;for(let t of a){let n=w.get(t.line);n?.diagnosticCode===t.diagnosticCode&&e.set(t.line,n)}return[...e.values(),...s,...f]}let p=typeof t==`number`?t:void 0,m=p===void 0?void 0:g.get(p),y;return m!==void 0&&p!==void 0&&(n===void 0||m.fix.diagnosticCode===n)&&(C.has(p)||(C.size===32&&C.delete(C.keys().next().value),C.set(p,verify(m.fix,m.change))),y=C.get(p)),[...y===void 0?[]:[y],...s,...f]}}function legacyProfileLayoutFix(e,t,n){let indentOf=e=>/^\s*/.exec(e)[0].length,r=indentOf(e[t].raw),i,a=!1;for(let n=t+1;n<e.length;n++){let t=e[n].raw;if(t.trim().length!==0){if(indentOf(t)<=r)break;i===void 0&&/^\s*layout\s+[A-Za-z_]\w*\s*$/.test(t)&&(i={index:n,indent:indentOf(t)}),/^\s*root\s+template(\s|$)/.test(t)&&(a=!0)}}if(i===void 0)return;let o=e[i.index];return a?{diagnosticCode:n,title:`Remove the ignored layout line`,scope:`occurrence`,edits:[{start:o.startOffset,length:(e[i.index+1]?.startOffset??o.startOffset+o.raw.length)-o.startOffset,text:``}]}:{diagnosticCode:n,title:`Use 'root template' instead of 'layout'`,scope:`occurrence`,edits:[{start:o.startOffset+i.indent,length:6,text:`root template`}]}}function duplicateComplianceMarkerEdit(e,t){let n=r(`^(\\s*concept\\s+\\w+\\s*:\\s*\\w+)((?:[^\\S\\r\\n]+@?\\w+)*)`).exec(e);if(n===null)return;let a=n[2],o=/* @__PURE__ */ new Set,s=a.replace(new RegExp(r(`[^\\S\\r\\n]+(@?\\w+)`).source,`gu`),(e,t)=>{let n=i(t);return o.has(n)?``:(o.add(n),e)});return s===a?void 0:{start:t+n[1].length,length:a.length,text:s}}function complianceMarkerEdit(e,t){let n=r(`^(\\s*concept\\s+\\w+\\s*:\\s*\\w+)((?:[^\\S\\r\\n]+@?\\w+)*)`).exec(e);if(n!==null){let e=n[2],r=e.replace(/@pii\b|@?sensitive\b/g,e=>e===`@pii`?`pii`:`secret`);return r===e?void 0:{start:t+n[1].length,length:e.length,text:r}}let i=r(`^(\\s*)(@pii|@?sensitive)\\b`).exec(e);return i===null?void 0:{start:t+i[1].length,length:i[2].length,text:i[2]===`@pii`?`pii`:`secret`}}function verificationShape(e,t=[]){let n=new Map(t.map(e=>[e.node,e.replacement]));return JSON.stringify([e.value,e.triggerData],(e,t)=>[`location`,`usesLocation`,`targetLocation`].includes(e)?void 0:n.get(t)??t)}function applyQuickFixEdits(e,t){let n=[],r=0;for(let i of t){if(i.start<r||i.start<0||i.length<0||i.start+i.length>e.length)return;n.push(e.slice(r,i.start),i.text),r=i.start+i.length}return n.push(e.slice(r)),n.join(``)}export{applyQuickFixEdits,isQuickFixDiagnostic,legacyOptionalTypeLength,prepareQuickFixes};
@@ -1 +1 @@
1
- {"version":3,"file":"QuickFixes.js","names":["code","DiagnosticCodes","diagnostic","line","original","parseForAuthoring","source","options","publicEventCodes","index","parsed","lines","splitLines","eventsByLine","slicesByLine","rulesByLine","ScreenplaySyntaxWalker","rule","event","slice","counts","byLine","duplicateByLine","duplicateVerdicts","events","edit","length","replacement","checkPortableMatchPattern","match","stringBodyPattern","spellings","quoted","character","indent","ending","candidates","direction","edited","candidate","originalCodes","fix","commentStart","declaration","spellingCodes","syntax","verified","rangeVerdicts","documentChecked","documentFixes","change","requests","duplicateLines","diagnosticCode","request","duplicates","number","selectedCodes","documents","edits","candidateSource","changes","remaining","removed","count","selected","occurrenceLine","occurrenceFix","raw","headerIndent","headerIndex","layout","hasRoot","header","pattern","suffix","seen","text","wire","complianceWireName","marker","token","startOffset","directive","replacements","key","value","parts","end"],"sources":["../../../../../../Compiler/Authoring/QuickFixes.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { PlayPlacement } from '../Files/PlayPlacement';\nimport { checkPortableMatchPattern } from '../Parsing/checkPortableMatchPattern';\nimport { ValidationRuleSyntax } from '../Syntax/Commands';\nimport { stringBodyPattern } from '../Text/StringLiteral';\nimport { complianceWireName } from '../Parsing/ConceptComplianceParser';\nimport { commentStart, splitLines } from '../Parsing/SourceLineSplitter';\nimport { parseForAuthoring } from '../ScreenplayCompiler';\nimport { EventSyntax } from '../Syntax/Declarations';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { TranslationDirection } from '../Syntax/TranslationDirection';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { pattern } from '../Text/patterns';\nimport { QuickFixCandidate } from './QuickFixCandidate';\n\nexport interface QuickFixEdit {\n readonly start: number;\n readonly length: number;\n readonly text: string;\n}\n\nexport interface QuickFix {\n readonly diagnosticCode: string;\n readonly title: string;\n readonly scope: 'occurrence' | 'document';\n readonly edits: readonly QuickFixEdit[];\n}\n\nexport interface QuickFixOptions {\n readonly line?: number;\n readonly placement?: PlayPlacement;\n readonly diagnosticCode?: string;\n}\n\nexport function isQuickFixDiagnostic(code: unknown): code is string {\n return code === DiagnosticCodes.DeprecatedStudioTextRulePattern || code === DiagnosticCodes.DuplicateComplianceMarker || code === DiagnosticCodes.LegacyOptionalSuffix || code === DiagnosticCodes.LegacyComplianceMarker || code === DiagnosticCodes.RedundantEventId || code === DiagnosticCodes.PublicTranslationRequiresDirection || code === DiagnosticCodes.LegacyProfileLayout;\n}\n\n// Diagnostics point at the complete type, not at the suffix. Never derive edits from message text.\nexport function legacyOptionalTypeLength(line: string, diagnostic: Diagnostic): number {\n if (diagnostic.code !== DiagnosticCodes.LegacyOptionalSuffix) return 0;\n return /^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?\\?/u.exec(line.slice(diagnostic.location.column - 1))?.[0].length ?? 0;\n}\n\nexport function findQuickFixes(source: string, options: QuickFixOptions = {}): QuickFix[] {\n return prepareQuickFixes(source, options)(options.line, options.diagnosticCode);\n}\n\n// One immutable buffer version owns the analysis and document verdict. Cursor moves reuse them;\n// single-occurrence verdicts have a bounded cache. Range requests verify the independent recipes\n// together once per version, rather than reparsing N times for N intersecting markers.\nexport function prepareQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement'> = {}): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const original = parseForAuthoring(source, undefined, options.placement);\n // PLAY0614 and the public-event boundary errors that follow from a missing direction are errors the repair itself removes,\n // so a document whose only errors are public-event boundary errors stays repairable.\n const publicEventCodes: ReadonlySet<string> = new Set(Array.from({ length: 14 }, (_, index) => `PLAY0${607 + index}`));\n const acceptable = (parsed: ReturnType<typeof parseForAuthoring>): boolean => parsed.success || parsed.diagnostics.every(diagnostic => diagnostic.severity !== 'error' || publicEventCodes.has(diagnostic.code));\n const errorCodes = (parsed: ReturnType<typeof parseForAuthoring>): Set<string> => new Set(parsed.diagnostics.filter(diagnostic => diagnostic.severity === 'error').map(diagnostic => diagnostic.code));\n if (!acceptable(original)) return () => [];\n const lines = splitLines(source);\n const eventsByLine = new Map<number, EventSyntax>();\n const slicesByLine = new Map<number, SliceSyntax>();\n const rulesByLine = new Map<number, ValidationRuleSyntax>();\n // Index inline and standalone declarations once, without scanning the tree per diagnostic.\n const walker = new class extends ScreenplaySyntaxWalker {\n override visitValidationRule(rule: ValidationRuleSyntax): void { rulesByLine.set(rule.location.line, rule); super.visitValidationRule(rule); }\n override visitEvent(event: EventSyntax): void { eventsByLine.set(event.location.line, event); }\n override visitSlice(slice: SliceSyntax): void { slicesByLine.set(slice.location.line, slice); super.visitSlice(slice); }\n }();\n walker.visitApplication(original.value);\n const counts = new Map<string, number>();\n const byLine = new Map<number, QuickFixCandidate>();\n // Duplicate removal and legacy spelling can share a header. Keep their independently verified recipes separate.\n const duplicateByLine = new Map<number, QuickFix>();\n const duplicateVerdicts = new Map<number, QuickFix | undefined>();\n const events = new Map<number, EventSyntax>();\n let event: EventSyntax | undefined;\n for (const line of lines) {\n event = eventsByLine.get(line.number) ?? event;\n if (event !== undefined) events.set(line.number, event);\n }\n for (const diagnostic of original.diagnostics) {\n counts.set(diagnostic.code, (counts.get(diagnostic.code) ?? 0) + 1);\n const line = lines[diagnostic.location.line - 1];\n if (diagnostic.code === DiagnosticCodes.DuplicateComplianceMarker) {\n const edit = duplicateComplianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) duplicateByLine.set(line.number, { diagnosticCode: diagnostic.code, title: 'Remove duplicate compliance markers', scope: 'occurrence', edits: [edit] });\n }\n const length = legacyOptionalTypeLength(line.raw, diagnostic);\n if (length > 0) {\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: \"Use 'optional' instead of '?'\", scope: 'occurrence', edits: [{ start: line.startOffset + diagnostic.location.column + length - 2, length: 1, text: ' optional' }] } });\n } else if (diagnostic.code === DiagnosticCodes.DeprecatedStudioTextRulePattern) {\n const rule = rulesByLine.get(line.number);\n if (rule?.rule !== 'Matches' || rule.value?.kind !== 'LiteralExpressionSyntax' || typeof rule.value.value !== 'string') continue;\n const replacement = checkPortableMatchPattern(rule.value.value).replacement;\n const match = new RegExp(`\\\\bmatches\\\\s+\"${stringBodyPattern}\"`).exec(line.raw);\n if (replacement === undefined || match === null) continue;\n const spellings = { Equal: '==', NotEqual: '!=', Contains: 'contains', NotContains: 'not contains', StartsWith: 'starts with', EndsWith: 'ends with' };\n const quoted = '\"' + replacement.value.replace(/[\"\\\\\\n\\r\\t]/g, character => JSON.stringify(character).slice(1, -1)) + '\"';\n byLine.set(line.number, { line: line.number,\n fix: { diagnosticCode: diagnostic.code, title: 'Use the equivalent ordinal text rule', scope: 'occurrence', edits: [{ start: line.startOffset + match.index, length: match[0].length, text: spellings[replacement.kind] + ' ' + quoted }] },\n change: { node: rule, replacement: { ...rule, rule: replacement.kind, value: { ...rule.value, value: replacement.value } } as ValidationRuleSyntax } });\n } else if (diagnostic.code === DiagnosticCodes.LegacyComplianceMarker) {\n const edit = complianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Use bare pii and secret compliance markers', scope: 'occurrence', edits: [edit] } });\n } else if (diagnostic.code === DiagnosticCodes.PublicTranslationRequiresDirection) {\n // PLAY0614 is only reported on the declaration line of a Translate slice that has no direction.\n const slice = slicesByLine.get(line.number)!;\n // Offer a direction only when exactly one is consistent with the slice: the other would add errors.\n const indent = /^\\s*/.exec(line.raw)![0];\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const candidates = [TranslationDirection.Inbound, TranslationDirection.Outbound].map(direction => ({ direction, text: `${ending}${indent} direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}` }))\n .filter(candidate => {\n // The insertion point is the end of an existing line, so the edit is always in bounds.\n const edited = applyQuickFixEdits(source, [{ start: line.startOffset + line.raw.length, length: 0, text: candidate.text }])!;\n const parsed = parseForAuthoring(edited, undefined, options.placement);\n const originalCodes = errorCodes(original);\n // Valid when the missing-direction error is gone and the direction introduces no kind of error the document lacked.\n return acceptable(parsed) && ![...errorCodes(parsed)].some(code => code === DiagnosticCodes.PublicTranslationRequiresDirection || !originalCodes.has(code));\n });\n if (candidates.length === 1) {\n const [{ direction, text }] = candidates;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: `Declare 'direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}'`, scope: 'occurrence', edits: [{ start: line.startOffset + line.raw.length, length: 0, text }] },\n change: { node: slice, replacement: { ...slice, direction } as SliceSyntax } });\n }\n } else if (diagnostic.code === DiagnosticCodes.LegacyProfileLayout) {\n const fix = legacyProfileLayoutFix(lines, line.number - 1, diagnostic.code);\n if (fix !== undefined) byLine.set(line.number, { line: line.number, fix });\n } else if (diagnostic.code === DiagnosticCodes.RedundantEventId && commentStart(line.raw) < 0) {\n const declaration = events.get(line.number);\n if (declaration?.id !== declaration?.name || declaration === undefined) continue;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Remove the redundant event id', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[line.number]?.startOffset ?? source.length) - line.startOffset, text: '' }] },\n change: { node: declaration, replacement: { ...declaration, id: null } as EventSyntax } });\n }\n }\n const spellingCodes = [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker];\n const syntax = verificationShape(original);\n const verified = new Map<number, QuickFix | undefined>();\n let rangeVerdicts: Map<number, QuickFix> | undefined;\n const documentChecked = new Set<string>();\n const documentFixes = new Map<string, QuickFix>();\n const verify = (fix: QuickFix, change?: QuickFixCandidate['change']): QuickFix | undefined => {\n const candidate = applyQuickFixEdits(source, fix.edits);\n if (candidate === undefined) return undefined;\n const parsed = parseForAuthoring(candidate, undefined, options.placement);\n if (!acceptable(parsed) || verificationShape(parsed) !== (change === undefined ? syntax : verificationShape(original, [change]))) return undefined;\n return parsed.diagnostics.filter(diagnostic => diagnostic.code === fix.diagnosticCode).length === (counts.get(fix.diagnosticCode) ?? 0) - fix.edits.length ? fix : undefined;\n };\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' || line === undefined ? undefined : line;\n const duplicateLines = requests === undefined\n ? typeof line === 'number' && (diagnosticCode === undefined || diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker) ? [line] : []\n : requests.filter(request => request.diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker).map(request => request.line);\n const duplicates = [...new Set(duplicateLines)].flatMap(number => {\n const fix = duplicateByLine.get(number);\n if (fix === undefined) return [];\n if (!duplicateVerdicts.has(number)) duplicateVerdicts.set(number, verify(fix));\n const verified = duplicateVerdicts.get(number);\n return verified === undefined ? [] : [verified];\n });\n const selectedCodes = spellingCodes.filter(code => requests === undefined ? diagnosticCode === undefined || diagnosticCode === code : requests.some(request => request.diagnosticCode === code));\n for (const code of selectedCodes.filter(code => !documentChecked.has(code))) {\n const candidates = [...byLine.values()].filter(candidate => candidate.fix.diagnosticCode === code);\n if (candidates.length > 0) {\n const fix = verify({ diagnosticCode: code, title: code === DiagnosticCodes.LegacyOptionalSuffix ? \"Use 'optional' throughout this document\" : 'Use bare pii and secret throughout this document', scope: 'document', edits: candidates.flatMap(candidate => candidate.fix.edits) });\n if (fix !== undefined) documentFixes.set(code, fix);\n }\n documentChecked.add(code);\n }\n const documents = selectedCodes.flatMap(code => documentFixes.has(code) ? [documentFixes.get(code)!] : []);\n if (requests !== undefined) {\n if (rangeVerdicts === undefined) {\n rangeVerdicts = new Map();\n // Source order gives ordered, non-overlapping edits without sorting. Recipes replace\n // distinct nodes/lines; the batch must preserve every other modeled member and remove\n // exactly the expected diagnostics before any of its occurrence edits can be offered.\n const candidates = lines.flatMap(line => byLine.has(line.number) ? [byLine.get(line.number)!] : []);\n const edits = candidates.flatMap(candidate => candidate.fix.edits);\n const candidateSource = applyQuickFixEdits(source, edits);\n if (edits.length > 0 && candidateSource !== undefined) {\n const parsed = parseForAuthoring(candidateSource, undefined, options.placement);\n const changes = candidates.flatMap(candidate => candidate.change === undefined ? [] : [candidate.change]);\n if (acceptable(parsed) && verificationShape(parsed) === verificationShape(original, changes)) {\n const remaining = new Map<string, number>();\n const removed = new Map<string, number>();\n for (const diagnostic of parsed.diagnostics) remaining.set(diagnostic.code, (remaining.get(diagnostic.code) ?? 0) + 1);\n for (const candidate of candidates) removed.set(candidate.fix.diagnosticCode, (removed.get(candidate.fix.diagnosticCode) ?? 0) + candidate.fix.edits.length);\n if ([...removed].every(([code, count]) => (remaining.get(code) ?? 0) === (counts.get(code) ?? 0) - count)) {\n for (const candidate of candidates) rangeVerdicts.set(candidate.line, candidate.fix);\n }\n }\n }\n }\n const selected = new Map<number, QuickFix>();\n for (const request of requests) {\n const fix = rangeVerdicts.get(request.line);\n if (fix?.diagnosticCode === request.diagnosticCode) selected.set(request.line, fix);\n }\n return [...selected.values(), ...duplicates, ...documents];\n }\n const occurrenceLine = typeof line === 'number' ? line : undefined;\n const selected = occurrenceLine === undefined ? undefined : byLine.get(occurrenceLine);\n let occurrenceFix: QuickFix | undefined;\n if (selected !== undefined && occurrenceLine !== undefined && (diagnosticCode === undefined || selected.fix.diagnosticCode === diagnosticCode)) {\n if (!verified.has(occurrenceLine)) {\n if (verified.size === 32) verified.delete(verified.keys().next().value!);\n verified.set(occurrenceLine, verify(selected.fix, selected.change));\n }\n occurrenceFix = verified.get(occurrenceLine);\n }\n return [...(occurrenceFix === undefined ? [] : [occurrenceFix]), ...duplicates, ...documents];\n };\n}\n\n// PLAY0791 is reported on the `ui profile` line. The canonical form is `root template <Name>`; beside a root template the legacy line is ignored, so it is removed.\nfunction legacyProfileLayoutFix(lines: readonly { readonly number: number; readonly raw: string; readonly startOffset: number }[], headerIndex: number, diagnosticCode: string): QuickFix | undefined {\n const indentOf = (raw: string): number => /^\\s*/.exec(raw)![0].length;\n const headerIndent = indentOf(lines[headerIndex].raw);\n let layout: { readonly index: number; readonly indent: number } | undefined;\n let hasRoot = false;\n for (let index = headerIndex + 1; index < lines.length; index++) {\n const raw = lines[index].raw;\n if (raw.trim().length === 0) continue;\n if (indentOf(raw) <= headerIndent) break;\n if (layout === undefined && /^\\s*layout\\s+[A-Za-z_]\\w*\\s*$/.test(raw)) layout = { index, indent: indentOf(raw) };\n if (/^\\s*root\\s+template(\\s|$)/.test(raw)) hasRoot = true;\n }\n if (layout === undefined) return undefined;\n const line = lines[layout.index];\n return hasRoot\n ? { diagnosticCode, title: 'Remove the ignored layout line', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[layout.index + 1]?.startOffset ?? line.startOffset + line.raw.length) - line.startOffset, text: '' }] }\n : { diagnosticCode, title: \"Use 'root template' instead of 'layout'\", scope: 'occurrence', edits: [{ start: line.startOffset + layout.indent, length: 'layout'.length, text: 'root template' }] };\n}\n\nfunction duplicateComplianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header === null) return undefined;\n const suffix = header[2];\n const seen = new Set<string>();\n const text = suffix.replace(new RegExp(pattern('[^\\\\S\\\\r\\\\n]+(@?\\\\w+)').source, 'gu'), (token, marker: string) => {\n const wire = complianceWireName(marker);\n if (seen.has(wire)) return '';\n seen.add(wire);\n return token;\n });\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n}\n\nfunction complianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n // Restrict rewriting to the suffix or leading directive marker, never comments or quoted reasons.\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header !== null) {\n const suffix = header[2];\n const text = suffix.replace(/@pii\\b|@?sensitive\\b/g, marker => marker === '@pii' ? 'pii' : 'secret');\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n }\n const directive = pattern('^(\\\\s*)(@pii|@?sensitive)\\\\b').exec(raw);\n return directive === null ? undefined : { start: startOffset + directive[1].length, length: directive[2].length, text: directive[2] === '@pii' ? 'pii' : 'secret' };\n}\n\nfunction verificationShape(parsed: ReturnType<typeof parseForAuthoring>, changes: readonly NonNullable<QuickFixCandidate['change']>[] = []): string {\n // Compare every modeled member (including trigger data), ignoring only source locations. A recipe\n // may replace only its original node; no other id or destination is normalized away.\n const replacements = new Map(changes.map(change => [change.node, change.replacement]));\n return JSON.stringify([parsed.value, parsed.triggerData], (key, value: unknown) => ['location', 'usesLocation', 'targetLocation'].includes(key) ? undefined : replacements.get(value as NonNullable<QuickFixCandidate['change']>['node']) ?? value);\n}\n\n// One forward pass; applying N edits by repeatedly slicing the document would be quadratic.\nexport function applyQuickFixEdits(source: string, edits: readonly QuickFixEdit[]): string | undefined {\n const parts: string[] = [];\n let end = 0;\n for (const edit of edits) {\n if (edit.start < end || edit.start < 0 || edit.length < 0 || edit.start + edit.length > source.length) return undefined;\n parts.push(source.slice(end, edit.start), edit.text);\n end = edit.start + edit.length;\n }\n parts.push(source.slice(end));\n return parts.join('');\n}\n"],"mappings":"6lBAsCA,SAAgB,qBAAqB,EAA+B,CAChE,OAAOA,IAASC,EAAgB,iCAAmCD,IAASC,EAAgB,2BAA6BD,IAASC,EAAgB,sBAAwBD,IAASC,EAAgB,wBAA0BD,IAASC,EAAgB,kBAAoBD,IAASC,EAAgB,oCAAsCD,IAASC,EAAgB,mBACtW,CAGA,SAAgB,yBAAyB,EAAc,EAAgC,CAEnF,OADIC,EAAW,OAASD,EAAgB,qBACjC,2CAA2C,KAAKE,EAAK,MAAMD,EAAW,SAAS,OAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAU,EAD7C,CAEzE,CASA,SAAgB,kBAAkB,EAAgB,EAA8C,CAAC,EAAiH,CAC9M,IAAME,EAAWC,EAAkBC,EAAQ,IAAA,GAAWC,EAAQ,SAAS,EAGjEC,EAAwC,IAAI,IAAI,MAAM,KAAK,CAAE,OAAQ,EAAG,GAAI,EAAG,IAAU,QAAQ,IAAMC,GAAO,CAAC,EAC/G,WAAc,GAA0DC,EAAO,SAAWA,EAAO,YAAY,MAAM,GAAcR,EAAW,WAAa,SAAWM,EAAiB,IAAIN,EAAW,IAAI,CAAC,EACzM,WAAc,GAA8D,IAAI,IAAIQ,EAAO,YAAY,OAAO,GAAcR,EAAW,WAAa,OAAO,CAAC,CAAC,IAAI,GAAcA,EAAW,IAAI,CAAC,EACrM,GAAI,CAAC,WAAWE,CAAQ,EAAG,UAAa,CAAC,EACzC,IAAMO,EAAQC,EAAWN,CAAM,EACzBO,kBAAe,IAAI,IACnBC,kBAAe,IAAI,IACnBC,kBAAc,IAAI,IAOxB,IALmB,cAAcC,CAAuB,CACpD,oBAA6B,EAAkC,CAAED,EAAY,IAAIE,EAA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AAMkF,EAAK/D,EAAK,KAAK,EAAGA,EAAK,IAAI,EACnD,EAAMA,EAAK,MAAQA,EAAK,MAC5B,CAEA,OADA8D,EAAM,KAAKjF,EAAO,MAAMkF,CAAG,CAAC,EACrBD,EAAM,KAAK,EAAE,CACxB"}
1
+ {"version":3,"file":"QuickFixes.js","names":["code","DiagnosticCodes","diagnostic","line","local","source","options","timeline","requests","localFixes","diagnosticCode","selected","request","fixes","prepareTimelineQuickFixes","original","parseForAuthoring","publicEventCodes","index","parsed","lines","splitLines","eventsByLine","slicesByLine","rulesByLine","ScreenplaySyntaxWalker","rule","event","slice","counts","byLine","duplicateByLine","duplicateVerdicts","events","edit","length","replacement","checkPortableMatchPattern","match","stringBodyPattern","spellings","quoted","character","indent","ending","candidates","direction","edited","candidate","originalCodes","fix","commentStart","declaration","spellingCodes","syntax","verified","rangeVerdicts","documentChecked","documentFixes","change","duplicateLines","duplicates","number","selectedCodes","documents","edits","candidateSource","changes","remaining","removed","count","occurrenceLine","occurrenceFix","raw","headerIndent","headerIndex","layout","hasRoot","header","pattern","suffix","seen","text","wire","complianceWireName","marker","token","startOffset","directive","replacements","key","value","parts","end"],"sources":["../../../../../../Compiler/Authoring/QuickFixes.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { PlayPlacement } from '../Files/PlayPlacement';\nimport { checkPortableMatchPattern } from '../Parsing/checkPortableMatchPattern';\nimport { ValidationRuleSyntax } from '../Syntax/Commands';\nimport { stringBodyPattern } from '../Text/StringLiteral';\nimport { complianceWireName } from '../Parsing/ConceptComplianceParser';\nimport { commentStart, splitLines } from '../Parsing/SourceLineSplitter';\nimport { parseForAuthoring } from '../ScreenplayCompiler';\nimport { EventSyntax } from '../Syntax/Declarations';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { TranslationDirection } from '../Syntax/TranslationDirection';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { pattern } from '../Text/patterns';\nimport { QuickFixCandidate } from './QuickFixCandidate';\nimport { prepareTimelineQuickFixes } from './TimelineQuickFixes';\n\nexport interface QuickFixEdit {\n /** Destination document for an application-snapshot repair; absent for a buffer-local edit. */\n readonly path?: string;\n readonly start: number;\n readonly length: number;\n readonly text: string;\n}\n\nexport interface QuickFix {\n /** Original diagnostic line, which may differ from the edited import's line. */\n readonly line?: number;\n readonly diagnosticCode: string;\n readonly title: string;\n readonly scope: 'occurrence' | 'document';\n readonly edits: readonly QuickFixEdit[];\n}\n\nexport interface QuickFixOptions {\n readonly path?: string;\n readonly documents?: ReadonlyMap<string, string>;\n readonly line?: number;\n readonly placement?: PlayPlacement;\n readonly diagnosticCode?: string;\n}\n\nexport function isQuickFixDiagnostic(code: unknown): code is string {\n return code === DiagnosticCodes.EventFromLaterSlice || code === DiagnosticCodes.DeprecatedStudioTextRulePattern || code === DiagnosticCodes.DuplicateComplianceMarker || code === DiagnosticCodes.LegacyOptionalSuffix || code === DiagnosticCodes.LegacyComplianceMarker || code === DiagnosticCodes.RedundantEventId || code === DiagnosticCodes.PublicTranslationRequiresDirection || code === DiagnosticCodes.LegacyProfileLayout;\n}\n\n// Diagnostics point at the complete type, not at the suffix. Never derive edits from message text.\nexport function legacyOptionalTypeLength(line: string, diagnostic: Diagnostic): number {\n if (diagnostic.code !== DiagnosticCodes.LegacyOptionalSuffix) return 0;\n return /^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?\\?/u.exec(line.slice(diagnostic.location.column - 1))?.[0].length ?? 0;\n}\n\nexport function findQuickFixes(source: string, options: QuickFixOptions = {}): QuickFix[] {\n return prepareQuickFixes(source, options)(options.line, options.diagnosticCode);\n}\n\n// One immutable buffer version owns the analysis and document verdict. Cursor moves reuse them;\n// single-occurrence verdicts have a bounded cache. Range requests verify the independent recipes\n// together once per version, rather than reparsing N times for N intersecting markers.\nexport function prepareQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement' | 'path' | 'documents'> = {}): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const local = prepareLocalQuickFixes(source, options);\n let timeline: ReturnType<typeof prepareTimelineQuickFixes> | undefined;\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' ? [{ line, diagnosticCode }] : line ?? [];\n const localFixes = local(line, diagnosticCode);\n const selected = requests.filter(request => request.diagnosticCode === DiagnosticCodes.EventFromLaterSlice || (request.diagnosticCode === undefined && localFixes.length === 0));\n const fixes = selected.length === 0 ? [] : [...new Set(selected.map(request => request.line))].flatMap(line => (timeline ??= prepareTimelineQuickFixes(source, options))(line));\n return [...localFixes, ...fixes];\n };\n}\n\nfunction prepareLocalQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement'>): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const original = parseForAuthoring(source, undefined, options.placement);\n // PLAY0614 and the public-event boundary errors that follow from a missing direction are errors the repair itself removes,\n // so a document whose only errors are public-event boundary errors stays repairable.\n const publicEventCodes: ReadonlySet<string> = new Set(Array.from({ length: 14 }, (_, index) => `PLAY0${607 + index}`));\n const acceptable = (parsed: ReturnType<typeof parseForAuthoring>): boolean => parsed.success || parsed.diagnostics.every(diagnostic => diagnostic.severity !== 'error' || publicEventCodes.has(diagnostic.code));\n const errorCodes = (parsed: ReturnType<typeof parseForAuthoring>): Set<string> => new Set(parsed.diagnostics.filter(diagnostic => diagnostic.severity === 'error').map(diagnostic => diagnostic.code));\n if (!acceptable(original)) return () => [];\n const lines = splitLines(source);\n const eventsByLine = new Map<number, EventSyntax>();\n const slicesByLine = new Map<number, SliceSyntax>();\n const rulesByLine = new Map<number, ValidationRuleSyntax>();\n // Index inline and standalone declarations once, without scanning the tree per diagnostic.\n const walker = new class extends ScreenplaySyntaxWalker {\n override visitValidationRule(rule: ValidationRuleSyntax): void { rulesByLine.set(rule.location.line, rule); super.visitValidationRule(rule); }\n override visitEvent(event: EventSyntax): void { eventsByLine.set(event.location.line, event); }\n override visitSlice(slice: SliceSyntax): void { slicesByLine.set(slice.location.line, slice); super.visitSlice(slice); }\n }();\n walker.visitApplication(original.value);\n const counts = new Map<string, number>();\n const byLine = new Map<number, QuickFixCandidate>();\n // Duplicate removal and legacy spelling can share a header. Keep their independently verified recipes separate.\n const duplicateByLine = new Map<number, QuickFix>();\n const duplicateVerdicts = new Map<number, QuickFix | undefined>();\n const events = new Map<number, EventSyntax>();\n let event: EventSyntax | undefined;\n for (const line of lines) {\n event = eventsByLine.get(line.number) ?? event;\n if (event !== undefined) events.set(line.number, event);\n }\n for (const diagnostic of original.diagnostics) {\n counts.set(diagnostic.code, (counts.get(diagnostic.code) ?? 0) + 1);\n const line = lines[diagnostic.location.line - 1];\n if (diagnostic.code === DiagnosticCodes.DuplicateComplianceMarker) {\n const edit = duplicateComplianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) duplicateByLine.set(line.number, { diagnosticCode: diagnostic.code, title: 'Remove duplicate compliance markers', scope: 'occurrence', edits: [edit] });\n }\n const length = legacyOptionalTypeLength(line.raw, diagnostic);\n if (length > 0) {\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: \"Use 'optional' instead of '?'\", scope: 'occurrence', edits: [{ start: line.startOffset + diagnostic.location.column + length - 2, length: 1, text: ' optional' }] } });\n } else if (diagnostic.code === DiagnosticCodes.DeprecatedStudioTextRulePattern) {\n const rule = rulesByLine.get(line.number);\n if (rule?.rule !== 'Matches' || rule.value?.kind !== 'LiteralExpressionSyntax' || typeof rule.value.value !== 'string') continue;\n const replacement = checkPortableMatchPattern(rule.value.value).replacement;\n const match = new RegExp(`\\\\bmatches\\\\s+\"${stringBodyPattern}\"`).exec(line.raw);\n if (replacement === undefined || match === null) continue;\n const spellings = { Equal: '==', NotEqual: '!=', Contains: 'contains', NotContains: 'not contains', StartsWith: 'starts with', EndsWith: 'ends with' };\n const quoted = '\"' + replacement.value.replace(/[\"\\\\\\n\\r\\t]/g, character => JSON.stringify(character).slice(1, -1)) + '\"';\n byLine.set(line.number, { line: line.number,\n fix: { diagnosticCode: diagnostic.code, title: 'Use the equivalent ordinal text rule', scope: 'occurrence', edits: [{ start: line.startOffset + match.index, length: match[0].length, text: spellings[replacement.kind] + ' ' + quoted }] },\n change: { node: rule, replacement: { ...rule, rule: replacement.kind, value: { ...rule.value, value: replacement.value } } as ValidationRuleSyntax } });\n } else if (diagnostic.code === DiagnosticCodes.LegacyComplianceMarker) {\n const edit = complianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Use bare pii and secret compliance markers', scope: 'occurrence', edits: [edit] } });\n } else if (diagnostic.code === DiagnosticCodes.PublicTranslationRequiresDirection) {\n // PLAY0614 is only reported on the declaration line of a Translate slice that has no direction.\n const slice = slicesByLine.get(line.number)!;\n // Offer a direction only when exactly one is consistent with the slice: the other would add errors.\n const indent = /^\\s*/.exec(line.raw)![0];\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const candidates = [TranslationDirection.Inbound, TranslationDirection.Outbound].map(direction => ({ direction, text: `${ending}${indent} direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}` }))\n .filter(candidate => {\n // The insertion point is the end of an existing line, so the edit is always in bounds.\n const edited = applyQuickFixEdits(source, [{ start: line.startOffset + line.raw.length, length: 0, text: candidate.text }])!;\n const parsed = parseForAuthoring(edited, undefined, options.placement);\n const originalCodes = errorCodes(original);\n // Valid when the missing-direction error is gone and the direction introduces no kind of error the document lacked.\n return acceptable(parsed) && ![...errorCodes(parsed)].some(code => code === DiagnosticCodes.PublicTranslationRequiresDirection || !originalCodes.has(code));\n });\n if (candidates.length === 1) {\n const [{ direction, text }] = candidates;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: `Declare 'direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}'`, scope: 'occurrence', edits: [{ start: line.startOffset + line.raw.length, length: 0, text }] },\n change: { node: slice, replacement: { ...slice, direction } as SliceSyntax } });\n }\n } else if (diagnostic.code === DiagnosticCodes.LegacyProfileLayout) {\n const fix = legacyProfileLayoutFix(lines, line.number - 1, diagnostic.code);\n if (fix !== undefined) byLine.set(line.number, { line: line.number, fix });\n } else if (diagnostic.code === DiagnosticCodes.RedundantEventId && commentStart(line.raw) < 0) {\n const declaration = events.get(line.number);\n if (declaration?.id !== declaration?.name || declaration === undefined) continue;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Remove the redundant event id', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[line.number]?.startOffset ?? source.length) - line.startOffset, text: '' }] },\n change: { node: declaration, replacement: { ...declaration, id: null } as EventSyntax } });\n }\n }\n const spellingCodes = [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker];\n const syntax = verificationShape(original);\n const verified = new Map<number, QuickFix | undefined>();\n let rangeVerdicts: Map<number, QuickFix> | undefined;\n const documentChecked = new Set<string>();\n const documentFixes = new Map<string, QuickFix>();\n const verify = (fix: QuickFix, change?: QuickFixCandidate['change']): QuickFix | undefined => {\n const candidate = applyQuickFixEdits(source, fix.edits);\n if (candidate === undefined) return undefined;\n const parsed = parseForAuthoring(candidate, undefined, options.placement);\n if (!acceptable(parsed) || verificationShape(parsed) !== (change === undefined ? syntax : verificationShape(original, [change]))) return undefined;\n return parsed.diagnostics.filter(diagnostic => diagnostic.code === fix.diagnosticCode).length === (counts.get(fix.diagnosticCode) ?? 0) - fix.edits.length ? fix : undefined;\n };\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' || line === undefined ? undefined : line;\n const duplicateLines = requests === undefined\n ? typeof line === 'number' && (diagnosticCode === undefined || diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker) ? [line] : []\n : requests.filter(request => request.diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker).map(request => request.line);\n const duplicates = [...new Set(duplicateLines)].flatMap(number => {\n const fix = duplicateByLine.get(number);\n if (fix === undefined) return [];\n if (!duplicateVerdicts.has(number)) duplicateVerdicts.set(number, verify(fix));\n const verified = duplicateVerdicts.get(number);\n return verified === undefined ? [] : [verified];\n });\n const selectedCodes = spellingCodes.filter(code => requests === undefined ? diagnosticCode === undefined || diagnosticCode === code : requests.some(request => request.diagnosticCode === code));\n for (const code of selectedCodes.filter(code => !documentChecked.has(code))) {\n const candidates = [...byLine.values()].filter(candidate => candidate.fix.diagnosticCode === code);\n if (candidates.length > 0) {\n const fix = verify({ diagnosticCode: code, title: code === DiagnosticCodes.LegacyOptionalSuffix ? \"Use 'optional' throughout this document\" : 'Use bare pii and secret throughout this document', scope: 'document', edits: candidates.flatMap(candidate => candidate.fix.edits) });\n if (fix !== undefined) documentFixes.set(code, fix);\n }\n documentChecked.add(code);\n }\n const documents = selectedCodes.flatMap(code => documentFixes.has(code) ? [documentFixes.get(code)!] : []);\n if (requests !== undefined) {\n if (rangeVerdicts === undefined) {\n rangeVerdicts = new Map();\n // Source order gives ordered, non-overlapping edits without sorting. Recipes replace\n // distinct nodes/lines; the batch must preserve every other modeled member and remove\n // exactly the expected diagnostics before any of its occurrence edits can be offered.\n const candidates = lines.flatMap(line => byLine.has(line.number) ? [byLine.get(line.number)!] : []);\n const edits = candidates.flatMap(candidate => candidate.fix.edits);\n const candidateSource = applyQuickFixEdits(source, edits);\n if (edits.length > 0 && candidateSource !== undefined) {\n const parsed = parseForAuthoring(candidateSource, undefined, options.placement);\n const changes = candidates.flatMap(candidate => candidate.change === undefined ? [] : [candidate.change]);\n if (acceptable(parsed) && verificationShape(parsed) === verificationShape(original, changes)) {\n const remaining = new Map<string, number>();\n const removed = new Map<string, number>();\n for (const diagnostic of parsed.diagnostics) remaining.set(diagnostic.code, (remaining.get(diagnostic.code) ?? 0) + 1);\n for (const candidate of candidates) removed.set(candidate.fix.diagnosticCode, (removed.get(candidate.fix.diagnosticCode) ?? 0) + candidate.fix.edits.length);\n if ([...removed].every(([code, count]) => (remaining.get(code) ?? 0) === (counts.get(code) ?? 0) - count)) {\n for (const candidate of candidates) rangeVerdicts.set(candidate.line, candidate.fix);\n }\n }\n }\n }\n const selected = new Map<number, QuickFix>();\n for (const request of requests) {\n const fix = rangeVerdicts.get(request.line);\n if (fix?.diagnosticCode === request.diagnosticCode) selected.set(request.line, fix);\n }\n return [...selected.values(), ...duplicates, ...documents];\n }\n const occurrenceLine = typeof line === 'number' ? line : undefined;\n const selected = occurrenceLine === undefined ? undefined : byLine.get(occurrenceLine);\n let occurrenceFix: QuickFix | undefined;\n if (selected !== undefined && occurrenceLine !== undefined && (diagnosticCode === undefined || selected.fix.diagnosticCode === diagnosticCode)) {\n if (!verified.has(occurrenceLine)) {\n if (verified.size === 32) verified.delete(verified.keys().next().value!);\n verified.set(occurrenceLine, verify(selected.fix, selected.change));\n }\n occurrenceFix = verified.get(occurrenceLine);\n }\n return [...(occurrenceFix === undefined ? [] : [occurrenceFix]), ...duplicates, ...documents];\n };\n}\n\n// PLAY0791 is reported on the `ui profile` line. The canonical form is `root template <Name>`; beside a root template the legacy line is ignored, so it is removed.\nfunction legacyProfileLayoutFix(lines: readonly { readonly number: number; readonly raw: string; readonly startOffset: number }[], headerIndex: number, diagnosticCode: string): QuickFix | undefined {\n const indentOf = (raw: string): number => /^\\s*/.exec(raw)![0].length;\n const headerIndent = indentOf(lines[headerIndex].raw);\n let layout: { readonly index: number; readonly indent: number } | undefined;\n let hasRoot = false;\n for (let index = headerIndex + 1; index < lines.length; index++) {\n const raw = lines[index].raw;\n if (raw.trim().length === 0) continue;\n if (indentOf(raw) <= headerIndent) break;\n if (layout === undefined && /^\\s*layout\\s+[A-Za-z_]\\w*\\s*$/.test(raw)) layout = { index, indent: indentOf(raw) };\n if (/^\\s*root\\s+template(\\s|$)/.test(raw)) hasRoot = true;\n }\n if (layout === undefined) return undefined;\n const line = lines[layout.index];\n return hasRoot\n ? { diagnosticCode, title: 'Remove the ignored layout line', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[layout.index + 1]?.startOffset ?? line.startOffset + line.raw.length) - line.startOffset, text: '' }] }\n : { diagnosticCode, title: \"Use 'root template' instead of 'layout'\", scope: 'occurrence', edits: [{ start: line.startOffset + layout.indent, length: 'layout'.length, text: 'root template' }] };\n}\n\nfunction duplicateComplianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header === null) return undefined;\n const suffix = header[2];\n const seen = new Set<string>();\n const text = suffix.replace(new RegExp(pattern('[^\\\\S\\\\r\\\\n]+(@?\\\\w+)').source, 'gu'), (token, marker: string) => {\n const wire = complianceWireName(marker);\n if (seen.has(wire)) return '';\n seen.add(wire);\n return token;\n });\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n}\n\nfunction complianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n // Restrict rewriting to the suffix or leading directive marker, never comments or quoted reasons.\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header !== null) {\n const suffix = header[2];\n const text = suffix.replace(/@pii\\b|@?sensitive\\b/g, marker => marker === '@pii' ? 'pii' : 'secret');\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n }\n const directive = pattern('^(\\\\s*)(@pii|@?sensitive)\\\\b').exec(raw);\n return directive === null ? undefined : { start: startOffset + directive[1].length, length: directive[2].length, text: directive[2] === '@pii' ? 'pii' : 'secret' };\n}\n\nfunction verificationShape(parsed: ReturnType<typeof parseForAuthoring>, changes: readonly NonNullable<QuickFixCandidate['change']>[] = []): string {\n // Compare every modeled member (including trigger data), ignoring only source locations. A recipe\n // may replace only its original node; no other id or destination is normalized away.\n const replacements = new Map(changes.map(change => [change.node, change.replacement]));\n return JSON.stringify([parsed.value, parsed.triggerData], (key, value: unknown) => ['location', 'usesLocation', 'targetLocation'].includes(key) ? undefined : replacements.get(value as NonNullable<QuickFixCandidate['change']>['node']) ?? value);\n}\n\n// One forward pass; applying N edits by repeatedly slicing the document would be quadratic.\nexport function applyQuickFixEdits(source: string, edits: readonly QuickFixEdit[]): string | undefined {\n const parts: string[] = [];\n let end = 0;\n for (const edit of edits) {\n if (edit.start < end || edit.start < 0 || edit.length < 0 || edit.start + edit.length > source.length) return undefined;\n parts.push(source.slice(end, edit.start), edit.text);\n end = edit.start + edit.length;\n }\n parts.push(source.slice(end));\n return parts.join('');\n}\n"],"mappings":"iqBA6CA,SAAgB,qBAAqB,EAA+B,CAChE,OAAOA,IAASC,EAAgB,qBAAuBD,IAASC,EAAgB,iCAAmCD,IAASC,EAAgB,2BAA6BD,IAASC,EAAgB,sBAAwBD,IAASC,EAAgB,wBAA0BD,IAASC,EAAgB,kBAAoBD,IAASC,EAAgB,oCAAsCD,IAASC,EAAgB,mBACtZ,CAGA,SAAgB,yBAAyB,EAAc,EAAgC,CAEnF,OADIC,EAAW,OAASD,EAAgB,qBACjC,2CAA2C,KAAKE,EAAK,MAAMD,EAAW,SAAS,OAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAU,EAD7C,CAEzE,CASA,SAAgB,kBAAkB,EAAgB,EAAqE,CAAC,EAAiH,CACrO,IAAME,EAAQ,uBAAuBC,EAAQC,CAAO,EAChDC,EACJ,OAAQ,EAAM,IAAmB,CAC7B,IAAMC,EAAW,OAAOL,GAAS,SAAW,CAAC,CAAE,OAAM,gBAAe,CAAC,EAAIA,GAAQ,CAAC,EAC5EM,EAAaL,EAAMD,EAAMO,CAAc,EACvCC,EAAWH,EAAS,OAAO,GAAWI,EAAQ,iBAAm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splitLines as e}from"../Parsing/SourceLineSplitter.js";import{authoredOrderOf as t,authoredOriginsOf as n,sameAuthoredStep as r}from"../Files/AuthoredOrder.js";import{timelineOrderFindings as i}from"../Files/TimelineOrder.js";import{parseForAuthoring as a}from"../ScreenplayCompiler.js";import{compileApplication as o}from"../Files/PlayApplicationAssembly.js";import{applyQuickFixEdits as s}from"./QuickFixes.js";var TimelineQuickFixContext=class{documents;compiled;ranks;origins;findings;#e=/* @__PURE__ */ new Map;constructor(e,r){this.documents=e,this.compiled=r,this.ranks=t(r.value),this.origins=n(r.value),this.findings=i(r.value)}block(e,t=!1){return[...this.ranks].sort((e,t)=>e[1]-t[1]).filter(([n])=>this.origins.get(n).some(n=>t?n.path===e.path&&n.node.kind===e.node.kind&&n.node.location.line===e.node.location.line&&n.node.location.column===e.node.location.column:r(n,e))).map(([e])=>e)}move(e,t,n){let r=[...this.ranks].sort((e,t)=>e[1]-t[1]).map(([e])=>e),contiguous=e=>e.length>0&&e.every((t,n)=>r[r.indexOf(e[0])+n]===t);if(!contiguous(e)||!contiguous(t)||e.some(e=>t.includes(e)))return;let i=r.filter(t=>!e.includes(t));return i.splice(i.indexOf(n?t.at(-1):t[0])+ +!!n,0,...e),new Map(i.map((e,t)=>[e,t]))}safe(e,t){let n=new Set(this.findings.filter(e=>e.key!==t.key).map(e=>e.key));return i(this.compiled.value,e).every(e=>n.has(e.key))}parsed(e){return this.#e.has(e)||this.#e.set(e,a(this.documents.get(e),e,this.compiled.documents.find(t=>t.path===e).placement,!1)),this.#e.get(e)}entries(e){let t=[],visit=e=>{for(let n of[`modules`,`features`,`slices`,`fileImports`])(e[n]??[]).forEach((r,i)=>{t.push({node:r,parent:e,member:n,index:i}),(r.kind===`ModuleSyntax`||r.kind===`FeatureSyntax`)&&visit(r)})};return visit(this.parsed(e).value),t}entry(e,t){let n=t.filter(t=>t.node.kind===e.node.kind&&t.node.location.line===e.node.location.line&&t.node.location.column===e.node.location.column);return n.length===1?n[0]:void 0}verify(e,n,r,c){let l=s(this.documents.get(n),e.fix.edits);if(l===void 0)return!1;let u=this.parsed(n),d=a(l,n,this.compiled.documents.find(e=>e.path===n).placement,!1),shape=(t,n=!1)=>JSON.stringify(t,(t,r)=>[`location`,`usesLocation`,`targetLocation`].includes(t)?void 0:n&&e.change!==void 0&&r===e.change.node?e.change.replacement:r);if(shape([u.value,u.triggerData],!0)!==shape([d.value,d.triggerData]))return!1;let f=new Map(this.documents).set(n,l),p=o(f);if(p.success!==this.compiled.success||p.documents.length!==this.compiled.documents.length||p.documents.some(e=>{let t=this.compiled.documents.find(t=>t.path===e.path);return t===void 0||t.isPlacementResolved!==e.isPlacementResolved||JSON.stringify(t.placement)!==JSON.stringify(e.placement)}))return!1;let m=t(p.value);if(m.size!==r.size||[...r].some(([e,t])=>m.get(e)!==t))return!1;let problems=e=>e.diagnostics.filter(e=>e.severity!==`information`).map(e=>JSON.stringify([e.code,e.severity,e.message,e.location.path])),h=problems(this.compiled),g=problems(p);if(g.some(e=>g.filter(t=>t===e).length>h.filter(t=>t===e).length))return!1;let _=new Set(this.findings.filter(e=>e.key!==c.key).map(e=>e.key));return i(p.value).every(e=>_.has(e.key))}};function moveTimelineText(t,n,r,i){let a=e(t),span=e=>{let n=a[e.location.line-1],r=/^\s*/.exec(n.raw)[0].length,i=a.slice(e.location.line).find(e=>e.raw.trim().length>0&&!e.raw.trimStart().startsWith(`//`)&&/^\s*/.exec(e.raw)[0].length<=r);return{start:n.startOffset,end:i?.startOffset??t.length}},o=span(n),s=span(r),c=i?s.end:s.start,l=t.includes(`\r
2
+ `)?`\r
3
+ `:`
4
+ `,u=t.slice(o.start,o.end);return c<t.length&&!u.endsWith(`
5
+ `)&&(u+=l),c===t.length&&!t.endsWith(`
6
+ `)&&(u=l+u.replace(/\r?\n$/,``)),c<o.start?t.slice(0,c)+u+t.slice(c,o.start)+t.slice(o.end):t.slice(0,o.start)+t.slice(o.end,c)+u+t.slice(c)}export{TimelineQuickFixContext,moveTimelineText};
7
+ //# sourceMappingURL=TimelineQuickFixContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineQuickFixContext.js","names":["documents","compiled","authoredOrderOf","authoredOriginsOf","timelineOrderFindings","left","right","key","occurrence","origin","step","sameAuthoredStep","keys","block","index","moved","anchor","result","after","allowed","finding","target","ranks","#parsed","path","parseForAuthoring","document","member","parent","node","found","entries","entry","source","applyQuickFixEdits","candidate","original","parsed","value","replace","compileApplication","before","actual","rank","application","diagnostic","problem","lines","splitLines","line","indent","next","ending"],"sources":["../../../../../../Compiler/Authoring/TimelineQuickFixContext.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationCompilation, compileApplication } from '../Files/PlayApplicationAssembly';\nimport { AuthoredOrderStep, authoredOrderOf, authoredOriginsOf, sameAuthoredStep } from '../Files/AuthoredOrder';\nimport { TimelineFinding, timelineOrderFindings } from '../Files/TimelineOrder';\nimport { parseForAuthoring } from '../ScreenplayCompiler';\nimport { SyntaxNode } from '../Syntax/SyntaxNode';\nimport { ApplicationSyntax, FeatureSyntax, ModuleSyntax } from '../Syntax/Structure';\nimport { splitLines } from '../Parsing/SourceLineSplitter';\nimport { QuickFixCandidate } from './QuickFixCandidate';\nimport { applyQuickFixEdits } from './QuickFixes';\n\nexport interface TimelineEntry {\n readonly node: SyntaxNode;\n readonly parent: ApplicationSyntax | ModuleSyntax | FeatureSyntax;\n readonly member: 'modules' | 'features' | 'slices' | 'fileImports';\n readonly index: number;\n}\n\nexport class TimelineQuickFixContext {\n readonly ranks: ReadonlyMap<string, number>;\n readonly origins: ReadonlyMap<string, readonly AuthoredOrderStep[]>;\n readonly findings: readonly TimelineFinding[];\n readonly #parsed = new Map<string, ReturnType<typeof parseForAuthoring>>();\n constructor(readonly documents: ReadonlyMap<string, string>, readonly compiled: ApplicationCompilation) {\n this.ranks = authoredOrderOf(compiled.value);\n this.origins = authoredOriginsOf(compiled.value);\n this.findings = timelineOrderFindings(compiled.value);\n }\n block(step: AuthoredOrderStep, occurrence = false): string[] {\n return [...this.ranks].sort((left, right) => left[1] - right[1]).filter(([key]) => this.origins.get(key)!.some(origin => occurrence\n ? origin.path === step.path && origin.node.kind === step.node.kind && origin.node.location.line === step.node.location.line && origin.node.location.column === step.node.location.column\n : sameAuthoredStep(origin, step))).map(([key]) => key);\n }\n move(moved: readonly string[], anchor: readonly string[], after: boolean): ReadonlyMap<string, number> | undefined {\n const keys = [...this.ranks].sort((left, right) => left[1] - right[1]).map(([key]) => key);\n const contiguous = (block: readonly string[]) => block.length > 0 && block.every((key, index) => keys[keys.indexOf(block[0]) + index] === key);\n if (!contiguous(moved) || !contiguous(anchor) || moved.some(key => anchor.includes(key))) return undefined;\n const result = keys.filter(key => !moved.includes(key));\n result.splice(result.indexOf(after ? anchor.at(-1)! : anchor[0]) + (after ? 1 : 0), 0, ...moved);\n return new Map(result.map((key, index) => [key, index]));\n }\n safe(ranks: ReadonlyMap<string, number>, target: TimelineFinding): boolean {\n const allowed = new Set(this.findings.filter(finding => finding.key !== target.key).map(finding => finding.key));\n return timelineOrderFindings(this.compiled.value, ranks).every(finding => allowed.has(finding.key));\n }\n parsed(path: string): ReturnType<typeof parseForAuthoring> {\n if (!this.#parsed.has(path)) this.#parsed.set(path, parseForAuthoring(this.documents.get(path)!, path, this.compiled.documents.find(document => document.path === path)!.placement, false));\n return this.#parsed.get(path)!;\n }\n entries(path: string): TimelineEntry[] {\n const result: TimelineEntry[] = [];\n const visit = (parent: ApplicationSyntax | ModuleSyntax | FeatureSyntax) => {\n for (const member of ['modules', 'features', 'slices', 'fileImports'] as const) {\n const children = (parent as unknown as Record<string, readonly SyntaxNode[]>)[member] ?? [];\n children.forEach((node, index) => {\n result.push({ node, parent, member, index });\n if (node.kind === 'ModuleSyntax' || node.kind === 'FeatureSyntax') visit(node as ModuleSyntax | FeatureSyntax);\n });\n }\n };\n visit(this.parsed(path).value);\n return result;\n }\n entry(step: AuthoredOrderStep, entries: readonly TimelineEntry[]): TimelineEntry | undefined {\n const found = entries.filter(entry => entry.node.kind === step.node.kind && entry.node.location.line === step.node.location.line && entry.node.location.column === step.node.location.column);\n return found.length === 1 ? found[0] : undefined;\n }\n verify(candidate: QuickFixCandidate, path: string, ranks: ReadonlyMap<string, number>, finding: TimelineFinding): boolean {\n const source = applyQuickFixEdits(this.documents.get(path)!, candidate.fix.edits);\n if (source === undefined) return false;\n const original = this.parsed(path);\n const parsed = parseForAuthoring(source, path, this.compiled.documents.find(document => document.path === path)!.placement, false);\n const shape = (value: unknown, replace = false) => JSON.stringify(value, (key, node: unknown) => ['location', 'usesLocation', 'targetLocation'].includes(key) ? undefined : replace && candidate.change !== undefined && node === candidate.change.node ? candidate.change.replacement : node);\n if (shape([original.value, original.triggerData], true) !== shape([parsed.value, parsed.triggerData])) return false;\n const documents = new Map(this.documents).set(path, source);\n const compiled = compileApplication(documents);\n if (compiled.success !== this.compiled.success || compiled.documents.length !== this.compiled.documents.length || compiled.documents.some(document => {\n const before = this.compiled.documents.find(original => original.path === document.path);\n return before === undefined || before.isPlacementResolved !== document.isPlacementResolved || JSON.stringify(before.placement) !== JSON.stringify(document.placement);\n })) return false;\n const actual = authoredOrderOf(compiled.value);\n if (actual.size !== ranks.size || [...ranks].some(([key, rank]) => actual.get(key) !== rank)) return false;\n const problems = (application: ApplicationCompilation) => application.diagnostics.filter(diagnostic => diagnostic.severity !== 'information').map(diagnostic => JSON.stringify([diagnostic.code, diagnostic.severity, diagnostic.message, diagnostic.location.path]));\n const before = problems(this.compiled), after = problems(compiled);\n if (after.some(problem => after.filter(value => value === problem).length > before.filter(value => value === problem).length)) return false;\n const allowed = new Set(this.findings.filter(original => original.key !== finding.key).map(original => original.key));\n return timelineOrderFindings(compiled.value).every(candidate => allowed.has(candidate.key));\n }\n}\n\n/** Move intact physical text blocks; keep the enclosing source and its line-ending convention. */\nexport function moveTimelineText(source: string, moved: SyntaxNode, anchor: SyntaxNode, after: boolean): string {\n const lines = splitLines(source);\n const span = (node: SyntaxNode) => {\n const line = lines[node.location.line - 1];\n const indent = /^\\s*/.exec(line.raw)![0].length;\n const next = lines.slice(node.location.line).find(candidate => candidate.raw.trim().length > 0 && !candidate.raw.trimStart().startsWith('//') && /^\\s*/.exec(candidate.raw)![0].length <= indent);\n return { start: line.startOffset, end: next?.startOffset ?? source.length };\n };\n const left = span(moved), right = span(anchor);\n const target = after ? right.end : right.start;\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n let block = source.slice(left.start, left.end);\n if (target < source.length && !block.endsWith('\\n')) block += ending;\n if (target === source.length && !source.endsWith('\\n')) block = ending + block.replace(/\\r?\\n$/, '');\n return target < left.start ? source.slice(0, target) + block + source.slice(target, left.start) + source.slice(left.end)\n : source.slice(0, left.start) + source.slice(left.end, target) + block + source.slice(target);\n}\n"],"mappings":"ydAoBA,IAAa,wBAAb,KAAqC,CAKZ,UAAiD,SAJtE,MACA,QACA,SACA,mBAAmB,IAAI,IACvB,YAAY,EAAiD,EAA2C,CAAnF,KAAA,UAAAA,EAAiD,KAAA,SAAAC,EAClE,KAAK,MAAQC,EAAgBD,EAAS,KAAK,EAC3C,KAAK,QAAUE,EAAkBF,EAAS,KAAK,EAC/C,KAAK,SAAWG,EAAsBH,EAAS,KAAK,CACxD,CACA,MAAM,EAAyB,EAAa,GAAiB,CACzD,MAAO,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,MAAM,EAAM,IAAUI,EAAK,GAAKC,EAAM,EAAE,CAAC,CAAC,QAAQ,CAACC,KAAS,KAAK,QAAQ,IAAIA,CAAG,CAAC,CAAE,KAAK,GAAUC,EACnHC,EAAO,OAASC,EAAK,MAAQD,EAAO,KAAK,OAASC,EAAK,KAAK,MAAQD,EAAO,KAAK,SAAS,OAASC,EAAK,KAAK,SAAS,MAAQD,EAAO,KAAK,SAAS,SAAWC,EAAK,KAAK,SAAS,OAChLC,EAAiBF,EAAQC,CAAI,CAAC,CAAC,CAAC,CAAC,K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R,EAAQoB,EAAO,MAAMZ,CAAM,CACpG"}
@@ -0,0 +1,5 @@
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{commentStart as e,splitLines as t}from"../Parsing/SourceLineSplitter.js";import{matchesPlayPattern as n,resolvePlayPattern as r}from"../Files/PlayGlob.js";const hasMetacharacters=e=>/[*?[\]{}]/.test(e),relativePath=(e,t)=>{let n=e.split(`/`).slice(0,-1),r=t.split(`/`);for(;n.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>`..`),...r].join(`/`)};function timelineImportFix(i,a,o,s,c,l){let u=i.documents.get(o.path),d=t(u),f=d[c.node.location.line-1],p=/^\s*/.exec(f.raw)[0],m=u.includes(`\r
2
+ `)?`\r
3
+ `:`
4
+ `,h=c.parent.fileImports,propose=(t,n,r,s)=>{if(t.some(hasMetacharacters))return;let l=t.map(e=>({kind:`FileImportSyntax`,pattern:relativePath(o.path,e),location:c.node.location})),g={...c.parent,fileImports:[...h.slice(0,c.index),...l,...h.slice(c.index+r)]},_=r===0?f.startOffset:d[h[c.index+r-1].location.line]?.startOffset??u.length,v=new Set(h.slice(c.index,c.index+r).map(e=>e.location.line)),y=(r===0?[]:d.filter(e=>e.startOffset>=f.startOffset&&e.startOffset<_).flatMap(t=>{if(!v.has(t.number))return[u.slice(t.startOffset,d[t.number]?.startOffset??u.length)];let n=e(t.raw);return n<0?[]:[`${p}${t.raw.slice(n)}${m}`]})).join(``)+l.map(e=>`${p}import ${JSON.stringify(e.pattern)}${m}`).join(``),b={line:a.diagnostic.location.line,change:{node:c.parent,replacement:g},fix:{diagnosticCode:a.diagnostic.code,title:s,scope:`occurrence`,line:a.diagnostic.location.line,edits:[{path:o.path,start:f.startOffset,length:_-f.startOffset,text:y}]}};return i.verify(b,o.path,n,a)?b:void 0};if(c.index===l.index){let e=[...new Map([...i.origins.values()].flatMap(e=>e).filter(e=>e.path===o.path&&e.node.kind===`FileImportSyntax`&&e.node.location.line===o.node.location.line).map(e=>[e.targetPath,e])).values()].sort((e,t)=>e.matchIndex-t.matchIndex);if(e.length<2)return;let t=e.map(e=>e.targetPath),n=[...i.ranks].sort((e,t)=>e[1]-t[1]).map(([e])=>e),r=e.flatMap(e=>i.block(e)),c=n.indexOf(r[0]);if(!r.every((e,t)=>n[c+t]===e))return;let ranksFor=a=>{let o=[...a,...t.filter(e=>!a.includes(e))].flatMap(t=>i.block(e.find(e=>e.targetPath===t))),s=[...n];return s.splice(c,r.length,...o),new Map(s.map((e,t)=>[e,t]))},l=ranksFor([s.targetPath]);if(i.safe(l,a))return propose([s.targetPath],l,0,`Pin timeline order before the glob (new files remain imported)`);for(let e of[!1,!0]){let n=[...t],r=e?o.targetPath:s.targetPath,c=e?s.targetPath:o.targetPath;n.splice(n.indexOf(r),1),n.splice(n.indexOf(c)+ +!!e,0,r);let l=ranksFor(n);if(i.safe(l,a))for(let e=1;e<=n.length;e++){let t=n.slice(0,e),r=ranksFor(t);if(![...l].some(([e,t])=>r.get(e)!==t))return propose(t,r,0,`Pin timeline order before the glob (new files remain imported)`)}}return}if(c.index>l.index)return;let g=h.slice(c.index,l.index+1);if(!g.some(e=>hasMetacharacters(e.pattern)))return;let _=g.flatMap(e=>i.compiled.documents.filter(t=>t.path!==o.path&&n(r(o.path,e.pattern),t.path)).map(e=>e.path).sort());if(new Set(_).size===_.length)for(let e of[!1,!0]){let t=i.move(i.block(e?o:s),i.block(e?s:o),e);if(t===void 0||!i.safe(t,a))continue;let n=[..._],r=e?o.targetPath:s.targetPath,c=e?s.targetPath:o.targetPath;if(!n.includes(r)||!n.includes(c))continue;n.splice(n.indexOf(r),1),n.splice(n.indexOf(c)+ +!!e,0,r);let l=propose(n,t,g.length,`Replace timeline globs with ordered imports (new files need explicit imports)`);if(l!==void 0)return l}}export{timelineImportFix};
5
+ //# sourceMappingURL=TimelineQuickFixImports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineQuickFixImports.js","names":["path","folder","document","parts","target","source","context","left","lines","splitLines","line","entry","indent","ending","imports","paths","nodes","replacement","remove","last","importLines","imported","text","candidate","comment","commentStart","node","finding","ranks","other","steps","chain","step","right","keys","key","all","position","index","ordered","prefix","result","single","after","desired","moved","anchor","count","rank","selected","matchesPlayPattern","resolvePlayPattern"],"sources":["../../../../../../Compiler/Authoring/TimelineQuickFixImports.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { AuthoredOrderStep } from '../Files/AuthoredOrder';\nimport { TimelineFinding } from '../Files/TimelineOrder';\nimport { matchesPlayPattern, resolvePlayPattern } from '../Files/PlayGlob';\nimport { FileImportSyntax } from '../Syntax/Structure';\nimport { commentStart, splitLines } from '../Parsing/SourceLineSplitter';\nimport { QuickFixCandidate } from './QuickFixCandidate';\nimport { TimelineEntry, TimelineQuickFixContext } from './TimelineQuickFixContext';\n\nconst hasMetacharacters = (path: string) => /[*?[\\]{}]/.test(path);\nconst relativePath = (document: string, target: string): string => {\n const folder = document.split('/').slice(0, -1), parts = target.split('/');\n while (folder.length > 0 && folder[0] === parts[0]) { folder.shift(); parts.shift(); }\n return [...folder.map(() => '..'), ...parts].join('/');\n};\n\nexport function timelineImportFix(context: TimelineQuickFixContext, finding: TimelineFinding, left: AuthoredOrderStep, right: AuthoredOrderStep, entry: TimelineEntry, other: TimelineEntry): QuickFixCandidate | undefined {\n const source = context.documents.get(left.path)!;\n const lines = splitLines(source);\n const line = lines[entry.node.location.line - 1];\n const indent = /^\\s*/.exec(line.raw)![0];\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const imports = (entry.parent as unknown as { fileImports: readonly FileImportSyntax[] }).fileImports;\n const propose = (paths: readonly string[], ranks: ReadonlyMap<string, number>, remove: number, title: string): QuickFixCandidate | undefined => {\n if (paths.some(hasMetacharacters)) return undefined;\n const nodes = paths.map(path => ({ kind: 'FileImportSyntax' as const, pattern: relativePath(left.path, path), location: entry.node.location }));\n const replacement = { ...entry.parent, fileImports: [...imports.slice(0, entry.index), ...nodes, ...imports.slice(entry.index + remove)] };\n const last = remove === 0 ? line.startOffset : lines[imports[entry.index + remove - 1].location.line]?.startOffset ?? source.length;\n // Keep comments attached to each replaced import exactly once. Pins leave the original line intact.\n const importLines = new Set(imports.slice(entry.index, entry.index + remove).map(imported => imported.location.line));\n const comments = remove === 0 ? [] : lines.filter(candidate => candidate.startOffset >= line.startOffset && candidate.startOffset < last).flatMap(candidate => {\n if (!importLines.has(candidate.number)) return [source.slice(candidate.startOffset, lines[candidate.number]?.startOffset ?? source.length)];\n const comment = commentStart(candidate.raw);\n return comment < 0 ? [] : [`${indent}${candidate.raw.slice(comment)}${ending}`];\n });\n const text = comments.join('') + nodes.map(node => `${indent}import ${JSON.stringify(node.pattern)}${ending}`).join('');\n const candidate: QuickFixCandidate = { line: finding.diagnostic.location.line, change: { node: entry.parent, replacement }, fix: {\n diagnosticCode: finding.diagnostic.code, title, scope: 'occurrence', line: finding.diagnostic.location.line,\n edits: [{ path: left.path, start: line.startOffset, length: last - line.startOffset, text }],\n } };\n return context.verify(candidate, left.path, ranks, finding) ? candidate : undefined;\n };\n if (entry.index === other.index) {\n const steps = [...new Map([...context.origins.values()].flatMap(chain => chain).filter(step => step.path === left.path && step.node.kind === 'FileImportSyntax' && step.node.location.line === left.node.location.line).map(step => [step.targetPath!, step])).values()].sort((left, right) => left.matchIndex! - right.matchIndex!);\n if (steps.length < 2) return undefined;\n const paths = steps.map(step => step.targetPath!);\n const keys = [...context.ranks].sort((left, right) => left[1] - right[1]).map(([key]) => key);\n const all = steps.flatMap(step => context.block(step));\n const position = keys.indexOf(all[0]);\n if (!all.every((key, index) => keys[position + index] === key)) return undefined;\n const ranksFor = (prefix: readonly string[]) => {\n const ordered = [...prefix, ...paths.filter(path => !prefix.includes(path))].flatMap(path => context.block(steps.find(step => step.targetPath === path)!));\n const result = [...keys];\n result.splice(position, all.length, ...ordered);\n return new Map(result.map((key, index) => [key, index]));\n };\n const single = ranksFor([right.targetPath!]);\n if (context.safe(single, finding)) return propose([right.targetPath!], single, 0, 'Pin timeline order before the glob (new files remain imported)');\n for (const after of [false, true]) {\n const desired = [...paths];\n const moved = after ? left.targetPath! : right.targetPath!, anchor = after ? right.targetPath! : left.targetPath!;\n desired.splice(desired.indexOf(moved), 1);\n desired.splice(desired.indexOf(anchor) + (after ? 1 : 0), 0, moved);\n const ranks = ranksFor(desired);\n if (!context.safe(ranks, finding)) continue;\n for (let count = 1; count <= desired.length; count++) {\n const prefix = desired.slice(0, count);\n const candidate = ranksFor(prefix);\n if ([...ranks].some(([key, rank]) => candidate.get(key) !== rank)) continue;\n return propose(prefix, candidate, 0, 'Pin timeline order before the glob (new files remain imported)');\n }\n }\n return undefined;\n }\n // Freeze only the affected adjacent import interval. Include files with no ranked declaration.\n if (entry.index > other.index) return undefined;\n const selected = imports.slice(entry.index, other.index + 1);\n if (!selected.some(imported => hasMetacharacters(imported.pattern))) return undefined;\n const paths = selected.flatMap(imported => context.compiled.documents.filter(document => document.path !== left.path && matchesPlayPattern(resolvePlayPattern(left.path, imported.pattern), document.path)).map(document => document.path).sort());\n if (new Set(paths).size !== paths.length) return undefined;\n for (const after of [false, true]) {\n const ranks = context.move(context.block(after ? left : right), context.block(after ? right : left), after);\n if (ranks === undefined || !context.safe(ranks, finding)) continue;\n const desired = [...paths];\n const moved = after ? left.targetPath! : right.targetPath!, anchor = after ? right.targetPath! : left.targetPath!;\n if (!desired.includes(moved) || !desired.includes(anchor)) continue;\n desired.splice(desired.indexOf(moved), 1);\n desired.splice(desired.indexOf(anchor) + (after ? 1 : 0), 0, moved);\n const candidate = propose(desired, ranks, selected.length, 'Replace timeline globs with ordered imports (new files need explicit imports)');\n if (candidate !== undefined) return candidate;\n }\n return undefined;\n}\n"],"mappings":"uNAWA,MAAM,kBAAqB,GAAiB,YAAY,KAAKA,CAAI,EAC3D,cAAgB,EAAkB,IAA2B,CAC/D,IAAMC,EAASC,EAAS,MAAM,GAAG,CAAC,CAAC,MAAM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EAAG,SAC1D,IAAMiB,EAAU,CAAC,GAAG7B,CAAK,EACnB8B,EAAQF,EAAQpC,EAAK,WAAc0B,EAAM,WAAaa,EAASH,EAAQV,EAAM,WAAc1B,EAAK,WACtG,GAAI,CAACqC,EAAQ,SAASC,CAAK,GAAK,CAACD,EAAQ,SAASE,CAAM,EAAG,SAC3DF,EAAQ,OAAOA,EAAQ,QAAQC,CAAK,EAAG,CAAC,EACxCD,EAAQ,OAAOA,EAAQ,QAAQE,CAAM,GAAK,KAAgB,EAAGD,CAAK,EAClE,IAAMtB,EAAY,QAAQqB,EAAShB,EAAOqB,EAAS,OAAQ,+EAA+E,EAC1I,GAAI1B,IAAc,IAAA,GAAW,OAAOA,CACxC,CAEJ"}
@@ -0,0 +1,2 @@
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{authoredOrderKey as t,sameAuthoredStep as n}from"../Files/AuthoredOrder.js";import{compileApplication as r}from"../Files/PlayApplicationAssembly.js";import{TimelineQuickFixContext as i,moveTimelineText as a}from"./TimelineQuickFixContext.js";import{timelineImportFix as o}from"./TimelineQuickFixImports.js";function prepareTimelineQuickFixes(s,c){let l=c.path??`application.play`,u=new Map(c.documents??[[l,s]]);if(u.get(l)!==s||c.documents===void 0&&(c.placement?.length??0)>0)return()=>[];let d=r(u);if(!d.success||d.documents.some(e=>e.isPlacementResolved===!1))return()=>[];let f=new i(u,d),p=/* @__PURE__ */ new Map;return r=>{if(p.has(r))return p.get(r);let i=f.findings.filter(t=>t.diagnostic.code===e.EventFromLaterSlice&&t.diagnostic.location.path===l&&t.diagnostic.location.line===r),s=[];if(i.length===1&&!i[0].ownSubFeature){let e=i[0],l=f.origins.get(t(e.consumerScope)),d=f.origins.get(t(e.producerScope));if(l!==void 0&&d!==void 0){let t=0;for(;t<l.length&&t<d.length&&n(l[t],d[t]);)t++;let i=l[t],p=d[t];if(i!==void 0&&p!==void 0&&i.path===p.path){let t=f.entries(i.path),n=f.entry(i,t),l=f.entry(p,t);if(n!==void 0&&l!==void 0&&n.parent===l.parent&&n.member===l.member){let t;if(n.index!==l.index)for(let o of[!1,!0]){let s=o?n:l,c=o?l:n,d=o?i:p,m=o?p:i,h=f.move(f.block(d,d.node.kind===`FileImportSyntax`),f.block(m,m.node.kind===`FileImportSyntax`),o);if(h===void 0||!f.safe(h,e))continue;let g=[...n.parent[n.member]];g.splice(s.index,1),g.splice(g.indexOf(c.node)+ +!!o,0,s.node);let _={...n.parent,[n.member]:g},v=u.get(i.path);if(t={line:r,change:{node:n.parent,replacement:_},fix:{diagnosticCode:e.diagnostic.code,line:r,title:e.readModel?`Draw the read-model builder before its reader`:`Draw the event producer before its consumer`,scope:`occurrence`,edits:[{path:i.path,start:0,length:v.length,text:a(v,s.node,c.node,o)}]}},f.verify(t,i.path,h,e))break;t=void 0}t===void 0&&i.node.kind===`FileImportSyntax`&&p.node.kind===`FileImportSyntax`&&(t=o(f,e,i,p,n,l)),t!==void 0&&s.push(c.documents===void 0?{...t.fix,edits:t.fix.edits.map(({path:e,...t})=>t)}:t.fix)}}}}return p.size===32&&p.delete(p.keys().next().value),p.set(r,s),s}}export{prepareTimelineQuickFixes};
2
+ //# sourceMappingURL=TimelineQuickFixes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineQuickFixes.js","names":["path","options","documents","source","compiled","compileApplication","document","context","TimelineQuickFixContext","cache","line","findings","finding","DiagnosticCodes","candidates","consumer","authoredOrderKey","producer","common","sameAuthoredStep","left","right","entries","first","second","candidate","after","moved","anchor","movedStep","anchorStep","ranks","siblings","replacement","original","moveTimelineText","timelineImportFix","_path","edit"],"sources":["../../../../../../Compiler/Authoring/TimelineQuickFixes.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { authoredOrderKey, sameAuthoredStep } from '../Files/AuthoredOrder';\nimport { compileApplication } from '../Files/PlayApplicationAssembly';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { QuickFix, QuickFixOptions } from './QuickFixes';\nimport { QuickFixCandidate } from './QuickFixCandidate';\nimport { TimelineQuickFixContext, moveTimelineText } from './TimelineQuickFixContext';\nimport { timelineImportFix } from './TimelineQuickFixImports';\nimport { SyntaxNode } from '../Syntax/SyntaxNode';\n\n/** Owns one immutable application snapshot. No recipe is derived from diagnostic message text. */\nexport function prepareTimelineQuickFixes(source: string, options: QuickFixOptions): (line: number) => QuickFix[] {\n const path = options.path ?? 'application.play';\n const documents = new Map(options.documents ?? [[path, source]]);\n if (documents.get(path) !== source || (options.documents === undefined && (options.placement?.length ?? 0) > 0)) return () => [];\n const compiled = compileApplication(documents);\n if (!compiled.success || compiled.documents.some(document => document.isPlacementResolved === false)) return () => [];\n const context = new TimelineQuickFixContext(documents, compiled);\n const cache = new Map<number, QuickFix[]>();\n return line => {\n if (cache.has(line)) return cache.get(line)!;\n const findings = context.findings.filter(finding => finding.diagnostic.code === DiagnosticCodes.EventFromLaterSlice && finding.diagnostic.location.path === path && finding.diagnostic.location.line === line);\n const candidates: QuickFix[] = [];\n // Several event references on one line cannot be addressed unambiguously by this line-only API.\n if (findings.length === 1 && !findings[0].ownSubFeature) {\n const finding = findings[0];\n const consumer = context.origins.get(authoredOrderKey(finding.consumerScope));\n const producer = context.origins.get(authoredOrderKey(finding.producerScope));\n if (consumer !== undefined && producer !== undefined) {\n let common = 0;\n while (common < consumer.length && common < producer.length && sameAuthoredStep(consumer[common], producer[common])) common++;\n const left = consumer[common], right = producer[common];\n if (left !== undefined && right !== undefined && left.path === right.path) {\n const entries = context.entries(left.path);\n const first = context.entry(left, entries), second = context.entry(right, entries);\n if (first !== undefined && second !== undefined && first.parent === second.parent && first.member === second.member) {\n let candidate: QuickFixCandidate | undefined;\n if (first.index !== second.index) {\n for (const after of [false, true]) {\n const moved = after ? first : second, anchor = after ? second : first;\n const movedStep = after ? left : right, anchorStep = after ? right : left;\n const ranks = context.move(context.block(movedStep, movedStep.node.kind === 'FileImportSyntax'), context.block(anchorStep, anchorStep.node.kind === 'FileImportSyntax'), after);\n if (ranks === undefined || !context.safe(ranks, finding)) continue;\n const siblings = [...(first.parent as unknown as Record<string, readonly SyntaxNode[]>)[first.member]];\n siblings.splice(moved.index, 1);\n siblings.splice(siblings.indexOf(anchor.node) + (after ? 1 : 0), 0, moved.node);\n const replacement = { ...first.parent, [first.member]: siblings };\n const original = documents.get(left.path)!;\n candidate = { line, change: { node: first.parent, replacement }, fix: {\n diagnosticCode: finding.diagnostic.code, line, title: finding.readModel ? 'Draw the read-model builder before its reader' : 'Draw the event producer before its consumer', scope: 'occurrence',\n edits: [{ path: left.path, start: 0, length: original.length, text: moveTimelineText(original, moved.node, anchor.node, after) }],\n } };\n if (context.verify(candidate, left.path, ranks, finding)) break;\n candidate = undefined;\n }\n }\n if (candidate === undefined && left.node.kind === 'FileImportSyntax' && right.node.kind === 'FileImportSyntax') candidate = timelineImportFix(context, finding, left, right, first, second);\n if (candidate !== undefined) candidates.push(options.documents === undefined ? { ...candidate.fix, edits: candidate.fix.edits.map(({ path: _path, ...edit }) => edit) } : candidate.fix);\n }\n }\n }\n }\n if (cache.size === 32) cache.delete(cache.keys().next().value!);\n cache.set(line, candidates);\n return candidates;\n };\n}\n"],"mappings":"mbAaA,SAAgB,0BAA0B,EAAgB,EAAwD,CAC9G,IAAMA,EAAOC,EAAQ,MAAQ,mBACvBC,EAAY,IAAI,IAAID,EAAQ,WAAa,CAAC,CAACD,EAAMG,CAAM,CAAC,CAAC,EAC/D,GAAID,EAAU,IAAIF,CAAI,IAAMG,GAAWF,EAAQ,YAAc,IAAA,KAAcA,EAAQ,WAAW,QAAU,GAAK,EAAI,UAAa,CAAC,EAC/H,IAAMG,EAAWC,EAAmBH,CAAS,EAC7C,GAAI,CAACE,EAAS,SAAWA,EAAS,UAAU,KAAK,GAAYE,EAAS,sBAAwB,EAAK,EAAG,UAAa,CAAC,EACpH,IAAMC,EA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,EAAO,GAAGC,KAAWA,CAAI,CAAE,EAAIb,EAAU,GAAG,CAC3L,CACJ,CACJ,CACJ,CAGA,OAFIhB,EAAM,OAAS,IAAIA,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAM,EAC9DA,EAAM,IAAIC,EAAMI,CAAU,EACnBA,CACX,CACJ"}
@@ -1,2 +1,2 @@
1
- const e={DuplicateBehaviorAttachment:`PLAY0340`,UnknownMatchPattern:`PLAY0366`,InvalidMatchPattern:`PLAY0367`,PatternOutsidePortableMatchDialect:`PLAY0699`,DeprecatedStudioTextRulePattern:`PLAY0787`,InvalidIdentityDeclaration:`PLAY0633`,DuplicateIdentity:`PLAY0634`,InvalidIdentityDetail:`PLAY0635`,UnknownIdentitySource:`PLAY0636`,IdentityDetailWithoutSource:`PLAY0637`,IdentitySourceWithBody:`PLAY0638`,DuplicateIdentityDetail:`PLAY0639`,BuiltInIdentityDetail:`PLAY0640`,UnknownIdentityQuery:`PLAY0641`,InvalidIdentityQuery:`PLAY0642`,IdentityQueryWithoutKey:`PLAY0643`,InvalidIdentityQueryKey:`PLAY0644`,IdentityQueryAuthorizationDependency:`PLAY0645`,IdentityQueryTypeMismatch:`PLAY0646`,InvalidReactionIdentity:`PLAY0647`,GatedInvocationWithoutIdentity:`PLAY0648`,UnusedReactionIdentity:`PLAY0649`,UnusedReactionRole:`PLAY0650`,UnsatisfiedReactionIdentity:`PLAY0651`,ReactionPrivilegeEscalation:`PLAY0652`,CommandProducesPublicEvent:`PLAY0607`,PublicEventRequiresOutboundTranslation:`PLAY0608`,OutboundPublicEventCount:`PLAY0609`,ForeignPublicEventConsumer:`PLAY0610`,OutboundTranslationInput:`PLAY0611`,InboundTranslationOutput:`PLAY0612`,ForeignPublicEventProduced:`PLAY0613`,PublicTranslationRequiresDirection:`PLAY0614`,TranslationConstructDirection:`PLAY0615`,InboundTranslationInput:`PLAY0616`,OutboundTranslationOutput:`PLAY0617`,EventTargetOutsideOutboundTranslation:`PLAY0618`,EventsSourceOutsideInboundTranslation:`PLAY0619`,InvalidCaptureEventsSource:`PLAY0620`,CaptureEventsFromSeveralOrigins:`PLAY0687`,DirectionlessTranslationReactsToOwnCapture:`PLAY0694`,PendingIntentWithOtherHandler:`PLAY0698`,CommandHandlerRequiresAttachment:`PLAY0800`,DescribedCommandNotImplemented:`PLAY0695`,DescribedCommandWithoutProductions:`PLAY0696`,DescribedCommandCardinalityNotAdmitted:`PLAY0697`,CaptureEventsKeyNotRequired:`PLAY0700`,CaptureEventsRecordFixture:`PLAY0701`,RefutedGeneratedConceptRule:`PLAY0688`,UnprovenGeneratedConceptRule:`PLAY0689`,InvalidExposureDeclaration:`PLAY0621`,UnknownExposureOwner:`PLAY0622`,ReExposureCycle:`PLAY0623`,ReExposureBroken:`PLAY0624`,InvalidInstanceContribution:`PLAY0625`,UnknownContributionInstance:`PLAY0626`,ContributionNotExposed:`PLAY0627`,ContributionTypeMismatch:`PLAY0628`,UnknownTemplateContentSlot:`PLAY0629`,UnknownNavigationOutlet:`PLAY0630`,TemplateScopeMismatch:`PLAY0631`,IncompatibleComponentPackage:`PLAY0632`,UnknownNavigationDestination:`PLAY0654`,UnknownScreenContributionPoint:`PLAY0655`,TemplateNestingCycle:`PLAY0656`,TemplateCategoryMissing:`PLAY0720`,InvalidTemplateVersionRange:`PLAY0721`,LegacyProfileLayout:`PLAY0791`,UnknownTemplateBlueprint:`PLAY0722`,DuplicateComplianceMarker:`PLAY0653`,LegacyComplianceMarker:`PLAY0565`,UnknownComplianceMarker:`PLAY0566`,InvalidSecretScope:`PLAY0567`,DuplicateSecretScope:`PLAY0568`,SecretScopeIgnoredForPii:`PLAY0569`,InvalidPersonalDataQualifier:`PLAY0570`,DuplicateSpecialCategory:`PLAY0571`,InvalidPurposeDeclaration:`PLAY0596`,InvalidPurposeVocabulary:`PLAY0597`,DuplicatePurposeField:`PLAY0598`,DuplicatePurposeDeclaration:`PLAY0599`,UnknownPurpose:`PLAY0600`,PurposeInterestMismatch:`PLAY0601`,PersonalDataWithoutPurpose:`PLAY0602`,SpecialDataWithoutCondition:`PLAY0603`,CriminalDataWithoutAuthorization:`PLAY0604`,PurposeWithoutBasis:`PLAY0605`,UnusedPurpose:`PLAY0606`,ConflictingScreenDataBinding:`PLAY0530`,ScreenDataQueryMismatch:`PLAY0531`,ActionWithoutInputSurface:`PLAY0532`,CommandWithoutInputSurface:`PLAY0533`,ReadModelFieldWithoutOrigin:`PLAY0534`,QueryParameterNotHeldByView:`PLAY0535`,UnconsumedEvent:`PLAY0536`,UnreachableScreen:`PLAY0537`,UnknownActionSubjectField:`PLAY0345`,UnresolvedActionSubject:`PLAY0346`,UnreachableActionAlternative:`PLAY0347`,UnknownActionArgumentProperty:`PLAY0348`,UnreachableRefusalBranch:`PLAY0540`,InvalidRefusalValue:`PLAY0541`,UnknownRefusalConstraint:`PLAY0542`,UnknownRedeliveryReaction:`PLAY0544`,IndeterminateNegatedClaimTarget:`PLAY0546`,InvalidRefusalBranch:`PLAY0538`,InvalidRefusalBranchBody:`PLAY0539`,UnmatchedRedeliveredOccurrence:`PLAY0543`,InvalidNoEventsExpectation:`PLAY0545`,InvalidProducesDeclaration:`PLAY0042`,ProducesWhenWithoutEvent:`PLAY0043`,InvalidPropertyMapping:`PLAY0044`,DuplicateProducesTarget:`PLAY0193`,EventSourceIdInPayload:`PLAY0469`,ExplicitProducesTargetsRequired:`PLAY0470`,RedundantEventId:`PLAY0471`,InvalidEventId:`PLAY0472`,InlineEventCollision:`PLAY0473`,InlineEventOutsideCommand:`PLAY0474`,InlineEventGeneration:`PLAY0475`,ReservedProductionMetadata:`PLAY0476`,InvalidEventDocumentation:`PLAY0477`,OmittedProductionDestination:`PLAY0478`,UnknownConstraintProperty:`PLAY0391`,UnknownTopLevelConstruct:`PLAY0001`,InvalidDomainDeclaration:`PLAY0002`,DuplicateDomain:`PLAY0003`,DomainNotFirst:`PLAY0004`,InvalidImportDeclaration:`PLAY0005`,TabIndentation:`PLAY0006`,InvalidConceptDeclaration:`PLAY0007`,UnknownPrimitiveType:`PLAY0008`,InvalidEnumerationValue:`PLAY0009`,UnknownConceptDirective:`PLAY0010`,ValidateReadAsEnumerationBlock:`PLAY0011`,AttributeReasonWithoutAttribute:`PLAY0012`,DuplicateAttributeReason:`PLAY0013`,InvalidTypeDeclaration:`PLAY0014`,TypeWithoutProperties:`PLAY0015`,InvalidPropertyDeclaration:`PLAY0016`,IdentifierOutsideCommand:`PLAY0017`,InvalidEventDeclaration:`PLAY0018`,IdentifierOnEventProperty:`PLAY0019`,TagPropertyReadAsTag:`PLAY0020`,InvalidModuleDeclaration:`PLAY0021`,UnknownModuleDirective:`PLAY0022`,InvalidFeatureDeclaration:`PLAY0023`,UnknownFeatureDirective:`PLAY0024`,InvalidSliceDeclaration:`PLAY0027`,UnknownSliceType:`PLAY0028`,UnknownSliceDirective:`PLAY0029`,InvalidPersonaDeclaration:`PLAY0030`,InvalidPersonaPolicyReference:`PLAY0031`,UnknownPersonaDirective:`PLAY0032`,InvalidCommandDeclaration:`PLAY0033`,UnknownCommandDirective:`PLAY0034`,DuplicateCommandIdentifier:`PLAY0036`,InvalidQueryDeclaration:`PLAY0047`,UnknownQueryDirective:`PLAY0048`,InvalidQueryParameter:`PLAY0049`,InvalidProjectionDeclaration:`PLAY0056`,EmptyProjection:`PLAY0057`,UnknownProjectionDirective:`PLAY0058`,FromWithoutEvent:`PLAY0061`,InvalidEventReference:`PLAY0062`,InvalidJoinDeclaration:`PLAY0063`,JoinWithoutEvent:`PLAY0064`,InvalidChildrenDeclaration:`PLAY0065`,InvalidNestedDeclaration:`PLAY0066`,NestedBlockWithoutFrom:`PLAY0067`,InvalidRemoveDeclaration:`PLAY0068`,UnknownRemoveDirective:`PLAY0069`,InvalidClearDeclaration:`PLAY0070`,ClearWithOutsideNestedBlock:`PLAY0071`,InvalidSpecificationDeclaration:`PLAY0094`,UnknownSpecificationDirective:`PLAY0095`,InvalidSpecificationWhen:`PLAY0096`,DuplicateSpecificationWhen:`PLAY0097`,InvalidThenError:`PLAY0098`,InvalidReadModelStep:`PLAY0099`,InvalidEventStep:`PLAY0100`,InvalidSpecificationValue:`PLAY0101`,InvalidScreenDeclaration:`PLAY0102`,UnknownScreenDirective:`PLAY0103`,InvalidDataDirective:`PLAY0104`,InvalidActionDirective:`PLAY0105`,UnknownActionDirective:`PLAY0106`,InvalidNavigation:`PLAY0107`,InvalidScreenLayoutSlot:`PLAY0108`,UnknownLayoutDirective:`PLAY0026`,InvalidTitleDirective:`PLAY0109`,UnknownTableDirective:`PLAY0110`,UnknownSummaryDirective:`PLAY0111`,AuthorizeWithoutPolicy:`PLAY0122`,InvalidPolicyReference:`PLAY0123`,InvalidConstraintDeclaration:`PLAY0132`,ConstraintWithoutRule:`PLAY0133`,InvalidConstraintBody:`PLAY0134`,DuplicateConstraintBody:`PLAY0135`,InvalidReactionDeclaration:`PLAY0136`,InvalidReactionTrigger:`PLAY0137`,ReactionWithoutTrigger:`PLAY0138`,InvalidValidateDeclaration:`PLAY0140`,InvalidValidationRule:`PLAY0141`,InvalidRuleName:`PLAY0143`,UnknownRuleImplementationDirective:`PLAY0144`,InvalidDescription:`PLAY0145`,EmptyDescription:`PLAY0146`,DuplicateDescription:`PLAY0147`,TagWithoutValue:`PLAY0148`,InvalidTagValue:`PLAY0149`,UnknownContextPath:`PLAY0153`,UnknownContextCausedByProperty:`PLAY0154`,UnknownContextIdentityProperty:`PLAY0155`,ExpectedCodeFence:`PLAY0163`,UnclosedCodeBlock:`PLAY0164`,DuplicateDeclaration:`PLAY0168`,RepeatedSingularDeclarationAcrossFiles:`PLAY0172`,RepeatedDeclarationAcrossFiles:`PLAY0173`,ConflictingDescriptionAcrossFiles:`PLAY0174`,UnexpectedTokenInAuthorize:`PLAY0184`,UnclosedAuthorizeGroup:`PLAY0185`,InvalidReadModelDeclaration:`PLAY0186`,InvalidInvokesDeclaration:`PLAY0194`,InvalidScopeDeclaration:`PLAY0199`,DuplicateScope:`PLAY0200`,InvalidIntervalTrigger:`PLAY0249`,InvalidScheduleTrigger:`PLAY0250`,DuplicateReactionTrigger:`PLAY0253`,InvalidSpecificationEventSource:`PLAY0275`,DuplicateSpecificationEventSource:`PLAY0276`,InvalidProjectionVariantDeclaration:`PLAY0277`,InvalidEntersOnDeclaration:`PLAY0279`,NestedProjectionVariantNotAllowed:`PLAY0280`,InvalidStructuredValue:`PLAY0291`,DuplicateStructuredValueMember:`PLAY0294`,ConflictingSpecificationActions:`PLAY0358`,InvalidSpecificationEventOrder:`PLAY0359`,InvalidValidationSeverity:`PLAY0368`,VariantRequiresEnteringEvent:`PLAY0382`,DuplicateEventInProjectionScope:`PLAY0801`,ReservedStoredName:`PLAY0802`,DuplicateProjectionVariant:`PLAY0384`,DuplicateVariantEnteringEvent:`PLAY0385`,InvalidSpecificationDenied:`PLAY0388`,DuplicateAuthorizationAcrossFiles:`PLAY0394`,FileConstraintOnlySupportsUniqueness:`PLAY0396`,LegacyInlineCodeFence:`PLAY0397`,InvalidEventGeneration:`PLAY0446`,InvalidFileImport:`PLAY0454`,FileImportMatchesNothing:`PLAY0455`,ImportedFileNotFound:`PLAY0456`,ConflictingImportPlacement:`PLAY0457`,ImportCycle:`PLAY0458`,ModuleInPlacedFile:`PLAY0459`,UnexpectedInPlacedFile:`PLAY0460`,InvalidSpecificationClock:`PLAY0461`,InvalidSpecificationTrigger:`PLAY0462`,InvalidSpecificationCapture:`PLAY0463`,InvalidSpecificationQueryAction:`PLAY0464`,MismatchedSpecificationQueryResult:`PLAY0465`,UnknownSpecificationQueryArgument:`PLAY0468`,InvalidSpecificationQuery:`PLAY0265`,UnknownSpecificationQueryDirective:`PLAY0266`,DuplicateSpecificationQueryArguments:`PLAY0267`,InvalidAbsentReadModelStep:`PLAY0453`,LegacyOptionalSuffix:`PLAY0479`,InvalidOptionalModifierOrder:`PLAY0480`,OptionalReadsNotSupported:`PLAY0481`,InvalidSpecificationCaller:`PLAY0386`,DuplicateSpecificationCallerOrDenied:`PLAY0387`,GeneratedPropertyOutsideCommand:`PLAY0482`,InvalidGeneratedType:`PLAY0483`,InvalidGeneratedModifierOrder:`PLAY0484`,DuplicateEventSubject:`PLAY0590`,InvalidSubjectType:`PLAY0591`,ProtectedSubjectType:`PLAY0592`,InvalidSubjectOwner:`PLAY0593`,ReadModelSubjectNotSupported:`PLAY0594`,InvalidSubjectModifierOrder:`PLAY0595`,GeneratedPropertySuppliedAsInput:`PLAY0485`,InvalidCommandResponse:`PLAY0486`,InvalidResponseSource:`PLAY0487`,DuplicateResponseField:`PLAY0488`,InvalidResponseShape:`PLAY0489`,InvalidGeneratedFixture:`PLAY0490`,InvalidReturnExpectation:`PLAY0491`,InvalidImplementationBlock:`PLAY0492`,InvalidImplementationHint:`PLAY0493`,ConflictingImplementationSources:`PLAY0494`,UnknownType:`PLAY0165`,InvalidSystemDeclaration:`PLAY0495`,InvalidOperationDeclaration:`PLAY0496`,InvalidProductionReference:`PLAY0497`,ProductionDeclarationCollision:`PLAY0498`,OperationOutsideCommand:`PLAY0499`,InvalidSystemReference:`PLAY0500`,InvalidOperationMapping:`PLAY0501`,InvalidOperationSpecification:`PLAY0502`,InvalidCaptureDeclaration:`PLAY0078`,UnknownCaptureDirective:`PLAY0079`,InvalidMapEntry:`PLAY0080`,InvalidTranslation:`PLAY0081`,InvalidSplitDeclaration:`PLAY0082`,InvalidSplitTarget:`PLAY0083`,InvalidAppendDeclaration:`PLAY0084`,UnknownAppendDirective:`PLAY0085`,WhenWithoutTrigger:`PLAY0086`,InvalidWhenClause:`PLAY0087`,InvalidWhenTransitionClause:`PLAY0088`,MixedWhenCombinators:`PLAY0089`,WhenCombinatorWithoutProperty:`PLAY0090`,UnknownCaptureBlockDirective:`PLAY0091`,InvalidCompositeKeyPart:`PLAY0072`,TemplateInCompositeKey:`PLAY0073`,EmptyCompositeKey:`PLAY0074`,InvalidProjectionMapping:`PLAY0075`,ExpectedLiteralValue:`PLAY0150`,InvalidExpression:`PLAY0152`,UnterminatedInterpolation:`PLAY0157`,UnterminatedTemplateExpression:`PLAY0156`,ProjectionDocumentWithoutProjection:`PLAY0055`,CaptureDocumentWithoutCapture:`PLAY0077`,SpecificationDocumentWithoutSpecification:`PLAY0093`,InvalidSeedDeclaration:`PLAY0128`,InvalidSeedGroup:`PLAY0129`,InvalidSeedEvent:`PLAY0130`,InvalidSeedPropertyAssignment:`PLAY0131`,InvalidPolicyDeclaration:`PLAY0112`,UnknownPolicyDirective:`PLAY0113`,PolicyWithoutRequirement:`PLAY0114`,ExpectedRoleName:`PLAY0118`,ExpectedClaimName:`PLAY0119`,ExpectedClaimMatches:`PLAY0120`,ExpectedClaimMatchTarget:`PLAY0121`,MixedPolicyImplementation:`PLAY0440`,RepeatedPolicyRequirement:`PLAY0441`,UnexpectedTokenInPolicyCondition:`PLAY0115`,ExpectedPolicyCondition:`PLAY0116`,UnclosedPolicyConditionGroup:`PLAY0117`,UnexpectedTokenInCondition:`PLAY0158`,ExpectedCondition:`PLAY0159`,ExpectedComparisonOperator:`PLAY0161`,ExpectedComparisonValue:`PLAY0162`,InvalidActionAlternative:`PLAY0341`,GuardedActionWithoutAlternatives:`PLAY0342`,MisplacedActionOtherwise:`PLAY0343`,UnsupportedActionConditionOperand:`PLAY0344`,InvalidInteractionArgument:`PLAY0319`,UnclosedConditionGroup:`PLAY0160`,InvalidNumericDirective:`PLAY0508`,DuplicateNumericDirective:`PLAY0509`,LateNumericDirective:`PLAY0510`,InexactNumericLiteral:`PLAY0511`,MixedNumericModes:`PLAY0512`,IncompatibleNumericSource:`PLAY0513`,EventFromLaterSlice:`PLAY0516`,TimelineCycleGroup:`PLAY0517`,InvalidSpecificationExample:`PLAY0518`,DuplicateSpecificationAssignment:`PLAY0519`,UnresolvedSpecificationExampleType:`PLAY0520`,SpecificationExampleNameCollision:`PLAY0521`,SpecificationExampleKindMismatch:`PLAY0522`,InvalidSpecificationExampleValue:`PLAY0523`,MissingSpecificationProperty:`PLAY0524`,UnadmittedSpecificationExampleValue:`PLAY0525`,InvalidSpecificationExampleBody:`PLAY0526`,AmbiguousReference:`PLAY0198`,InvalidSpecificationStream:`PLAY0547`,SpecificationStreamOnCommand:`PLAY0548`,InvalidSpecificationStreamRoute:`PLAY0549`,InvalidSpecificationStreamEventSource:`PLAY0550`,SpecificationStreamContradictsCommand:`PLAY0551`,InvalidDependencyTarget:`PLAY0554`,RepeatedDependencyDeclaration:`PLAY0555`,UndeclaredDependency:`PLAY0552`,UnusedDependencyDeclaration:`PLAY0553`,MutualDependencyDeclarations:`PLAY0556`,AuthorizationRefusalWithoutIdentity:`PLAY0557`,InvalidDocumentation:`PLAY0558`,ConflictingDocumentationAcrossFiles:`PLAY0559`,InvalidSpecificationCallerPersona:`PLAY0572`,UnsynthesizablePersonaCaller:`PLAY0573`,PersonaWithoutGate:`PLAY0574`,GateWithoutPersona:`PLAY0575`,AmbiguousPersonaCaller:`PLAY0576`,InvalidSpecificationParameter:`PLAY0577`,InvalidSpecificationCase:`PLAY0578`,DuplicateSpecificationParameter:`PLAY0579`,DuplicateSpecificationCase:`PLAY0580`,IncompleteSpecificationTable:`PLAY0581`,InvalidSpecificationCaseAssignment:`PLAY0582`,InvalidSpecificationCaseValue:`PLAY0583`,InvalidSpecificationCaseReference:`PLAY0584`,OptionalSpecificationParameterTarget:`PLAY0585`,SpecificationCaseNameCollision:`PLAY0586`,IncompatibleSpecificationParameterType:`PLAY0587`,UnusedSpecificationParameter:`PLAY0588`,SingularSpecificationTableExpansion:`PLAY0589`,UnsupportedInteractionAlternatives:`PLAY0560`,MixedInteractionAlternatives:`PLAY0561`,InteractionAlternativeWithoutActions:`PLAY0562`,InlineInteractionAlternative:`PLAY0563`,LegacyInteractionWhere:`PLAY0564`,InvalidEventSourceDeclaration:`PLAY0503`,InvalidCommandStream:`PLAY0504`,AmbiguousCommandStream:`PLAY0505`,UnsupportedStreamIdType:`PLAY0506`,RedundantSourceStreamId:`PLAY0507`,UnknownEvent:`PLAY0166`,UnknownReadModelProperty:`PLAY0514`,PiiNotSupportedOnIdentifier:`PLAY0515`,HandlerWithoutImplementation:`PLAY0045`,UnknownHandlerDirective:`PLAY0046`,CommandWithProducesAndHandler:`PLAY0035`,AbsoluteFileReference:`PLAY0264`,InvalidTriggerData:`PLAY0246`,InvalidReadModelKey:`PLAY0660`,IncompleteReadModelKey:`PLAY0661`,InvalidReadModelKeyLookup:`PLAY0662`,ProductionRouteOutsideCommand:`PLAY0663`,RedundantProductionRoute:`PLAY0664`,InvalidObserverFilter:`PLAY0665`,ObserverFilterExcludesEveryProducer:`PLAY0666`,ReducerIdentityMismatch:`PLAY0690`,InvalidReactionBatchesDeclaration:`PLAY0693`,InvalidCommandReadsDeclaration:`PLAY0780`,GenerationSupportBudgetExceeded:`PLAY0691`,EmptyGenerationSupport:`PLAY0692`,MixedEnumerationNumbering:`PLAY0667`,DuplicateEnumerationNumber:`PLAY0668`,EnumerationNumberOutsideInt32:`PLAY0669`,MalformedEnumerationNumber:`PLAY0670`,UnpinnedStoredEnumeration:`PLAY0671`,ReadsWithChildren:`PLAY0451`,UnknownGenerationStrategy:`PLAY0672`,InvalidGenerationArgument:`PLAY0673`,InvalidGenerationModifier:`PLAY0674`,DuplicateGenerationModifier:`PLAY0675`,DuplicateGeneration:`PLAY0676`,InvalidGenerationPrimitive:`PLAY0677`,InvalidGenerationPrefix:`PLAY0678`,InvalidGenerationAlphabet:`PLAY0679`,InvalidTypeIdPrefix:`PLAY0680`,GenerationSizeOutsideRange:`PLAY0681`,ReservedSequenceGeneration:`PLAY0682`,LowGenerationEntropy:`PLAY0683`,LowGeneratedIdentifierEntropy:`PLAY0684`,ResponseNameUsedOnFailure:`PLAY0685`,EventIdPinNotCarriedToRenderers:`PLAY0686`,InvalidToolbarButton:`PLAY0760`};export{e as DiagnosticCodes};
1
+ const e={DuplicateBehaviorAttachment:`PLAY0340`,UnknownMatchPattern:`PLAY0366`,InvalidMatchPattern:`PLAY0367`,PatternOutsidePortableMatchDialect:`PLAY0699`,AmbiguousMatchPattern:`PLAY0803`,DeprecatedStudioTextRulePattern:`PLAY0787`,InvalidIdentityDeclaration:`PLAY0633`,DuplicateIdentity:`PLAY0634`,InvalidIdentityDetail:`PLAY0635`,UnknownIdentitySource:`PLAY0636`,IdentityDetailWithoutSource:`PLAY0637`,IdentitySourceWithBody:`PLAY0638`,DuplicateIdentityDetail:`PLAY0639`,BuiltInIdentityDetail:`PLAY0640`,UnknownIdentityQuery:`PLAY0641`,InvalidIdentityQuery:`PLAY0642`,IdentityQueryWithoutKey:`PLAY0643`,InvalidIdentityQueryKey:`PLAY0644`,IdentityQueryAuthorizationDependency:`PLAY0645`,IdentityQueryTypeMismatch:`PLAY0646`,InvalidReactionIdentity:`PLAY0647`,GatedInvocationWithoutIdentity:`PLAY0648`,UnusedReactionIdentity:`PLAY0649`,UnusedReactionRole:`PLAY0650`,UnsatisfiedReactionIdentity:`PLAY0651`,ReactionPrivilegeEscalation:`PLAY0652`,CommandProducesPublicEvent:`PLAY0607`,PublicEventRequiresOutboundTranslation:`PLAY0608`,OutboundPublicEventCount:`PLAY0609`,ForeignPublicEventConsumer:`PLAY0610`,OutboundTranslationInput:`PLAY0611`,InboundTranslationOutput:`PLAY0612`,ForeignPublicEventProduced:`PLAY0613`,PublicTranslationRequiresDirection:`PLAY0614`,TranslationConstructDirection:`PLAY0615`,InboundTranslationInput:`PLAY0616`,OutboundTranslationOutput:`PLAY0617`,EventTargetOutsideOutboundTranslation:`PLAY0618`,EventsSourceOutsideInboundTranslation:`PLAY0619`,InvalidCaptureEventsSource:`PLAY0620`,CaptureEventsFromSeveralOrigins:`PLAY0687`,DirectionlessTranslationReactsToOwnCapture:`PLAY0694`,PendingIntentWithOtherHandler:`PLAY0698`,CommandHandlerRequiresAttachment:`PLAY0800`,DescribedCommandNotImplemented:`PLAY0695`,DescribedCommandWithoutProductions:`PLAY0696`,DescribedCommandCardinalityNotAdmitted:`PLAY0697`,CaptureEventsKeyNotRequired:`PLAY0700`,CaptureEventsRecordFixture:`PLAY0701`,RefutedGeneratedConceptRule:`PLAY0688`,UnprovenGeneratedConceptRule:`PLAY0689`,InvalidExposureDeclaration:`PLAY0621`,UnknownExposureOwner:`PLAY0622`,ReExposureCycle:`PLAY0623`,ReExposureBroken:`PLAY0624`,InvalidInstanceContribution:`PLAY0625`,UnknownContributionInstance:`PLAY0626`,ContributionNotExposed:`PLAY0627`,ContributionTypeMismatch:`PLAY0628`,UnknownTemplateContentSlot:`PLAY0629`,UnknownNavigationOutlet:`PLAY0630`,TemplateScopeMismatch:`PLAY0631`,IncompatibleComponentPackage:`PLAY0632`,UnknownNavigationDestination:`PLAY0654`,UnknownScreenContributionPoint:`PLAY0655`,TemplateNestingCycle:`PLAY0656`,TemplateCategoryMissing:`PLAY0720`,InvalidTemplateVersionRange:`PLAY0721`,LegacyProfileLayout:`PLAY0791`,UnknownTemplateBlueprint:`PLAY0722`,DuplicateComplianceMarker:`PLAY0653`,LegacyComplianceMarker:`PLAY0565`,UnknownComplianceMarker:`PLAY0566`,InvalidSecretScope:`PLAY0567`,DuplicateSecretScope:`PLAY0568`,SecretScopeIgnoredForPii:`PLAY0569`,InvalidPersonalDataQualifier:`PLAY0570`,DuplicateSpecialCategory:`PLAY0571`,InvalidPurposeDeclaration:`PLAY0596`,InvalidPurposeVocabulary:`PLAY0597`,DuplicatePurposeField:`PLAY0598`,DuplicatePurposeDeclaration:`PLAY0599`,UnknownPurpose:`PLAY0600`,PurposeInterestMismatch:`PLAY0601`,PersonalDataWithoutPurpose:`PLAY0602`,SpecialDataWithoutCondition:`PLAY0603`,CriminalDataWithoutAuthorization:`PLAY0604`,PurposeWithoutBasis:`PLAY0605`,UnusedPurpose:`PLAY0606`,ConflictingScreenDataBinding:`PLAY0530`,ScreenDataQueryMismatch:`PLAY0531`,ActionWithoutInputSurface:`PLAY0532`,CommandWithoutInputSurface:`PLAY0533`,ReadModelFieldWithoutOrigin:`PLAY0534`,QueryParameterNotHeldByView:`PLAY0535`,UnconsumedEvent:`PLAY0536`,UnreachableScreen:`PLAY0537`,UnknownActionSubjectField:`PLAY0345`,UnresolvedActionSubject:`PLAY0346`,UnreachableActionAlternative:`PLAY0347`,UnknownActionArgumentProperty:`PLAY0348`,UnreachableRefusalBranch:`PLAY0540`,InvalidRefusalValue:`PLAY0541`,UnknownRefusalConstraint:`PLAY0542`,UnknownRedeliveryReaction:`PLAY0544`,IndeterminateNegatedClaimTarget:`PLAY0546`,InvalidRefusalBranch:`PLAY0538`,InvalidRefusalBranchBody:`PLAY0539`,UnmatchedRedeliveredOccurrence:`PLAY0543`,InvalidNoEventsExpectation:`PLAY0545`,InvalidProducesDeclaration:`PLAY0042`,ProducesWhenWithoutEvent:`PLAY0043`,InvalidPropertyMapping:`PLAY0044`,DuplicateProducesTarget:`PLAY0193`,EventSourceIdInPayload:`PLAY0469`,ExplicitProducesTargetsRequired:`PLAY0470`,RedundantEventId:`PLAY0471`,InvalidEventId:`PLAY0472`,InlineEventCollision:`PLAY0473`,InlineEventOutsideCommand:`PLAY0474`,InlineEventGeneration:`PLAY0475`,ReservedProductionMetadata:`PLAY0476`,InvalidEventDocumentation:`PLAY0477`,OmittedProductionDestination:`PLAY0478`,UnknownConstraintProperty:`PLAY0391`,UnknownTopLevelConstruct:`PLAY0001`,InvalidDomainDeclaration:`PLAY0002`,DuplicateDomain:`PLAY0003`,DomainNotFirst:`PLAY0004`,InvalidImportDeclaration:`PLAY0005`,TabIndentation:`PLAY0006`,InvalidConceptDeclaration:`PLAY0007`,UnknownPrimitiveType:`PLAY0008`,InvalidEnumerationValue:`PLAY0009`,UnknownConceptDirective:`PLAY0010`,ValidateReadAsEnumerationBlock:`PLAY0011`,AttributeReasonWithoutAttribute:`PLAY0012`,DuplicateAttributeReason:`PLAY0013`,InvalidTypeDeclaration:`PLAY0014`,TypeWithoutProperties:`PLAY0015`,InvalidPropertyDeclaration:`PLAY0016`,IdentifierOutsideCommand:`PLAY0017`,InvalidEventDeclaration:`PLAY0018`,IdentifierOnEventProperty:`PLAY0019`,TagPropertyReadAsTag:`PLAY0020`,InvalidModuleDeclaration:`PLAY0021`,UnknownModuleDirective:`PLAY0022`,InvalidFeatureDeclaration:`PLAY0023`,UnknownFeatureDirective:`PLAY0024`,InvalidSliceDeclaration:`PLAY0027`,UnknownSliceType:`PLAY0028`,UnknownSliceDirective:`PLAY0029`,InvalidPersonaDeclaration:`PLAY0030`,InvalidPersonaPolicyReference:`PLAY0031`,UnknownPersonaDirective:`PLAY0032`,InvalidCommandDeclaration:`PLAY0033`,UnknownCommandDirective:`PLAY0034`,DuplicateCommandIdentifier:`PLAY0036`,InvalidQueryDeclaration:`PLAY0047`,UnknownQueryDirective:`PLAY0048`,InvalidQueryParameter:`PLAY0049`,InvalidProjectionDeclaration:`PLAY0056`,EmptyProjection:`PLAY0057`,UnknownProjectionDirective:`PLAY0058`,FromWithoutEvent:`PLAY0061`,InvalidEventReference:`PLAY0062`,InvalidJoinDeclaration:`PLAY0063`,JoinWithoutEvent:`PLAY0064`,InvalidChildrenDeclaration:`PLAY0065`,InvalidNestedDeclaration:`PLAY0066`,NestedBlockWithoutFrom:`PLAY0067`,InvalidRemoveDeclaration:`PLAY0068`,UnknownRemoveDirective:`PLAY0069`,InvalidClearDeclaration:`PLAY0070`,ClearWithOutsideNestedBlock:`PLAY0071`,InvalidSpecificationDeclaration:`PLAY0094`,UnknownSpecificationDirective:`PLAY0095`,InvalidSpecificationWhen:`PLAY0096`,DuplicateSpecificationWhen:`PLAY0097`,InvalidThenError:`PLAY0098`,InvalidReadModelStep:`PLAY0099`,InvalidEventStep:`PLAY0100`,InvalidSpecificationValue:`PLAY0101`,InvalidScreenDeclaration:`PLAY0102`,UnknownScreenDirective:`PLAY0103`,InvalidDataDirective:`PLAY0104`,InvalidActionDirective:`PLAY0105`,UnknownActionDirective:`PLAY0106`,InvalidNavigation:`PLAY0107`,InvalidScreenLayoutSlot:`PLAY0108`,UnknownLayoutDirective:`PLAY0026`,InvalidTitleDirective:`PLAY0109`,UnknownTableDirective:`PLAY0110`,UnknownSummaryDirective:`PLAY0111`,AuthorizeWithoutPolicy:`PLAY0122`,InvalidPolicyReference:`PLAY0123`,InvalidConstraintDeclaration:`PLAY0132`,ConstraintWithoutRule:`PLAY0133`,InvalidConstraintBody:`PLAY0134`,DuplicateConstraintBody:`PLAY0135`,InvalidReactionDeclaration:`PLAY0136`,InvalidReactionTrigger:`PLAY0137`,ReactionWithoutTrigger:`PLAY0138`,InvalidValidateDeclaration:`PLAY0140`,InvalidValidationRule:`PLAY0141`,InvalidRuleName:`PLAY0143`,UnknownRuleImplementationDirective:`PLAY0144`,InvalidDescription:`PLAY0145`,EmptyDescription:`PLAY0146`,DuplicateDescription:`PLAY0147`,TagWithoutValue:`PLAY0148`,InvalidTagValue:`PLAY0149`,UnknownContextPath:`PLAY0153`,UnknownContextCausedByProperty:`PLAY0154`,UnknownContextIdentityProperty:`PLAY0155`,ExpectedCodeFence:`PLAY0163`,UnclosedCodeBlock:`PLAY0164`,DuplicateDeclaration:`PLAY0168`,RepeatedSingularDeclarationAcrossFiles:`PLAY0172`,RepeatedDeclarationAcrossFiles:`PLAY0173`,ConflictingDescriptionAcrossFiles:`PLAY0174`,UnexpectedTokenInAuthorize:`PLAY0184`,UnclosedAuthorizeGroup:`PLAY0185`,InvalidReadModelDeclaration:`PLAY0186`,InvalidInvokesDeclaration:`PLAY0194`,InvalidScopeDeclaration:`PLAY0199`,DuplicateScope:`PLAY0200`,InvalidIntervalTrigger:`PLAY0249`,InvalidScheduleTrigger:`PLAY0250`,DuplicateReactionTrigger:`PLAY0253`,InvalidSpecificationEventSource:`PLAY0275`,DuplicateSpecificationEventSource:`PLAY0276`,InvalidProjectionVariantDeclaration:`PLAY0277`,InvalidEntersOnDeclaration:`PLAY0279`,NestedProjectionVariantNotAllowed:`PLAY0280`,InvalidStructuredValue:`PLAY0291`,DuplicateStructuredValueMember:`PLAY0294`,ConflictingSpecificationActions:`PLAY0358`,InvalidSpecificationEventOrder:`PLAY0359`,InvalidValidationSeverity:`PLAY0368`,VariantRequiresEnteringEvent:`PLAY0382`,DuplicateEventInProjectionScope:`PLAY0801`,ReservedStoredName:`PLAY0802`,DuplicateProjectionVariant:`PLAY0384`,DuplicateVariantEnteringEvent:`PLAY0385`,InvalidSpecificationDenied:`PLAY0388`,DuplicateAuthorizationAcrossFiles:`PLAY0394`,FileConstraintOnlySupportsUniqueness:`PLAY0396`,LegacyInlineCodeFence:`PLAY0397`,InvalidEventGeneration:`PLAY0446`,InvalidFileImport:`PLAY0454`,FileImportMatchesNothing:`PLAY0455`,ImportedFileNotFound:`PLAY0456`,ConflictingImportPlacement:`PLAY0457`,ImportCycle:`PLAY0458`,ModuleInPlacedFile:`PLAY0459`,UnexpectedInPlacedFile:`PLAY0460`,InvalidSpecificationClock:`PLAY0461`,InvalidSpecificationTrigger:`PLAY0462`,InvalidSpecificationCapture:`PLAY0463`,InvalidSpecificationQueryAction:`PLAY0464`,MismatchedSpecificationQueryResult:`PLAY0465`,UnknownSpecificationQueryArgument:`PLAY0468`,InvalidSpecificationQuery:`PLAY0265`,UnknownSpecificationQueryDirective:`PLAY0266`,DuplicateSpecificationQueryArguments:`PLAY0267`,InvalidAbsentReadModelStep:`PLAY0453`,LegacyOptionalSuffix:`PLAY0479`,InvalidOptionalModifierOrder:`PLAY0480`,OptionalReadsNotSupported:`PLAY0481`,InvalidSpecificationCaller:`PLAY0386`,DuplicateSpecificationCallerOrDenied:`PLAY0387`,GeneratedPropertyOutsideCommand:`PLAY0482`,InvalidGeneratedType:`PLAY0483`,InvalidGeneratedModifierOrder:`PLAY0484`,DuplicateEventSubject:`PLAY0590`,InvalidSubjectType:`PLAY0591`,ProtectedSubjectType:`PLAY0592`,InvalidSubjectOwner:`PLAY0593`,ReadModelSubjectNotSupported:`PLAY0594`,InvalidSubjectModifierOrder:`PLAY0595`,GeneratedPropertySuppliedAsInput:`PLAY0485`,InvalidCommandResponse:`PLAY0486`,InvalidResponseSource:`PLAY0487`,DuplicateResponseField:`PLAY0488`,InvalidResponseShape:`PLAY0489`,InvalidGeneratedFixture:`PLAY0490`,InvalidReturnExpectation:`PLAY0491`,InvalidImplementationBlock:`PLAY0492`,InvalidImplementationHint:`PLAY0493`,ConflictingImplementationSources:`PLAY0494`,UnknownType:`PLAY0165`,InvalidSystemDeclaration:`PLAY0495`,InvalidOperationDeclaration:`PLAY0496`,InvalidProductionReference:`PLAY0497`,ProductionDeclarationCollision:`PLAY0498`,OperationOutsideCommand:`PLAY0499`,InvalidSystemReference:`PLAY0500`,InvalidOperationMapping:`PLAY0501`,InvalidOperationSpecification:`PLAY0502`,InvalidCaptureDeclaration:`PLAY0078`,UnknownCaptureDirective:`PLAY0079`,InvalidMapEntry:`PLAY0080`,InvalidTranslation:`PLAY0081`,InvalidSplitDeclaration:`PLAY0082`,InvalidSplitTarget:`PLAY0083`,InvalidAppendDeclaration:`PLAY0084`,UnknownAppendDirective:`PLAY0085`,WhenWithoutTrigger:`PLAY0086`,InvalidWhenClause:`PLAY0087`,InvalidWhenTransitionClause:`PLAY0088`,MixedWhenCombinators:`PLAY0089`,WhenCombinatorWithoutProperty:`PLAY0090`,UnknownCaptureBlockDirective:`PLAY0091`,InvalidCompositeKeyPart:`PLAY0072`,TemplateInCompositeKey:`PLAY0073`,EmptyCompositeKey:`PLAY0074`,InvalidProjectionMapping:`PLAY0075`,ExpectedLiteralValue:`PLAY0150`,InvalidExpression:`PLAY0152`,UnterminatedInterpolation:`PLAY0157`,UnterminatedTemplateExpression:`PLAY0156`,ProjectionDocumentWithoutProjection:`PLAY0055`,CaptureDocumentWithoutCapture:`PLAY0077`,SpecificationDocumentWithoutSpecification:`PLAY0093`,InvalidSeedDeclaration:`PLAY0128`,InvalidSeedGroup:`PLAY0129`,InvalidSeedEvent:`PLAY0130`,InvalidSeedPropertyAssignment:`PLAY0131`,InvalidPolicyDeclaration:`PLAY0112`,UnknownPolicyDirective:`PLAY0113`,PolicyWithoutRequirement:`PLAY0114`,ExpectedRoleName:`PLAY0118`,ExpectedClaimName:`PLAY0119`,ExpectedClaimMatches:`PLAY0120`,ExpectedClaimMatchTarget:`PLAY0121`,MixedPolicyImplementation:`PLAY0440`,RepeatedPolicyRequirement:`PLAY0441`,UnexpectedTokenInPolicyCondition:`PLAY0115`,ExpectedPolicyCondition:`PLAY0116`,UnclosedPolicyConditionGroup:`PLAY0117`,UnexpectedTokenInCondition:`PLAY0158`,ExpectedCondition:`PLAY0159`,ExpectedComparisonOperator:`PLAY0161`,ExpectedComparisonValue:`PLAY0162`,InvalidActionAlternative:`PLAY0341`,GuardedActionWithoutAlternatives:`PLAY0342`,MisplacedActionOtherwise:`PLAY0343`,UnsupportedActionConditionOperand:`PLAY0344`,InvalidInteractionArgument:`PLAY0319`,UnclosedConditionGroup:`PLAY0160`,InvalidNumericDirective:`PLAY0508`,DuplicateNumericDirective:`PLAY0509`,LateNumericDirective:`PLAY0510`,InexactNumericLiteral:`PLAY0511`,MixedNumericModes:`PLAY0512`,IncompatibleNumericSource:`PLAY0513`,EventFromLaterSlice:`PLAY0516`,TimelineCycleGroup:`PLAY0517`,InvalidSpecificationExample:`PLAY0518`,DuplicateSpecificationAssignment:`PLAY0519`,UnresolvedSpecificationExampleType:`PLAY0520`,SpecificationExampleNameCollision:`PLAY0521`,SpecificationExampleKindMismatch:`PLAY0522`,InvalidSpecificationExampleValue:`PLAY0523`,MissingSpecificationProperty:`PLAY0524`,UnadmittedSpecificationExampleValue:`PLAY0525`,InvalidSpecificationExampleBody:`PLAY0526`,AmbiguousReference:`PLAY0198`,InvalidSpecificationStream:`PLAY0547`,SpecificationStreamOnCommand:`PLAY0548`,InvalidSpecificationStreamRoute:`PLAY0549`,InvalidSpecificationStreamEventSource:`PLAY0550`,SpecificationStreamContradictsCommand:`PLAY0551`,InvalidDependencyTarget:`PLAY0554`,RepeatedDependencyDeclaration:`PLAY0555`,UndeclaredDependency:`PLAY0552`,UnusedDependencyDeclaration:`PLAY0553`,MutualDependencyDeclarations:`PLAY0556`,AuthorizationRefusalWithoutIdentity:`PLAY0557`,InvalidDocumentation:`PLAY0558`,ConflictingDocumentationAcrossFiles:`PLAY0559`,InvalidSpecificationCallerPersona:`PLAY0572`,UnsynthesizablePersonaCaller:`PLAY0573`,PersonaWithoutGate:`PLAY0574`,GateWithoutPersona:`PLAY0575`,AmbiguousPersonaCaller:`PLAY0576`,InvalidSpecificationParameter:`PLAY0577`,InvalidSpecificationCase:`PLAY0578`,DuplicateSpecificationParameter:`PLAY0579`,DuplicateSpecificationCase:`PLAY0580`,IncompleteSpecificationTable:`PLAY0581`,InvalidSpecificationCaseAssignment:`PLAY0582`,InvalidSpecificationCaseValue:`PLAY0583`,InvalidSpecificationCaseReference:`PLAY0584`,OptionalSpecificationParameterTarget:`PLAY0585`,SpecificationCaseNameCollision:`PLAY0586`,IncompatibleSpecificationParameterType:`PLAY0587`,UnusedSpecificationParameter:`PLAY0588`,SingularSpecificationTableExpansion:`PLAY0589`,UnsupportedInteractionAlternatives:`PLAY0560`,MixedInteractionAlternatives:`PLAY0561`,InteractionAlternativeWithoutActions:`PLAY0562`,InlineInteractionAlternative:`PLAY0563`,LegacyInteractionWhere:`PLAY0564`,InvalidEventSourceDeclaration:`PLAY0503`,InvalidCommandStream:`PLAY0504`,AmbiguousCommandStream:`PLAY0505`,UnsupportedStreamIdType:`PLAY0506`,RedundantSourceStreamId:`PLAY0507`,UnknownEvent:`PLAY0166`,UnknownReadModelProperty:`PLAY0514`,PiiNotSupportedOnIdentifier:`PLAY0515`,HandlerWithoutImplementation:`PLAY0045`,UnknownHandlerDirective:`PLAY0046`,CommandWithProducesAndHandler:`PLAY0035`,AbsoluteFileReference:`PLAY0264`,InvalidTriggerData:`PLAY0246`,InvalidReadModelKey:`PLAY0660`,IncompleteReadModelKey:`PLAY0661`,InvalidReadModelKeyLookup:`PLAY0662`,ProductionRouteOutsideCommand:`PLAY0663`,RedundantProductionRoute:`PLAY0664`,InvalidObserverFilter:`PLAY0665`,ObserverFilterExcludesEveryProducer:`PLAY0666`,ReducerIdentityMismatch:`PLAY0690`,InvalidReactionBatchesDeclaration:`PLAY0693`,InvalidCommandReadsDeclaration:`PLAY0780`,GenerationSupportBudgetExceeded:`PLAY0691`,EmptyGenerationSupport:`PLAY0692`,MixedEnumerationNumbering:`PLAY0667`,DuplicateEnumerationNumber:`PLAY0668`,EnumerationNumberOutsideInt32:`PLAY0669`,MalformedEnumerationNumber:`PLAY0670`,UnpinnedStoredEnumeration:`PLAY0671`,ReadsWithChildren:`PLAY0451`,UnknownGenerationStrategy:`PLAY0672`,InvalidGenerationArgument:`PLAY0673`,InvalidGenerationModifier:`PLAY0674`,DuplicateGenerationModifier:`PLAY0675`,DuplicateGeneration:`PLAY0676`,InvalidGenerationPrimitive:`PLAY0677`,InvalidGenerationPrefix:`PLAY0678`,InvalidGenerationAlphabet:`PLAY0679`,InvalidTypeIdPrefix:`PLAY0680`,GenerationSizeOutsideRange:`PLAY0681`,ReservedSequenceGeneration:`PLAY0682`,LowGenerationEntropy:`PLAY0683`,LowGeneratedIdentifierEntropy:`PLAY0684`,ResponseNameUsedOnFailure:`PLAY0685`,EventIdPinNotCarriedToRenderers:`PLAY0686`,InvalidToolbarButton:`PLAY0760`};export{e as DiagnosticCodes};
2
2
  //# sourceMappingURL=DiagnosticCodes.js.map