@cratis/screenplay-language 4.250.0 → 4.250.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundles/symbols.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e}from"./language.js";import{bmpWordCharacters as t}from"./bmp-word-characters.js";import{typeReferenceSymbol as n}from"./TypeReferenceSymbol.js";import{unescapeString as r}from"./compiler/Text/StringLiteral.js";import{eventBodyReservedWords as i}from"./compiler/Text/ReservedWords.js";import"./compiler/index.js";import{fenceMap as a,indentOf as o}from"./document-context.js";import{eventAnalysisSource as s}from"./event-analysis-source.js";import{responseAnalysis as c}from"./response-analysis.js";import{fileReferenceOn as l}from"./file-references.js";const u=/^concept\s+(\w+)\s*:\s*(\w+)((?:\s
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{clauseKeywords as e}from"./language.js";import{bmpWordCharacters as t}from"./bmp-word-characters.js";import{typeReferenceSymbol as n}from"./TypeReferenceSymbol.js";import{unescapeString as r}from"./compiler/Text/StringLiteral.js";import{eventBodyReservedWords as i}from"./compiler/Text/ReservedWords.js";import"./compiler/index.js";import{fenceMap as a,indentOf as o}from"./document-context.js";import{eventAnalysisSource as s}from"./event-analysis-source.js";import{responseAnalysis as c}from"./response-analysis.js";import{fileReferenceOn as l}from"./file-references.js";const u=/^concept\s+(\w+)\s*:\s*(\w+)((?:\s+@?\w+)*)\s*$/,d=RegExp(`^@?([a-z_][${t}]*)(?:\\s*=\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\s*//.*)?$`),f=/^\s*(@?[a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(\s+generated)?(\s+identifier)?(\s+subject)?\s*$/,p=/^([a-z_]\w*)\s+reason\s+"((?:[^"\\]|\\.)*)"\s*$/,m=/^\s*reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?\s*$/,h=[`authorize`,`produces`,`reads`],g=/^(?:(?:or|and)\s+)?[A-Za-z_(][\p{L}\p{Mn}\p{Nd}\p{Pc}\s()]*$/u,_=i,v=[`tag`,`for`,`generation`,`origin`,`namespace`,`sequence`,`correlation`,`causation`,`causedBy`,`occurred`],y=/^\s*(?:by|filter)\s+([a-z_]\w*)\s+([\w.]+(?:\[\])?(?:\?|\s+optional)?)(?:\s+from\s+.+)?\s*$/;function propertyTypeReference(e){return e.typeReference??n(e.type)}function sourceTypeAt(e,t){let n=e.slice(t-1).match(/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?(?:\?|\s+optional\b)?/u)?.[0]??``;return{text:n,startColumn:t,endColumn:t+n.length}}function propertiesIn(e,t,r){return t.map(t=>({index:t,match:e[t].match(f)})).filter(e=>e.match!==null).filter(({match:e})=>e[1].startsWith(`@`)||e[1]===`as`||!r.includes(e[1])).map(({index:t,match:r})=>({name:r[1].replace(/^@/,``),type:r[2],typeReference:n(r[2]),sourceType:sourceTypeAt(e[t],e[t].match(/^\s*\S+\s+/)[0].length+1),isIdentifier:r[4]!==void 0,...r[3]===void 0?{}:{isGenerated:!0},...r[5]===void 0?{}:{isSubject:!0},line:t}))}function collectBody(e,t,n,r){let i=[];for(let a=n+1;a<e.length;a++){if(t[a])continue;let n=e[a];if(n.trim().length!==0){if(o(n)<=r)break;i.push(a)}}return i}function directBody(e,t,n,r){let i=collectBody(e,t,n,r).filter(n=>!t[n]&&!/^\s*(?:\/\/|#)/.test(e[n]));if(!/^\s*command\b/.test(e[n]))return i;let a,s=!1;return i.filter(t=>{let n=o(e[t]),r=e[t].trim();return a!==void 0&&n>a&&(!s||g.test(r))?!1:(a=r!==`validate csharp`&&propertiesIn(e,[t],h).length>0||/^description(?:\s|$)/.test(r)?void 0:n,s=/^authorize(?:\s|$)/.test(r),!0)})}const b=/* @__PURE__ */ new Map;function scanDocument(t){let i=t.join(`
|
|
2
2
|
`),f=b.get(i);if(f)return f;let h=c(t),g={...h.identityDetails?.length?{identityDetails:h.identityDetails}:{},authoringSources:[i],eventSources:h.eventSources.declarations,imports:[],concepts:[],types:[],policies:[],events:[],commands:[],queries:[],screens:[],triggers:[]};t=s(t);let x=a(t),S=t,C=x,w=t.map(e=>e.replace(/\s*=(?!=|>).*/,``));for(let i=0;i<t.length;i++){if(x[i])continue;let a=t[i],s=a.trim(),c=o(a),f=S[i].trim().match(/^import\s+([\w.]+)(?:\s+from\s+"(?:[^"\\]|\\.)*")?\s*$/);if(f&&c===0){let e=f[1],t=e.split(`.`).pop()??e;g.imports.push({qualifiedName:e,shortName:t,line:i});continue}let b=s.match(u);if(b){let e=collectBody(t,x,i,c),n=e.map(e=>t[e].trim()),r=Math.min(...e.filter(e=>!x[e]&&t[e].trim()!==``).map(e=>o(t[e]))),a=e.find(e=>!x[e]&&o(t[e])===r&&/^\s*generate\s+\w+/.test(t[e])),s=a===void 0?void 0:t[a].match(/^\s*generate\s+(\w+)/)?.[1],l={};for(let e of n){let t=e.match(p);t&&l[t[1]]===void 0&&(l[t[1]]=t[2])}let u=b[2]===`Enum`?n.filter(e=>e!==`validate`).map(e=>d.exec(e)).filter(e=>e!==null):[],f=u.map(e=>e[1]),m=u.length>0&&u.every(e=>e[2]!==void 0)?u.map(e=>Number(e[2])):void 0;g.concepts.push({name:b[1],primitive:b[2],attributes:b[3].trim().split(/\s+/).filter(Boolean),attributeReasons:l,enumValues:f,...m===void 0?{}:{enumNumbers:m},...s===void 0?{}:{generationStrategy:s},line:i});continue}let T=s.match(/^type\s+(\w+)\s*$/);if(T){g.types.push({name:T[1],properties:propertiesIn(t,collectBody(t,x,i,c),e),line:i});continue}let E=s.match(/^policy\s+(\w+)\s*$/);if(E){let e=collectBody(t,x,i,c).filter(e=>!x[e]).map(e=>t[e].trim());g.policies.push({name:E[1],requires:e,line:i});continue}let D=S[i].trim().match(/^(?:(?:produces|(?<public>public))\s+)?event\s+(?<name>\w+)(?:\s+generation\s+(?<generation>\d+))?(?:\s+from\s+(?<origin>"(?:[^"\\]|\\.)*"))?\s*$/);if(D){let e=s.startsWith(`produces `),t=directBody(S,C,i,c),n=e?t:t.filter(e=>l(S[e],e)===void 0);g.events.push({name:D.groups.name,...D.groups.generation?{generation:Number(D.groups.generation)}:{},...D.groups.public||D.groups.origin?{visibility:`Public`}:{},...D.groups.origin?{origin:r(D.groups.origin.slice(1,-1))}:{},inline:e,properties:propertiesIn(e?w:S,n,e?v:_),line:i});continue}let O=h.commands.get(i);if(O){let e=directBody(t,x,i,c),n=e.filter(e=>/^\s*produces\b/.test(t[e])&&!h.operationProductionLines?.has(e));g.commands.push({name:O.name,properties:O.properties.map(e=>({name:e.name,type:`${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}`,typeReference:{name:e.type.name,isCollection:e.type.isCollection,isOptional:e.type.isOptional},sourceType:sourceTypeAt(t[e.type.location.line-1],e.type.location.column),isIdentifier:e.isIdentifier||/\sidentifier\s*$/.test(t[e.location.line-1]),...e.isGenerated?{isGenerated:!0}:{},line:e.location.line-1})),response:O.response,productionHeaders:n,produces:n.flatMap(e=>{let t=S[e].trim(),n=/^produces\s+event\b/.test(t),r=/^produces\s+when\b/.test(t),i=r?directBody(S,C,e,o(S[e]))[0]:e;if(i===void 0)return[];let a=r?S[i].trim():t.match(n?/^produces\s+event\s+([A-Za-z_]\w*)(?:\s+generation\s+\d+)?\s*$/:/^produces\s+([A-Z]\w*)\s*$/)?.[1];if(a===void 0||!/^[A-Za-z_]\w*$/.test(a))return[];let s=directBody(S,C,i,o(S[i])),c=s.map(e=>S[e].trim().match(/^for(?:\s+(.*))?$/)).filter(e=>e!==null);return[{name:a,inline:n,conditional:r,line:e,target:c.length===0?void 0:c.length===1?c[0][1]??``:``,mappings:s.flatMap(e=>{let t=S[e].trim().match(n?/^(@?[a-z_]\w*)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?\s*=(?!=|>)\s*(.+)$/:/^(@?[\w.]+)\s*=(?!=|>)\s*(.+)$/);return t===null?[]:[{name:t[1].replace(/^@/,``),source:t[2],line:e}]})}]}),reads:e.filter(e=>!x[e]).map(e=>({line:e,match:t[e].match(m)})).filter(e=>e.match!==null).map(({line:e,match:t})=>({view:t[1],...t[2]?{alias:t[2]}:{},...t[3]?{by:t[3]}:{},line:e})),line:i});continue}let k=s.match(/^query\s+(\w+)\s*=>\s*(?:observable\s+)?([\w.]+(?:\[\])?(?:\?|\s+optional)?)\s*$/);if(k){let e=collectBody(t,x,i,c).map(e=>({index:e,match:t[e].match(y)})).filter(e=>e.match!==null).map(({index:e,match:r})=>({name:r[1],type:r[2],typeReference:n(r[2]),sourceType:sourceTypeAt(t[e],t[e].match(/^\s*(?:by|filter)\s+\S+\s+/)[0].length+1),isIdentifier:!1,line:e}));g.queries.push({name:k[1],returnType:k[2],returnTypeReference:n(k[2]),parameters:e,line:i});continue}let A=s.match(/^screen\s+(\w+)\s*$/);if(A){g.screens.push({name:A[1],line:i});continue}let j=s.match(/^trigger\s+(\w+)\s*$/);j&&c===0&&g.triggers.push({name:j[1],line:i})}return b.size>=16&&b.delete(b.keys().next().value),b.set(i,g),g}function mergeSymbols(...e){return{...e.some(e=>e.identityDetails?.length)?{identityDetails:e.flatMap(e=>e.identityDetails??[])}:{},authoringSources:e.flatMap(e=>e.authoringSources??[]),...e.some(e=>e.authoringDocuments)?{authoringDocuments:e.flatMap(e=>e.authoringDocuments??[])}:{},eventSources:e.flatMap(e=>e.eventSources??[]),imports:e.flatMap(e=>e.imports),concepts:e.flatMap(e=>e.concepts),types:e.flatMap(e=>e.types),policies:e.flatMap(e=>e.policies),events:e.flatMap(e=>e.events),commands:e.flatMap(e=>e.commands),queries:e.flatMap(e=>e.queries),screens:e.flatMap(e=>e.screens),triggers:e.flatMap(e=>e.triggers)}}function symbolsForBuffer(e,t){let n=t?.authoringPath??`current.play`,r=t?.authoringDocuments?.find(e=>e.path===n);return{...mergeSymbols(scanDocument(e),t??mergeSymbols()),authoringDocuments:t?.authoringDocuments,authoringPath:n,authoringPlacement:t?.authoringPlacement??r?.placement,authoringPlacementResolved:t?.authoringPlacementResolved??r?.isPlacementResolved}}function knownEventNames(e){return[...e.events.map(e=>e.name),...e.imports.map(e=>e.shortName)]}const x=[`Startup`,`Shutdown`];function knownTriggerNames(e){return[...knownEventNames(e),...e.triggers.map(e=>e.name),...x]}function knownTypeNames(e,t){return[...t,...e.concepts.map(e=>e.name),...e.types.map(e=>e.name),...e.imports.map(e=>e.shortName)]}export{x as builtInTriggerNames,directBody,knownEventNames,knownTriggerNames,knownTypeNames,mergeSymbols,propertyTypeReference,scanDocument,symbolsForBuffer};
|
|
3
3
|
//# sourceMappingURL=symbols.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","names":["conceptPattern","enumerationMemberPattern","bmpWordCharacters","propertyPattern","attributeReasonPattern","readPattern","commandReserved","authorizationContinuation","eventReserved","eventBodyReservedWords","inlineEventReserved","queryParameterPattern","property","typeReferenceSymbol","text","line","startColumn","body","lines","index","entry","match","reserved","start","fences","indentOf","indent","blockIndent","authorization","childIndent","symbolRevisions","source","cached","analysis","responseAnalysis","symbols","eventAnalysisSource","fenceMap","eventLines","eventFences","eventPropertyLines","trimmed","importMatch","qualifiedName","shortName","conceptMatch","bodyLines","i","directIndent","generationLine","generationStrategy","attributeReasons","reason","members","enumValues","member","enumNumbers","typeMatch","clauseKeywords","policyMatch","requires","eventMatch","inline","propertyBody","fileReferenceOn","unescapeString","command","productionHeaders","header","conditional","eventLine","name","children","targets","queryMatch","parameters","screenMatch","triggerMatch","documents","document","path","application","current","event","imported","builtInTriggerNames","trigger","primitives","concept","type"],"sources":["../../symbols.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 { EventVisibility, eventBodyReservedWords, unescapeString } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandResponseSymbol, responseAnalysis } from './response-analysis';\nimport { fileReferenceOn } from './file-references';\nimport { clauseKeywords } from './language';\nimport { bmpWordCharacters } from './bmp-word-characters';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { ProductionSymbol } from './ProductionSymbol';\nimport { TypeReferenceSymbol, typeReferenceSymbol } from './TypeReferenceSymbol';\n\nexport interface PropertySymbol {\n name: string;\n type: string;\n typeReference?: TypeReferenceSymbol;\n // Exact spelling and UTF-16 columns in the authoring source, independent of normalization.\n sourceType?: { text: string; startColumn: number; endColumn: number };\n isIdentifier: boolean;\n isGenerated?: boolean;\n isSubject?: boolean;\n line: number;\n}\n\nexport interface ConceptSymbol {\n name: string;\n primitive: string;\n attributes: string[];\n attributeReasons: Record<string, string>;\n enumValues: string[];\n enumNumbers?: number[];\n generationStrategy?: string;\n line: number;\n}\n\nexport interface TypeSymbol {\n name: string;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface PolicySymbol {\n name: string;\n requires: string[];\n line: number;\n}\n\nexport interface EventSymbol {\n // Public editor declarations stay structural; the compiler is privately bundled.\n visibility?: 'Private' | 'Public';\n origin?: string;\n name: string;\n generation?: number;\n inline?: boolean;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface CommandSymbol extends NamedSymbol {\n properties: PropertySymbol[];\n reads?: ReadSymbol[];\n produces?: ProductionSymbol[];\n productionHeaders?: number[];\n response?: CommandResponseSymbol | null;\n}\n\nexport interface ReadSymbol {\n view: string;\n alias?: string;\n by?: string;\n line: number;\n}\n\nexport interface NamedSymbol {\n name: string;\n line: number;\n}\n\nexport interface QuerySymbol extends NamedSymbol {\n returnType: string;\n returnTypeReference?: TypeReferenceSymbol;\n parameters: PropertySymbol[];\n}\n\nexport interface ImportSymbol {\n qualifiedName: string;\n shortName: string;\n line: number;\n}\n\nexport interface DocumentSymbols {\n identityDetails?: readonly { readonly name: string; readonly type: string; readonly line: number }[];\n authoringSources?: readonly string[];\n authoringPath?: string;\n authoringPlacement?: readonly string[];\n authoringPlacementResolved?: boolean;\n authoringDocuments?: readonly AuthoringDocument[];\n eventSources?: readonly AuthoredEventSource[];\n imports: ImportSymbol[];\n concepts: ConceptSymbol[];\n types: TypeSymbol[];\n policies: PolicySymbol[];\n events: EventSymbol[];\n commands: CommandSymbol[];\n queries: QuerySymbol[];\n screens: NamedSymbol[];\n triggers: NamedSymbol[];\n}\n\nconst conceptPattern = /^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@\\w+)*)\\s*$/;\nconst enumerationMemberPattern = new RegExp(`^@?([a-z_][${bmpWordCharacters}]*)(?:\\\\s*=\\\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\\\s*//.*)?$`);\nconst propertyPattern = /^\\s*(@?[a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+generated)?(\\s+identifier)?(\\s+subject)?\\s*$/;\nconst attributeReasonPattern = /^([a-z_]\\w*)\\s+reason\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/;\nconst readPattern = /^\\s*reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?\\s*$/;\nconst commandReserved = ['authorize', 'produces', 'reads'];\n// AuthorizeParser's continuation pattern, including the compiler's Unicode word characters.\nconst authorizationContinuation = /^(?:(?:or|and)\\s+)?[A-Za-z_(][\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}\\s()]*$/u;\n// Use the compiler's contextual inventory, not the global completion vocabulary.\nconst eventReserved = eventBodyReservedWords;\nconst inlineEventReserved = ['tag', 'for', 'generation', 'origin', 'namespace', 'sequence', 'correlation', 'causation', 'causedBy', 'occurred'];\nconst queryParameterPattern =\n /^\\s*(?:by|filter)\\s+([a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?:\\s+from\\s+.+)?\\s*$/;\n\n// Property-shaped clauses depend on their owner. Commands reserve only authorize,\n// produces and reads; bare directives such as description and handler can be properties.\n// The @ escape always denotes a property, and 'as' keeps its established property meaning.\nexport function propertyTypeReference(property: PropertySymbol): TypeReferenceSymbol {\n return property.typeReference ?? typeReferenceSymbol(property.type);\n}\n\nfunction sourceTypeAt(line: string, startColumn: number): NonNullable<PropertySymbol['sourceType']> {\n const text = line.slice(startColumn - 1).match(/^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?(?:\\?|\\s+optional\\b)?/u)?.[0] ?? '';\n return { text, startColumn, endColumn: startColumn + text.length };\n}\n\nfunction propertiesIn(lines: string[], body: number[], reserved: readonly string[]): PropertySymbol[] {\n return body\n .map((index) => ({ index, match: lines[index].match(propertyPattern) }))\n .filter((entry): entry is { index: number; match: RegExpMatchArray } => entry.match !== null)\n .filter(({ match }) => match[1].startsWith('@') || match[1] === 'as' || !reserved.includes(match[1]))\n .map(({ index, match }) => ({\n name: match[1].replace(/^@/, ''),\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[index], lines[index].match(/^\\s*\\S+\\s+/)![0].length + 1),\n isIdentifier: match[4] !== undefined,\n ...(match[3] !== undefined ? { isGenerated: true } : {}),\n ...(match[5] !== undefined ? { isSubject: true } : {}),\n line: index,\n }));\n}\n\nfunction collectBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body: number[] = [];\n for (let index = start + 1; index < lines.length; index++) {\n if (fences[index]) {\n continue;\n }\n const line = lines[index];\n if (line.trim().length === 0) continue;\n if (indentOf(line) <= indent) break;\n body.push(index);\n }\n return body;\n}\n\n// Event/production parsers accept every greater indent, not just the smallest child indent.\n// Command block directives own their nested lines; properties do not. Fenced prose is never syntax.\nexport function directBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body = collectBody(lines, fences, start, indent).filter(index => !fences[index] && !/^\\s*(?:\\/\\/|#)/.test(lines[index]));\n if (!/^\\s*command\\b/.test(lines[start])) return body;\n let blockIndent: number | undefined;\n let authorization = false;\n return body.filter(index => {\n const childIndent = indentOf(lines[index]);\n const text = lines[index].trim();\n // AuthorizeParser owns only consecutive deeper lines with requirement shape.\n // Unlike opaque blocks, a nonmatching line returns control to CommandParser.\n if (blockIndent !== undefined && childIndent > blockIndent &&\n (!authorization || authorizationContinuation.test(text))) return false;\n const property = text !== 'validate csharp' && propertiesIn(lines, [index], commandReserved).length > 0;\n // Description consumes only a quoted value or a fence (already excluded above).\n const leaf = property || /^description(?:\\s|$)/.test(text);\n blockIndent = leaf ? undefined : childIndent;\n authorization = /^authorize(?:\\s|$)/.test(text);\n return true;\n });\n}\n\nconst symbolRevisions = new Map<string, DocumentSymbols>();\n\nexport function scanDocument(lines: string[]): DocumentSymbols {\n const source = lines.join('\\n');\n const cached = symbolRevisions.get(source);\n if (cached) return cached;\n const analysis = responseAnalysis(lines);\n const symbols: DocumentSymbols = {\n ...(analysis.identityDetails?.length ? { identityDetails: analysis.identityDetails } : {}),\n authoringSources: [source],\n eventSources: analysis.eventSources.declarations,\n imports: [],\n concepts: [],\n types: [],\n policies: [],\n events: [],\n commands: [],\n queries: [],\n screens: [],\n triggers: [],\n };\n // One normalization pass for every declaration, including comments on fence openers.\n lines = eventAnalysisSource(lines);\n const fences = fenceMap(lines);\n const eventLines = lines;\n const eventFences = fences;\n // Typed inline mappings share property syntax once their source expression is removed.\n // Do this once, never once per inline event.\n const eventPropertyLines = lines.map(line => line.replace(/\\s*=(?!=|>).*/, ''));\n\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const line = lines[index];\n const trimmed = line.trim();\n const indent = indentOf(line);\n\n const importMatch = eventLines[index].trim().match(/^import\\s+([\\w.]+)(?:\\s+from\\s+\"(?:[^\"\\\\]|\\\\.)*\")?\\s*$/);\n if (importMatch && indent === 0) {\n const qualifiedName = importMatch[1];\n const shortName = qualifiedName.split('.').pop() ?? qualifiedName;\n symbols.imports.push({ qualifiedName, shortName, line: index });\n continue;\n }\n\n const conceptMatch = trimmed.match(conceptPattern);\n if (conceptMatch) {\n const bodyLines = collectBody(lines, fences, index, indent);\n const body = bodyLines.map((i) => lines[i].trim());\n const directIndent = Math.min(...bodyLines.filter(i => !fences[i] && lines[i].trim() !== '').map(i => indentOf(lines[i])));\n const generationLine = bodyLines.find(i => !fences[i] && indentOf(lines[i]) === directIndent && /^\\s*generate\\s+\\w+/.test(lines[i]));\n const generationStrategy = generationLine === undefined ? undefined : lines[generationLine].match(/^\\s*generate\\s+(\\w+)/)?.[1];\n const attributeReasons: Record<string, string> = {};\n for (const line of body) {\n const reason = line.match(attributeReasonPattern);\n if (reason && attributeReasons[reason[1]] === undefined) {\n attributeReasons[reason[1]] = reason[2];\n }\n }\n const members = conceptMatch[2] === 'Enum'\n ? body.filter(line => line !== 'validate').map(line => enumerationMemberPattern.exec(line)).filter(match => match !== null)\n : [];\n const enumValues = members.map(member => member[1]);\n const enumNumbers = members.length > 0 && members.every(member => member[2] !== undefined) ? members.map(member => Number(member[2])) : undefined;\n symbols.concepts.push({\n name: conceptMatch[1],\n primitive: conceptMatch[2],\n attributes: conceptMatch[3].trim().split(/\\s+/).filter(Boolean),\n attributeReasons,\n enumValues,\n ...(enumNumbers === undefined ? {} : { enumNumbers }),\n ...(generationStrategy === undefined ? {} : { generationStrategy }),\n line: index,\n });\n continue;\n }\n\n const typeMatch = trimmed.match(/^type\\s+(\\w+)\\s*$/);\n if (typeMatch) {\n symbols.types.push({\n name: typeMatch[1],\n properties: propertiesIn(lines, collectBody(lines, fences, index, indent), clauseKeywords),\n line: index,\n });\n continue;\n }\n\n const policyMatch = trimmed.match(/^policy\\s+(\\w+)\\s*$/);\n if (policyMatch) {\n const requires = collectBody(lines, fences, index, indent)\n .filter((i) => !fences[i])\n .map((i) => lines[i].trim());\n symbols.policies.push({ name: policyMatch[1], requires, line: index });\n continue;\n }\n\n const eventMatch = eventLines[index].trim().match(/^(?:(?:produces|(?<public>public))\\s+)?event\\s+(?<name>\\w+)(?:\\s+generation\\s+(?<generation>\\d+))?(?:\\s+from\\s+(?<origin>\"(?:[^\"\\\\]|\\\\.)*\"))?\\s*$/);\n if (eventMatch) {\n const inline = trimmed.startsWith('produces ');\n const body = directBody(eventLines, eventFences, index, indent);\n // Standalone events distinguish file metadata from properties by path shape.\n const propertyBody = inline ? body : body.filter(line => fileReferenceOn(eventLines[line], line) === undefined);\n symbols.events.push({\n name: eventMatch.groups!.name,\n ...(eventMatch.groups!.generation ? { generation: Number(eventMatch.groups!.generation) } : {}),\n ...(eventMatch.groups!.public || eventMatch.groups!.origin ? { visibility: EventVisibility.Public } : {}),\n ...(eventMatch.groups!.origin ? { origin: unescapeString(eventMatch.groups!.origin.slice(1, -1)) } : {}),\n inline,\n properties: propertiesIn(inline ? eventPropertyLines : eventLines,\n propertyBody, inline ? inlineEventReserved : eventReserved),\n line: index,\n });\n continue;\n }\n\n const command = analysis.commands.get(index);\n if (command) {\n // A command property is a leaf, not an indentation owner. Share the parser-shaped\n // body with properties, productions, advice and destination hints.\n const body = directBody(lines, fences, index, indent);\n const productionHeaders = body.filter(line => /^\\s*produces\\b/.test(lines[line]) && !analysis.operationProductionLines?.has(line));\n symbols.commands.push({\n name: command.name,\n properties: command.properties.map(property => ({\n name: property.name,\n type: `${property.type.name}${property.type.isCollection ? '[]' : ''}${property.type.isOptional ? ' optional' : ''}`,\n typeReference: { name: property.type.name, isCollection: property.type.isCollection, isOptional: property.type.isOptional },\n sourceType: sourceTypeAt(lines[property.type.location.line - 1], property.type.location.column),\n isIdentifier: property.isIdentifier || /\\sidentifier\\s*$/.test(lines[property.location.line - 1]),\n ...(property.isGenerated ? { isGenerated: true } : {}),\n line: property.location.line - 1,\n })),\n response: command.response,\n productionHeaders,\n produces: productionHeaders.flatMap(line => {\n const header = eventLines[line].trim();\n const inline = /^produces\\s+event\\b/.test(header);\n const conditional = /^produces\\s+when\\b/.test(header);\n const eventLine = conditional ? directBody(eventLines, eventFences, line, indentOf(eventLines[line]))[0] : line;\n if (eventLine === undefined) return [];\n const name = conditional ? eventLines[eventLine].trim() : header.match(inline ? /^produces\\s+event\\s+([A-Za-z_]\\w*)(?:\\s+generation\\s+\\d+)?\\s*$/ : /^produces\\s+([A-Z]\\w*)\\s*$/)?.[1];\n if (name === undefined || !/^[A-Za-z_]\\w*$/.test(name)) return [];\n const children = directBody(eventLines, eventFences, eventLine, indentOf(eventLines[eventLine]));\n const targets = children.map(index => eventLines[index].trim().match(/^for(?:\\s+(.*))?$/)).filter(match => match !== null);\n // Empty or repeated targets are uncertain, not implicit destinations.\n const target = targets.length === 0 ? undefined : targets.length === 1 ? targets[0][1] ?? '' : '';\n const mappings = children.flatMap(index => {\n const match = eventLines[index].trim().match(inline ? /^(@?[a-z_]\\w*)\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*=(?!=|>)\\s*(.+)$/ : /^(@?[\\w.]+)\\s*=(?!=|>)\\s*(.+)$/);\n return match === null ? [] : [{ name: match[1].replace(/^@/, ''), source: match[2], line: index }];\n });\n return [{ name, inline, conditional, line, target, mappings }];\n }),\n reads: body.filter((line) => !fences[line])\n .map((line) => ({ line, match: lines[line].match(readPattern) }))\n .filter((entry): entry is { line: number; match: RegExpMatchArray } => entry.match !== null)\n .map(({ line, match }) => ({\n view: match[1],\n ...(match[2] ? { alias: match[2] } : {}),\n ...(match[3] ? { by: match[3] } : {}),\n line,\n })),\n line: index,\n });\n continue;\n }\n\n // The return type shape is the compiler's, dots and all - QueryParser's\n // ^query\\s+([A-Za-z_]\\w*)\\s*=>\\s*(observable\\s+)?([\\w.]+(?:\\[\\])?\\??)$. A narrower one here\n // silently drops the query from the symbol table, and with it every check and completion that\n // reads from it.\n const queryMatch = trimmed.match(/^query\\s+(\\w+)\\s*=>\\s*(?:observable\\s+)?([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)\\s*$/);\n if (queryMatch) {\n // The return type names a read model, which no construct declares — only the\n // 'by' and 'filter' parameters resolve against the document's own types.\n const parameters = collectBody(lines, fences, index, indent)\n .map((i) => ({ index: i, match: lines[i].match(queryParameterPattern) }))\n .filter(\n (entry): entry is { index: number; match: RegExpMatchArray } =>\n entry.match !== null,\n )\n .map(({ index: line, match }) => ({\n name: match[1],\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[line], lines[line].match(/^\\s*(?:by|filter)\\s+\\S+\\s+/)![0].length + 1),\n isIdentifier: false,\n line,\n }));\n symbols.queries.push({\n name: queryMatch[1],\n returnType: queryMatch[2],\n returnTypeReference: typeReferenceSymbol(queryMatch[2]),\n parameters,\n line: index,\n });\n continue;\n }\n\n const screenMatch = trimmed.match(/^screen\\s+(\\w+)\\s*$/);\n if (screenMatch) {\n symbols.screens.push({ name: screenMatch[1], line: index });\n continue;\n }\n\n const triggerMatch = trimmed.match(/^trigger\\s+(\\w+)\\s*$/);\n if (triggerMatch && indent === 0) {\n symbols.triggers.push({ name: triggerMatch[1], line: index });\n }\n }\n\n if (symbolRevisions.size >= 16) symbolRevisions.delete(symbolRevisions.keys().next().value!);\n symbolRevisions.set(source, symbols);\n return symbols;\n}\n\n// The symbols of several documents as one - what an application spread over files declares. Lines refer to\n// the document each symbol came from, so the result names things; it does not locate them.\nexport function mergeSymbols(...documents: DocumentSymbols[]): DocumentSymbols {\n return {\n ...(documents.some(document => document.identityDetails?.length) ? { identityDetails: documents.flatMap(document => document.identityDetails ?? []) } : {}),\n authoringSources: documents.flatMap(document => document.authoringSources ?? []),\n ...(documents.some(document => document.authoringDocuments) ? { authoringDocuments: documents.flatMap(document => document.authoringDocuments ?? []) } : {}),\n eventSources: documents.flatMap(document => document.eventSources ?? []),\n imports: documents.flatMap((document) => document.imports),\n concepts: documents.flatMap((document) => document.concepts),\n types: documents.flatMap((document) => document.types),\n policies: documents.flatMap((document) => document.policies),\n events: documents.flatMap((document) => document.events),\n commands: documents.flatMap((document) => document.commands),\n queries: documents.flatMap((document) => document.queries),\n screens: documents.flatMap((document) => document.screens),\n triggers: documents.flatMap((document) => document.triggers),\n };\n}\n\n// Name scans are not physical input documents. Keep the host's authoritative paths separate,\n// and let responseAnalysis replace the current document with this buffer exactly once.\nexport function symbolsForBuffer(lines: string[], application?: DocumentSymbols): DocumentSymbols {\n const path = application?.authoringPath ?? 'current.play';\n const current = application?.authoringDocuments?.find(document => document.path === path);\n return { ...mergeSymbols(scanDocument(lines), application ?? mergeSymbols()),\n authoringDocuments: application?.authoringDocuments,\n authoringPath: path,\n authoringPlacement: application?.authoringPlacement ?? current?.placement,\n authoringPlacementResolved: application?.authoringPlacementResolved ?? current?.isPlacementResolved,\n };\n}\n\nexport function knownEventNames(symbols: DocumentSymbols): string[] {\n return [\n ...symbols.events.map((event) => event.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n\n// The built-in host signals, which have no declaration to scan for because every application has them.\nexport const builtInTriggerNames = ['Startup', 'Shutdown'];\n\n// What a reaction's `when` may name: an event, a declared trigger, or a host signal. The compiler resolves\n// the three in that order, and the editor offers them the same way rather than guessing which was meant.\nexport function knownTriggerNames(symbols: DocumentSymbols): string[] {\n return [\n ...knownEventNames(symbols),\n ...symbols.triggers.map((trigger) => trigger.name),\n ...builtInTriggerNames,\n ];\n}\n\n// Everything a property type reference can resolve to — the primitives, the declared\n// concepts and types, and the short names of the imports.\nexport function knownTypeNames(symbols: DocumentSymbols, primitives: readonly string[]): string[] {\n return [\n ...primitives,\n ...symbols.concepts.map((concept) => concept.name),\n ...symbols.types.map((type) => type.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n"],"mappings":"qnBAgHA,MAAMA,EAAiB,iDACjBC,EAA+B,OAAO,cAAcC,EAAkB,qDAAqD,EAC3HC,EAAkB,2GAClBC,EAAyB,kDACzBC,EAAc,6EACdC,EAAkB,CAAC,YAAa,WAAY,OAAO,EAEnDC,EAA4B,gEAE5BC,EAAgBC,EAChBC,EAAsB,CAAC,MAAO,MAAO,aAAc,S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AAK,GAASsD,EAAK,IAAI,EACxC,GAAGtD,EAAQ,QAAQ,IAAK,GAAaiD,EAAS,SAAS,CAC3D,CACJ"}
|
|
1
|
+
{"version":3,"file":"symbols.js","names":["conceptPattern","enumerationMemberPattern","bmpWordCharacters","propertyPattern","attributeReasonPattern","readPattern","commandReserved","authorizationContinuation","eventReserved","eventBodyReservedWords","inlineEventReserved","queryParameterPattern","property","typeReferenceSymbol","text","line","startColumn","body","lines","index","entry","match","reserved","start","fences","indentOf","indent","blockIndent","authorization","childIndent","symbolRevisions","source","cached","analysis","responseAnalysis","symbols","eventAnalysisSource","fenceMap","eventLines","eventFences","eventPropertyLines","trimmed","importMatch","qualifiedName","shortName","conceptMatch","bodyLines","i","directIndent","generationLine","generationStrategy","attributeReasons","reason","members","enumValues","member","enumNumbers","typeMatch","clauseKeywords","policyMatch","requires","eventMatch","inline","propertyBody","fileReferenceOn","unescapeString","command","productionHeaders","header","conditional","eventLine","name","children","targets","queryMatch","parameters","screenMatch","triggerMatch","documents","document","path","application","current","event","imported","builtInTriggerNames","trigger","primitives","concept","type"],"sources":["../../symbols.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 { EventVisibility, eventBodyReservedWords, unescapeString } from '@cratis/screenplay-compiler';\nimport { fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { CommandResponseSymbol, responseAnalysis } from './response-analysis';\nimport { fileReferenceOn } from './file-references';\nimport { clauseKeywords } from './language';\nimport { bmpWordCharacters } from './bmp-word-characters';\nimport { AuthoringDocument } from './AuthoringDocument';\nimport { AuthoredEventSource } from './AuthoredEventSource';\nimport { ProductionSymbol } from './ProductionSymbol';\nimport { TypeReferenceSymbol, typeReferenceSymbol } from './TypeReferenceSymbol';\n\nexport interface PropertySymbol {\n name: string;\n type: string;\n typeReference?: TypeReferenceSymbol;\n // Exact spelling and UTF-16 columns in the authoring source, independent of normalization.\n sourceType?: { text: string; startColumn: number; endColumn: number };\n isIdentifier: boolean;\n isGenerated?: boolean;\n isSubject?: boolean;\n line: number;\n}\n\nexport interface ConceptSymbol {\n name: string;\n primitive: string;\n attributes: string[];\n attributeReasons: Record<string, string>;\n enumValues: string[];\n enumNumbers?: number[];\n generationStrategy?: string;\n line: number;\n}\n\nexport interface TypeSymbol {\n name: string;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface PolicySymbol {\n name: string;\n requires: string[];\n line: number;\n}\n\nexport interface EventSymbol {\n // Public editor declarations stay structural; the compiler is privately bundled.\n visibility?: 'Private' | 'Public';\n origin?: string;\n name: string;\n generation?: number;\n inline?: boolean;\n properties: PropertySymbol[];\n line: number;\n}\n\nexport interface CommandSymbol extends NamedSymbol {\n properties: PropertySymbol[];\n reads?: ReadSymbol[];\n produces?: ProductionSymbol[];\n productionHeaders?: number[];\n response?: CommandResponseSymbol | null;\n}\n\nexport interface ReadSymbol {\n view: string;\n alias?: string;\n by?: string;\n line: number;\n}\n\nexport interface NamedSymbol {\n name: string;\n line: number;\n}\n\nexport interface QuerySymbol extends NamedSymbol {\n returnType: string;\n returnTypeReference?: TypeReferenceSymbol;\n parameters: PropertySymbol[];\n}\n\nexport interface ImportSymbol {\n qualifiedName: string;\n shortName: string;\n line: number;\n}\n\nexport interface DocumentSymbols {\n identityDetails?: readonly { readonly name: string; readonly type: string; readonly line: number }[];\n authoringSources?: readonly string[];\n authoringPath?: string;\n authoringPlacement?: readonly string[];\n authoringPlacementResolved?: boolean;\n authoringDocuments?: readonly AuthoringDocument[];\n eventSources?: readonly AuthoredEventSource[];\n imports: ImportSymbol[];\n concepts: ConceptSymbol[];\n types: TypeSymbol[];\n policies: PolicySymbol[];\n events: EventSymbol[];\n commands: CommandSymbol[];\n queries: QuerySymbol[];\n screens: NamedSymbol[];\n triggers: NamedSymbol[];\n}\n\nconst conceptPattern = /^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@?\\w+)*)\\s*$/;\nconst enumerationMemberPattern = new RegExp(`^@?([a-z_][${bmpWordCharacters}]*)(?:\\\\s*=\\\\s*(-?(?:0|[1-9][0-9]*)))?(?:\\\\s*//.*)?$`);\nconst propertyPattern = /^\\s*(@?[a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(\\s+generated)?(\\s+identifier)?(\\s+subject)?\\s*$/;\nconst attributeReasonPattern = /^([a-z_]\\w*)\\s+reason\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*$/;\nconst readPattern = /^\\s*reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?\\s*$/;\nconst commandReserved = ['authorize', 'produces', 'reads'];\n// AuthorizeParser's continuation pattern, including the compiler's Unicode word characters.\nconst authorizationContinuation = /^(?:(?:or|and)\\s+)?[A-Za-z_(][\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}\\s()]*$/u;\n// Use the compiler's contextual inventory, not the global completion vocabulary.\nconst eventReserved = eventBodyReservedWords;\nconst inlineEventReserved = ['tag', 'for', 'generation', 'origin', 'namespace', 'sequence', 'correlation', 'causation', 'causedBy', 'occurred'];\nconst queryParameterPattern =\n /^\\s*(?:by|filter)\\s+([a-z_]\\w*)\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)(?:\\s+from\\s+.+)?\\s*$/;\n\n// Property-shaped clauses depend on their owner. Commands reserve only authorize,\n// produces and reads; bare directives such as description and handler can be properties.\n// The @ escape always denotes a property, and 'as' keeps its established property meaning.\nexport function propertyTypeReference(property: PropertySymbol): TypeReferenceSymbol {\n return property.typeReference ?? typeReferenceSymbol(property.type);\n}\n\nfunction sourceTypeAt(line: string, startColumn: number): NonNullable<PropertySymbol['sourceType']> {\n const text = line.slice(startColumn - 1).match(/^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?(?:\\?|\\s+optional\\b)?/u)?.[0] ?? '';\n return { text, startColumn, endColumn: startColumn + text.length };\n}\n\nfunction propertiesIn(lines: string[], body: number[], reserved: readonly string[]): PropertySymbol[] {\n return body\n .map((index) => ({ index, match: lines[index].match(propertyPattern) }))\n .filter((entry): entry is { index: number; match: RegExpMatchArray } => entry.match !== null)\n .filter(({ match }) => match[1].startsWith('@') || match[1] === 'as' || !reserved.includes(match[1]))\n .map(({ index, match }) => ({\n name: match[1].replace(/^@/, ''),\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[index], lines[index].match(/^\\s*\\S+\\s+/)![0].length + 1),\n isIdentifier: match[4] !== undefined,\n ...(match[3] !== undefined ? { isGenerated: true } : {}),\n ...(match[5] !== undefined ? { isSubject: true } : {}),\n line: index,\n }));\n}\n\nfunction collectBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body: number[] = [];\n for (let index = start + 1; index < lines.length; index++) {\n if (fences[index]) {\n continue;\n }\n const line = lines[index];\n if (line.trim().length === 0) continue;\n if (indentOf(line) <= indent) break;\n body.push(index);\n }\n return body;\n}\n\n// Event/production parsers accept every greater indent, not just the smallest child indent.\n// Command block directives own their nested lines; properties do not. Fenced prose is never syntax.\nexport function directBody(lines: string[], fences: boolean[], start: number, indent: number): number[] {\n const body = collectBody(lines, fences, start, indent).filter(index => !fences[index] && !/^\\s*(?:\\/\\/|#)/.test(lines[index]));\n if (!/^\\s*command\\b/.test(lines[start])) return body;\n let blockIndent: number | undefined;\n let authorization = false;\n return body.filter(index => {\n const childIndent = indentOf(lines[index]);\n const text = lines[index].trim();\n // AuthorizeParser owns only consecutive deeper lines with requirement shape.\n // Unlike opaque blocks, a nonmatching line returns control to CommandParser.\n if (blockIndent !== undefined && childIndent > blockIndent &&\n (!authorization || authorizationContinuation.test(text))) return false;\n const property = text !== 'validate csharp' && propertiesIn(lines, [index], commandReserved).length > 0;\n // Description consumes only a quoted value or a fence (already excluded above).\n const leaf = property || /^description(?:\\s|$)/.test(text);\n blockIndent = leaf ? undefined : childIndent;\n authorization = /^authorize(?:\\s|$)/.test(text);\n return true;\n });\n}\n\nconst symbolRevisions = new Map<string, DocumentSymbols>();\n\nexport function scanDocument(lines: string[]): DocumentSymbols {\n const source = lines.join('\\n');\n const cached = symbolRevisions.get(source);\n if (cached) return cached;\n const analysis = responseAnalysis(lines);\n const symbols: DocumentSymbols = {\n ...(analysis.identityDetails?.length ? { identityDetails: analysis.identityDetails } : {}),\n authoringSources: [source],\n eventSources: analysis.eventSources.declarations,\n imports: [],\n concepts: [],\n types: [],\n policies: [],\n events: [],\n commands: [],\n queries: [],\n screens: [],\n triggers: [],\n };\n // One normalization pass for every declaration, including comments on fence openers.\n lines = eventAnalysisSource(lines);\n const fences = fenceMap(lines);\n const eventLines = lines;\n const eventFences = fences;\n // Typed inline mappings share property syntax once their source expression is removed.\n // Do this once, never once per inline event.\n const eventPropertyLines = lines.map(line => line.replace(/\\s*=(?!=|>).*/, ''));\n\n for (let index = 0; index < lines.length; index++) {\n if (fences[index]) continue;\n const line = lines[index];\n const trimmed = line.trim();\n const indent = indentOf(line);\n\n const importMatch = eventLines[index].trim().match(/^import\\s+([\\w.]+)(?:\\s+from\\s+\"(?:[^\"\\\\]|\\\\.)*\")?\\s*$/);\n if (importMatch && indent === 0) {\n const qualifiedName = importMatch[1];\n const shortName = qualifiedName.split('.').pop() ?? qualifiedName;\n symbols.imports.push({ qualifiedName, shortName, line: index });\n continue;\n }\n\n const conceptMatch = trimmed.match(conceptPattern);\n if (conceptMatch) {\n const bodyLines = collectBody(lines, fences, index, indent);\n const body = bodyLines.map((i) => lines[i].trim());\n const directIndent = Math.min(...bodyLines.filter(i => !fences[i] && lines[i].trim() !== '').map(i => indentOf(lines[i])));\n const generationLine = bodyLines.find(i => !fences[i] && indentOf(lines[i]) === directIndent && /^\\s*generate\\s+\\w+/.test(lines[i]));\n const generationStrategy = generationLine === undefined ? undefined : lines[generationLine].match(/^\\s*generate\\s+(\\w+)/)?.[1];\n const attributeReasons: Record<string, string> = {};\n for (const line of body) {\n const reason = line.match(attributeReasonPattern);\n if (reason && attributeReasons[reason[1]] === undefined) {\n attributeReasons[reason[1]] = reason[2];\n }\n }\n const members = conceptMatch[2] === 'Enum'\n ? body.filter(line => line !== 'validate').map(line => enumerationMemberPattern.exec(line)).filter(match => match !== null)\n : [];\n const enumValues = members.map(member => member[1]);\n const enumNumbers = members.length > 0 && members.every(member => member[2] !== undefined) ? members.map(member => Number(member[2])) : undefined;\n symbols.concepts.push({\n name: conceptMatch[1],\n primitive: conceptMatch[2],\n attributes: conceptMatch[3].trim().split(/\\s+/).filter(Boolean),\n attributeReasons,\n enumValues,\n ...(enumNumbers === undefined ? {} : { enumNumbers }),\n ...(generationStrategy === undefined ? {} : { generationStrategy }),\n line: index,\n });\n continue;\n }\n\n const typeMatch = trimmed.match(/^type\\s+(\\w+)\\s*$/);\n if (typeMatch) {\n symbols.types.push({\n name: typeMatch[1],\n properties: propertiesIn(lines, collectBody(lines, fences, index, indent), clauseKeywords),\n line: index,\n });\n continue;\n }\n\n const policyMatch = trimmed.match(/^policy\\s+(\\w+)\\s*$/);\n if (policyMatch) {\n const requires = collectBody(lines, fences, index, indent)\n .filter((i) => !fences[i])\n .map((i) => lines[i].trim());\n symbols.policies.push({ name: policyMatch[1], requires, line: index });\n continue;\n }\n\n const eventMatch = eventLines[index].trim().match(/^(?:(?:produces|(?<public>public))\\s+)?event\\s+(?<name>\\w+)(?:\\s+generation\\s+(?<generation>\\d+))?(?:\\s+from\\s+(?<origin>\"(?:[^\"\\\\]|\\\\.)*\"))?\\s*$/);\n if (eventMatch) {\n const inline = trimmed.startsWith('produces ');\n const body = directBody(eventLines, eventFences, index, indent);\n // Standalone events distinguish file metadata from properties by path shape.\n const propertyBody = inline ? body : body.filter(line => fileReferenceOn(eventLines[line], line) === undefined);\n symbols.events.push({\n name: eventMatch.groups!.name,\n ...(eventMatch.groups!.generation ? { generation: Number(eventMatch.groups!.generation) } : {}),\n ...(eventMatch.groups!.public || eventMatch.groups!.origin ? { visibility: EventVisibility.Public } : {}),\n ...(eventMatch.groups!.origin ? { origin: unescapeString(eventMatch.groups!.origin.slice(1, -1)) } : {}),\n inline,\n properties: propertiesIn(inline ? eventPropertyLines : eventLines,\n propertyBody, inline ? inlineEventReserved : eventReserved),\n line: index,\n });\n continue;\n }\n\n const command = analysis.commands.get(index);\n if (command) {\n // A command property is a leaf, not an indentation owner. Share the parser-shaped\n // body with properties, productions, advice and destination hints.\n const body = directBody(lines, fences, index, indent);\n const productionHeaders = body.filter(line => /^\\s*produces\\b/.test(lines[line]) && !analysis.operationProductionLines?.has(line));\n symbols.commands.push({\n name: command.name,\n properties: command.properties.map(property => ({\n name: property.name,\n type: `${property.type.name}${property.type.isCollection ? '[]' : ''}${property.type.isOptional ? ' optional' : ''}`,\n typeReference: { name: property.type.name, isCollection: property.type.isCollection, isOptional: property.type.isOptional },\n sourceType: sourceTypeAt(lines[property.type.location.line - 1], property.type.location.column),\n isIdentifier: property.isIdentifier || /\\sidentifier\\s*$/.test(lines[property.location.line - 1]),\n ...(property.isGenerated ? { isGenerated: true } : {}),\n line: property.location.line - 1,\n })),\n response: command.response,\n productionHeaders,\n produces: productionHeaders.flatMap(line => {\n const header = eventLines[line].trim();\n const inline = /^produces\\s+event\\b/.test(header);\n const conditional = /^produces\\s+when\\b/.test(header);\n const eventLine = conditional ? directBody(eventLines, eventFences, line, indentOf(eventLines[line]))[0] : line;\n if (eventLine === undefined) return [];\n const name = conditional ? eventLines[eventLine].trim() : header.match(inline ? /^produces\\s+event\\s+([A-Za-z_]\\w*)(?:\\s+generation\\s+\\d+)?\\s*$/ : /^produces\\s+([A-Z]\\w*)\\s*$/)?.[1];\n if (name === undefined || !/^[A-Za-z_]\\w*$/.test(name)) return [];\n const children = directBody(eventLines, eventFences, eventLine, indentOf(eventLines[eventLine]));\n const targets = children.map(index => eventLines[index].trim().match(/^for(?:\\s+(.*))?$/)).filter(match => match !== null);\n // Empty or repeated targets are uncertain, not implicit destinations.\n const target = targets.length === 0 ? undefined : targets.length === 1 ? targets[0][1] ?? '' : '';\n const mappings = children.flatMap(index => {\n const match = eventLines[index].trim().match(inline ? /^(@?[a-z_]\\w*)\\s+[\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?\\s*=(?!=|>)\\s*(.+)$/ : /^(@?[\\w.]+)\\s*=(?!=|>)\\s*(.+)$/);\n return match === null ? [] : [{ name: match[1].replace(/^@/, ''), source: match[2], line: index }];\n });\n return [{ name, inline, conditional, line, target, mappings }];\n }),\n reads: body.filter((line) => !fences[line])\n .map((line) => ({ line, match: lines[line].match(readPattern) }))\n .filter((entry): entry is { line: number; match: RegExpMatchArray } => entry.match !== null)\n .map(({ line, match }) => ({\n view: match[1],\n ...(match[2] ? { alias: match[2] } : {}),\n ...(match[3] ? { by: match[3] } : {}),\n line,\n })),\n line: index,\n });\n continue;\n }\n\n // The return type shape is the compiler's, dots and all - QueryParser's\n // ^query\\s+([A-Za-z_]\\w*)\\s*=>\\s*(observable\\s+)?([\\w.]+(?:\\[\\])?\\??)$. A narrower one here\n // silently drops the query from the symbol table, and with it every check and completion that\n // reads from it.\n const queryMatch = trimmed.match(/^query\\s+(\\w+)\\s*=>\\s*(?:observable\\s+)?([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?)\\s*$/);\n if (queryMatch) {\n // The return type names a read model, which no construct declares — only the\n // 'by' and 'filter' parameters resolve against the document's own types.\n const parameters = collectBody(lines, fences, index, indent)\n .map((i) => ({ index: i, match: lines[i].match(queryParameterPattern) }))\n .filter(\n (entry): entry is { index: number; match: RegExpMatchArray } =>\n entry.match !== null,\n )\n .map(({ index: line, match }) => ({\n name: match[1],\n type: match[2],\n typeReference: typeReferenceSymbol(match[2]),\n sourceType: sourceTypeAt(lines[line], lines[line].match(/^\\s*(?:by|filter)\\s+\\S+\\s+/)![0].length + 1),\n isIdentifier: false,\n line,\n }));\n symbols.queries.push({\n name: queryMatch[1],\n returnType: queryMatch[2],\n returnTypeReference: typeReferenceSymbol(queryMatch[2]),\n parameters,\n line: index,\n });\n continue;\n }\n\n const screenMatch = trimmed.match(/^screen\\s+(\\w+)\\s*$/);\n if (screenMatch) {\n symbols.screens.push({ name: screenMatch[1], line: index });\n continue;\n }\n\n const triggerMatch = trimmed.match(/^trigger\\s+(\\w+)\\s*$/);\n if (triggerMatch && indent === 0) {\n symbols.triggers.push({ name: triggerMatch[1], line: index });\n }\n }\n\n if (symbolRevisions.size >= 16) symbolRevisions.delete(symbolRevisions.keys().next().value!);\n symbolRevisions.set(source, symbols);\n return symbols;\n}\n\n// The symbols of several documents as one - what an application spread over files declares. Lines refer to\n// the document each symbol came from, so the result names things; it does not locate them.\nexport function mergeSymbols(...documents: DocumentSymbols[]): DocumentSymbols {\n return {\n ...(documents.some(document => document.identityDetails?.length) ? { identityDetails: documents.flatMap(document => document.identityDetails ?? []) } : {}),\n authoringSources: documents.flatMap(document => document.authoringSources ?? []),\n ...(documents.some(document => document.authoringDocuments) ? { authoringDocuments: documents.flatMap(document => document.authoringDocuments ?? []) } : {}),\n eventSources: documents.flatMap(document => document.eventSources ?? []),\n imports: documents.flatMap((document) => document.imports),\n concepts: documents.flatMap((document) => document.concepts),\n types: documents.flatMap((document) => document.types),\n policies: documents.flatMap((document) => document.policies),\n events: documents.flatMap((document) => document.events),\n commands: documents.flatMap((document) => document.commands),\n queries: documents.flatMap((document) => document.queries),\n screens: documents.flatMap((document) => document.screens),\n triggers: documents.flatMap((document) => document.triggers),\n };\n}\n\n// Name scans are not physical input documents. Keep the host's authoritative paths separate,\n// and let responseAnalysis replace the current document with this buffer exactly once.\nexport function symbolsForBuffer(lines: string[], application?: DocumentSymbols): DocumentSymbols {\n const path = application?.authoringPath ?? 'current.play';\n const current = application?.authoringDocuments?.find(document => document.path === path);\n return { ...mergeSymbols(scanDocument(lines), application ?? mergeSymbols()),\n authoringDocuments: application?.authoringDocuments,\n authoringPath: path,\n authoringPlacement: application?.authoringPlacement ?? current?.placement,\n authoringPlacementResolved: application?.authoringPlacementResolved ?? current?.isPlacementResolved,\n };\n}\n\nexport function knownEventNames(symbols: DocumentSymbols): string[] {\n return [\n ...symbols.events.map((event) => event.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n\n// The built-in host signals, which have no declaration to scan for because every application has them.\nexport const builtInTriggerNames = ['Startup', 'Shutdown'];\n\n// What a reaction's `when` may name: an event, a declared trigger, or a host signal. The compiler resolves\n// the three in that order, and the editor offers them the same way rather than guessing which was meant.\nexport function knownTriggerNames(symbols: DocumentSymbols): string[] {\n return [\n ...knownEventNames(symbols),\n ...symbols.triggers.map((trigger) => trigger.name),\n ...builtInTriggerNames,\n ];\n}\n\n// Everything a property type reference can resolve to — the primitives, the declared\n// concepts and types, and the short names of the imports.\nexport function knownTypeNames(symbols: DocumentSymbols, primitives: readonly string[]): string[] {\n return [\n ...primitives,\n ...symbols.concepts.map((concept) => concept.name),\n ...symbols.types.map((type) => type.name),\n ...symbols.imports.map((imported) => imported.shortName),\n ];\n}\n"],"mappings":"qnBAgHA,MAAMA,EAAiB,kDACjBC,EAA+B,OAAO,cAAcC,EAAkB,qDAAqD,EAC3HC,EAAkB,2GAClBC,EAAyB,kDACzBC,EAAc,6EACdC,EAAkB,CAAC,YAAa,WAAY,OAAO,EAEnDC,EAA4B,gEAE5BC,EAAgBC,EAChBC,EAAsB,CAAC,MAAO,MAAO,aAAc,SAAU,YAAa,WAAY,cAAe,YAAa,WAAY,UAAU,EACxIC,EACF,8FAKJ,SAAgB,sBAAsB,EAA+C,CACjF,OAAOC,EAAS,eAAiBC,EAAoBD,EAAS,IAAI,CACtE,CAEA,SAAS,aAAa,EAAc,EAAgE,CAChG,IAAME,EAAOC,EAAK,MAAMC,EAAc,CAAC,CAAC,CAAC,MAAM,6DAA6D,CAAC,GAAG,IAAM,GACtH,MAAO,CAAE,OAAM,cAAa,UAAWA,EAAcF,EAAK,MAAO,CACrE,CAEA,SAAS,aAAa,EAAiB,EAAgB,EAA+C,CAClG,OAAOG,EACF,IAA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