Every problem the compiler finds is reported as a diagnostic : a severity, a stable code, a message, and the line and column it came from. This page is the catalogue of those codes.
A message is written for a person and gets reworded whenever a clearer wording is found. A code never changes . So a code is what you match on, suppress on, and group by - anything reading the message text breaks the next time the message is improved.
The CLI prints a diagnostic in the format editors and build servers already parse - the file, the position, the severity, the code, and the message - followed by the offending line and a caret:
nested/broken.play(3,5): error PLAY0028: Unknown slice type 'Wat' - expected StateChange, StateView, Automation or Translate
There are three severities. Error means the document does not compile. Warning means the document compiles but something is very likely wrong - almost always a name nothing declares. Information means something worth knowing that changes nothing.
The prefix is PLAY, after the .play documents this compiler reads.
Cratis Arc has its own catalogue, the SP codes, for generating a .play document from C# source. The two run one after the other - Arc generates a document and hands it straight to this compiler to read back - so both sets of diagnostics land in the same build log. A shared prefix would make SP0034 and a compiler code of the same number indistinguishable at a glance and identical to a SP\d{4} filter, which is why the prefixes deliberately have nothing in common. Arc’s codes describe what the generator could not express; the codes here describe what the compiler could not read.
A code is an identifier, not a position in a list.
A number is never reused . When a diagnostic is retired, its number is retired with it and left behind as a gap in the sequence. Handing that number to something else would silently change what an existing suppression means.
A number is never renumbered . Inserting a code in the middle of the catalogue would change the meaning of every code after it.
A new code is appended at the end of the sequence whatever it is about, so the number says when a code was added rather than where it belongs. Use this page, not the numbering, to find the codes for an area.
A code outlives its message . Two constructs hitting the same condition share one code - a property line the parser cannot read reports PLAY0016 whether it sits in a type or in an event.
Diagnostic carries the code alongside the severity, the message and the location, so a consumer filters on it directly:
using Cratis . Screenplay . Diagnostics ;
var result = new ScreenplayCompiler () . Compile ( source );
// A document assembled a piece at a time refers to events the pieces have not introduced yet,
// so that one warning is expected here and everything else is not.
var unexpected = result . Diagnostics
. Where ( diagnostic => diagnostic . Code != DiagnosticCodes . UnknownEvent )
DiagnosticCodes declares every code in this catalogue as a named constant, so the compiler catches a typo that a string literal would not.
The language service behind the VS Code extension and the Monaco editor checks a subset of what the compiler
checks, and it reports the compiler’s code for every condition in that subset. So the Unknown type 'Foo'
you get as a squiggle and the one the CLI prints are the same PLAY0165, and can be looked up here, filtered
on, and matched against a build log:
import { diagnosticCodes , validateLines } from ' @cratis/screenplay-language ' ;
const unknownTypes = validateLines ( lines ) . filter (( issue ) => issue . code === diagnosticCodes . unknownType );
diagnosticCodes names the codes the editor reports, the same way DiagnosticCodes names them for the
compiler. A ValidationIssue carries the code as code, and it reaches the editor: a Monaco marker gets it as
code, a VS Code diagnostic as Diagnostic.code.
A few editor checks carry no code, deliberately. The capture and projection validators enforce structural
rules that no compiler run reports - a capture must include a source block, an append block must include a
when clause - and there is no PLAY number for something the compiler never emits. Minting one would make
this catalogue describe two different tools, which is the thing the PLAY prefix was chosen to avoid. Those
conditions are reported without a code until the compiler checks them too.
Code Severity Reported when PLAY0001Error A line at the top level of a document opens with a word nothing at that level is declared by. PLAY0002Error A domain line is not domain <Qualified.Name>. PLAY0003Error A document declares a domain more than once, and a document has at most one. PLAY0004Error domain is declared after another construct, and it names what the whole document is about.PLAY0005Error An import line is not import <Qualified.Name>. PLAY0006Warning A line is indented with tabs, and Screenplay decides nesting from spaces.
Code Severity Reported when PLAY0007Error A concept line is not concept <Name> : <Type>. PLAY0008Error A concept is declared over a primitive the language does not have. PLAY0009Error A value of an enumeration concept is not an identifier. PLAY0010Error A line in a concept body opens with a word a concept declares nothing by. PLAY0011Warning A value of an enumeration is called validate, which the concept body reads as an empty validate block. PLAY0012Error A concept gives the reason for an attribute it does not carry. PLAY0013Error A concept gives the reason for one attribute more than once.
Code Severity Reported when PLAY0014Error A type line is not type <Name>. PLAY0015Error A type declares no properties, and a type is the properties it holds. PLAY0016Error A property line is not <name> <Type>. PLAY0017Error A property outside a command is marked as the identifier, which only a command property can be.
Code Severity Reported when PLAY0018Error An event line is not event <Name>. PLAY0019Error A property of an event is marked as the identifier, and an event never carries its event source id. PLAY0020Warning A property called tag is read by the event body as a static tag rather than as a property.
Code Severity Reported when PLAY0021Error A module line is not module <Name>. PLAY0022Error A line in a module body opens with a word a module declares nothing by. PLAY0023Error A feature line is not feature <Name>. PLAY0024Error A line in a feature body opens with a word a feature declares nothing by. PLAY0025Error A slot declared by a layout, screen template or dialog template is not an identifier optionally followed by contributes. PLAY0026Error A line in a layout, screen template or dialog template body opens a block none of them declares anything by. PLAY0027Error A slice line is not slice <Type> <Name>. PLAY0028Error A slice is declared with a type the language does not have. PLAY0029Warning A line in a slice body opens with a word a slice declares nothing by.
Code Severity Reported when PLAY0030Error A persona line is not persona <Name>. PLAY0031Error A policy line in a persona body is not policy <Name>. PLAY0032Error A line in a persona body opens with a word a persona declares nothing by.
Code Severity Reported when PLAY0033Error A command line is not command <Name>. PLAY0034Error A line in a command body opens with a word a command declares nothing by. PLAY0035Error A command declares both produces and handler, which say the same thing two ways. PLAY0036Error A command marks more than one property as its identifier. PLAY0037Error A concurrency line carries anything beyond the keyword. PLAY0038Error A command declares more than one concurrency block, and a command has at most one. PLAY0039Error A line in a concurrency block names a dimension the block does not have. PLAY0040Error A dimension of a concurrency block is not written the way that dimension is written. PLAY0041Error A concurrency block states one dimension more than once. PLAY0042Error A produces line is neither produces <EventType> nor produces when <condition>. PLAY0043Error A produces when condition is followed by no event to produce. PLAY0044Error A mapping line is not <property> = <source>. PLAY0045Error A handler names neither a file nor an inline code block. PLAY0046Error A line in a handler body opens with a word a handler declares nothing by.
Code Severity Reported when PLAY0047Error A query line is not query <Name> => [observable] <ReadModel>. PLAY0048Error A line in a query body opens with a word a query declares nothing by. PLAY0049Error A by or filter parameter is not <keyword> <name> <Type> [from <source>]. PLAY0050Error A performer line carries anything beyond the keyword. PLAY0051Error A query declares more than one performer, and a query has at most one. PLAY0052Error A performer names neither a file nor an inline code block. PLAY0053Error A line in a performer body opens with a word a performer declares nothing by.
Code Severity Reported when PLAY0054Error A projection document holds a top level line that does not open a projection. PLAY0055Error A projection document declares no projection at all. PLAY0056Error A projection line is not projection <Name> [=> <ReadModel>]. PLAY0057Error A projection declares no directives, so it builds nothing. PLAY0058Error A line in a projection body opens with a word a projection declares nothing by. PLAY0059Error A projection declares more than one key. PLAY0060Error A from block declares more than one key. PLAY0061Error A from line names no event to read from. PLAY0062Error An event reference is not a name the language can read as one. PLAY0063Error A join line is not join <property> on <key>. PLAY0064Error A join block holds a line that is not with <EventType>. PLAY0065Error A children line is not children <collection> identified by <key>. PLAY0066Error A nested line is not nested <property>. PLAY0067Error A nested block reads from no event, so nothing ever fills it. PLAY0068Error A remove line is neither remove with <EventType> nor remove via join on <EventType>. PLAY0069Error A remove block holds a line other than parent. PLAY0070Error A clear line is not clear with <EventType>. PLAY0071Error clear with is written where there is nothing to clear.PLAY0072Error A part of a composite key is not <property> = <expression>. PLAY0073Error A composite key part is a template expression, which a key cannot be. PLAY0074Error A composite key declares no parts. PLAY0075Error A mapping line in a projection is not one the language can read.
Code Severity Reported when PLAY0076Error A capture document holds a top level line that does not open a capture. PLAY0077Error A capture document declares no capture at all. PLAY0078Error A capture line is not capture <Name>. PLAY0079Error A line in a capture body opens with a word a capture declares nothing by. PLAY0080Error A map entry is not <property> = <source> [translate]. PLAY0081Error A translation is not "<source>" => <target>. PLAY0082Error A split line is not split <property> by "<separator>". PLAY0083Error A target of a split is not a property path. PLAY0084Error An append line is not append <EventType>. PLAY0085Error A line in an append body opens with a word an append declares nothing by. PLAY0086Error A when line names no trigger. PLAY0087Error A when clause is not one of the shapes a trigger is written in. PLAY0088Error A value transition is not when <Path> from <value> to <value>. PLAY0089Error A when clause combines properties with both and and or. PLAY0090Error A when combinator is followed by no property. PLAY0091Error A line in a children or nested block is neither map nor append.
Code Severity Reported when PLAY0092Error A specification document holds a top level line that does not open a specification. PLAY0093Error A specification document declares no specification at all. PLAY0094Error A specification line is not specification <Name>. PLAY0095Error A line in a specification body opens with a word a specification declares nothing by. PLAY0096Error A when line is not when <CommandType>. PLAY0097Error A specification issues more than one command, and a specification is one example. PLAY0098Error A then error line is neither then error nor then error "<reason>". PLAY0099Error A given readmodel or then readmodel line does not name a read model type. PLAY0100Error A given or then line does not name an event type. PLAY0101Error A value a specification step states is not <property> = <value>.
Code Severity Reported when PLAY0102Error A screen line is not screen <Name>. PLAY0103Error A line in a screen body opens with a word a screen declares nothing by. PLAY0104Error A data line is not data <ReadModel> via query <Query> [by <param>]. PLAY0105Error An action line is not action <Command>. PLAY0106Error A line in an action body is neither label nor navigate to. PLAY0107Error A navigation is not navigate to <Screen> [by <param>]. PLAY0108Error A line under a screen layout does not name a slot. PLAY0109Error A title line is not title "<text>". PLAY0110Error A line in a table body is neither column nor on row-click navigate to. PLAY0111Error A line in a summary body is not field <property> label "<text>".
Code Severity Reported when PLAY0112Error A policy line is not policy <Name>. PLAY0113Error A line in a policy body is neither require nor an inline code block. PLAY0114Error A policy states nothing it requires of the caller. PLAY0115Error A policy condition holds a token the language has no reading for. PLAY0116Error A policy requirement states no condition. PLAY0117Error A group opened in a policy condition is never closed. PLAY0118Error A role requirement names no role. PLAY0119Error A claim requirement names no claim. PLAY0120Error A claim requirement does not say what the claim is matched against. PLAY0121Error A claim match states nothing to match the claim to. PLAY0122Error An authorize clause names no policy. PLAY0123Error A policy is referred to by something that is not a policy name.
Code Severity Reported when PLAY0124Error An authentication line carries anything beyond the keyword. PLAY0125Error A document declares more than one authentication block, and a document has at most one. PLAY0126Error A provider line is not provider <Name>. PLAY0127Error A setting of a provider is not <name> <value>.
Code Severity Reported when PLAY0128Error A seed line carries anything beyond the keyword. PLAY0129Error A seed group is not for "<event source id>". PLAY0130Error A line in a seed group does not name an event type. PLAY0131Error A value a seeded event carries is not <property> = <value>.
Code Severity Reported when PLAY0132Error A constraint line is not constraint <Name>. PLAY0133Error A constraint states nothing it holds the application to. PLAY0134Error A line in a constraint body is not one the language can read. PLAY0135Error A constraint states more than one rule, and a constraint states one.
Code Severity Reported when PLAY0136Error A reaction line is not reaction <Name>. PLAY0137Error A line in a reaction body is not a trigger the language reads. PLAY0138Error A reaction states no trigger, so nothing ever sets it off. PLAY0139Error A line in a reaction trigger body opens with a word a trigger declares nothing by.
Code Severity Reported when PLAY0140Error A validate line is neither validate nor validate csharp. PLAY0141Error A validation rule is not one the language can read. PLAY0142Error A validation rule names a rule the language does not have. PLAY0143Error A rule line does not name the rule with an identifier. PLAY0144Error A named rule names neither a file nor an inline code block.
Code Severity Reported when PLAY0145Error A description line is not description "<text>". PLAY0146Error A fenced description holds no text. PLAY0147Error Something is described more than once, and a description is given once. PLAY0148Error A tag line carries no value. PLAY0149Error A tag value is neither an identifier, a string literal nor a context expression.
Code Severity Reported when PLAY0150Error A literal expression carries no value. PLAY0151Error A $causedBy expression names a property the cause does not carry. PLAY0152Error An expression is not one the language can read. PLAY0153Warning A $context path opens with a root the context does not have. PLAY0154Warning A $context.causedBy path names a property the cause does not carry. PLAY0155Warning A $context.identity path names a property the identity does not carry. PLAY0156Error A template expression is never closed. PLAY0157Error An interpolation inside a template expression is never closed.
Code Severity Reported when PLAY0158Error A condition holds a token the language has no reading for. PLAY0159Error A condition is expected and nothing is written. PLAY0160Error A group opened in a condition is never closed. PLAY0161Error A comparison states what is compared and not how. PLAY0162Error A comparison states nothing to compare against.
Code Severity Reported when PLAY0163Error A construct opening an inline code block is followed by no fence. PLAY0164Error An inline code block is never closed.
Code Severity Reported when PLAY0165Warning A property names a type nothing in the document or its imports declares. PLAY0166Warning An event is referred to that nothing in the document or its imports declares. PLAY0167Warning A policy is referred to that nothing in the document declares. PLAY0168Error A concept and a type, or two of either, are declared under one name. PLAY0169Error An authentication block declares two providers under one name. PLAY0170Error A seed block seeds nothing. PLAY0171Error A concurrency block narrows nothing.
Code Severity Reported when PLAY0172Error Two files of a folder each declare something the application has at most one of. PLAY0173Error Two files of a folder declare the same name. PLAY0174Warning Two files of a folder describe the same thing differently, and the first description is kept.
Code Severity Reported when PLAY0175Error A reads line is not reads <ReadModel> or reads <ReadModel> by <property>. PLAY0176Error A command declares that it reads the same read model more than once. PLAY0177Warning A command reads a read model no projection in the document produces. PLAY0178Warning The by of a reads declaration does not name a property of the command.
Code Severity Reported when PLAY0179Error A require rule carries no condition. PLAY0180Error The body of a require rule holds something other than its message. PLAY0181Warning A require operand is qualified by something the command does not read. PLAY0182Warning A require operand names neither a property of the artifact nor state it reads.
Code Severity Reported when PLAY0183Error An authentication provider carries a configuration body, which belongs where the application runs.
Code Severity Reported when PLAY0184Error Tokens are left over after the requirement of an authorize. PLAY0185Error A parenthesised group in an authorize is never closed.
Code Severity Reported when PLAY0186Error A readmodel line is not readmodel <Name>. PLAY0187Error A reducer line is not reducer <Name> => <ReadModel>. PLAY0188Error A line in a reducer body is not an on <EventType> rule. PLAY0189Error A reducer declares no rule, so nothing it observes is stated. PLAY0190Error The body of a reducer rule holds something other than a description, a file or inline code. PLAY0191Error More than one projection or reducer builds the same read model. PLAY0192Error A document declares the same read model more than once.
Code Severity Reported when PLAY0193Error A produces declares more than one for, and an event is appended to one event source. PLAY0194Error An invokes line is not invokes <Command>. PLAY0195Warning A reactor invokes a command the document does not declare.
Code Severity Reported when PLAY0196Warning A screen binds data to a query nothing in scope declares. PLAY0197Warning A screen navigates to a screen nothing in scope declares. PLAY0198Warning A bare name matches more than one declaration at the same depth, so which one it means is undecided.
Code Severity Reported when PLAY0199Error A scoped line is not scoped to <scope>. PLAY0200Error A query declares more than one scope, and results are narrowed one way.
Code Severity Reported when PLAY0201Error A ui profile line is not ui profile <Name>. PLAY0202Error Two ui profile blocks in the same document declare the same name. PLAY0203Error A target line under a ui profile is neither target platform ... nor target size .... PLAY0204Error A ui profile declares target platform or target size more than once. PLAY0205Error A line under a packages block is not a valid package name. PLAY0206Error A ui profile’s packages block lists the same package more than once. PLAY0207Error A line in a ui profile body is not target or packages, or packages is declared more than once.
Code Severity Reported when PLAY0208Error A form line is not form <Name> for <Command>. PLAY0209Error Two form blocks in the same document declare the same name. PLAY0210Error A line in a form body is not populate, field or on submit. PLAY0211Error A populate line is neither populate via query ... nor populate from item. PLAY0212Error A form declares populate more than once. PLAY0213Error A field line is not field <property> [from <source>|compose using <Callback>] [label "..."]. PLAY0214Error An on submit line is not on submit navigate to <Screen> [by <param>]. PLAY0215Error A form declares on submit more than once. PLAY0216Warning A field binds to a property its form’s command does not declare.
Code Severity Reported when PLAY0217Error A contribute line is not contribute to <ContributionPoint>. PLAY0218Error A line in a contribute to body is not navigate, label or order. PLAY0219Error A contribution declares navigate to more than once. PLAY0220Error A contribution declares label more than once. PLAY0221Error A contribution declares order more than once. PLAY0222Error A contribution’s label line is not label "..." or label $strings..... PLAY0223Error A contribution’s order line is not order <number>. PLAY0224Warning A contribution names a contribution point nothing in scope declares.
Code Severity Reported when PLAY0225Error A theme line is not theme <Name>. PLAY0226Error Two theme blocks in the same document declare the same name. PLAY0227Error A line in a theme body is not compatible with <Package>. PLAY0228Error A theme declares compatibility with the same package more than once. PLAY0229Error A ui profile’s theme line is not theme <Name>. PLAY0230Error A ui profile declares theme more than once. PLAY0231Warning A ui profile selects a theme nothing in the document declares. PLAY0232Warning A ui profile selects a theme not declared compatible with one of the profile’s own packages.
Code Severity Reported when PLAY0233Error An arrangement line is not arrangement flow or arrangement freeform. PLAY0234Error A layout, screen template or dialog template declares arrangement more than once. PLAY0235Error A row, column or grid line in an arrangement is malformed. PLAY0236Error A slot leaf within an arrangement tree has malformed sizing attributes. PLAY0237Error A when override line in an arrangement is not a valid width/height size-class condition. PLAY0238Error An arrangement declares more than one when override for the same width/height size-class combination. PLAY0239Error An arrangement block’s body does not match its mode - a flow arrangement declares a variant, or a freeform arrangement declares anything other than one. PLAY0240Error A variant line is not variant width <compact|regular>, height <compact|regular>. PLAY0241Error An arrangement declares more than one variant for the same width/height size-class combination. PLAY0242Error A place line is not place <Slot> hidden or place <Slot> at x,y size w,h. PLAY0243Error A variant places (or hides) the same slot more than once. PLAY0244Warning A freeform arrangement’s variant does not mention (place or hide) a slot another variant of the same arrangement places.
Code Severity Reported when PLAY0245Error A trigger line is not trigger <Name>. PLAY0246Error A line in a trigger body is neither a description nor a value the trigger provides. PLAY0247Error The document declares two triggers by the same name, leaving no answer to which one a reaction means. PLAY0248Warning A when line names neither an event nor a trigger the document or the compiler knows. PLAY0249Error An every line is not every <n> <seconds|minutes|hours|days>. PLAY0250Error An at line is not at <HH:mm>, optionally followed by on <Weekday> or on day <n>. PLAY0251Warning A reaction takes a value from an occurrence that the trigger does not provide. PLAY0252Error A reaction states more than one where, and a reaction is narrowed by one condition. PLAY0253Error A reaction declares the same trigger more than once, so the second says nothing the first did not.
Code Severity Reported when PLAY0254Error A screen template line is not screen template <Name>. PLAY0255Error A dialog template line is not dialog template <Name>. PLAY0256Error A fits slot line is not fits slot <name>. PLAY0257Error A screen template declares fits slot more than once. PLAY0258Error A layout or a dialog template declares fits slot - neither fills a slot of a parent structure. PLAY0259Error A top level layout line is not layout <Name>. PLAY0260Error A document declares more than one layout by the same name. PLAY0261Error A ui profile’s layout line is not layout <Name>. PLAY0262Error A ui profile declares layout more than once. PLAY0263Warning A ui profile selects a layout nothing in the document declares.
Code Severity Reported when PLAY0264Warning A file directive names an absolute path, and a file reference is relative to the repository root.
A path that does not resolve is not a diagnostic, at any severity. A document is read in a designer, in a
build and on a machine where the tree is not present, so the compiler never holds a path against a file system -
a stale path must not be what makes a valid document invalid. A consumer that can resolve paths decides for
itself what an unresolvable one means.
None yet. When a code is retired it is listed here with the release it went in, and its number stays out of use forever.