@cratis/screenplay-language 4.52.0 → 4.53.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 (190) hide show
  1. package/dist/TypeReferenceSymbol.d.ts +8 -0
  2. package/dist/TypeReferenceSymbol.d.ts.map +1 -0
  3. package/dist/bundles/chunk-7WJEZ72S.js +4463 -0
  4. package/dist/bundles/chunk-7WJEZ72S.js.map +7 -0
  5. package/dist/bundles/index.js +1410 -0
  6. package/dist/bundles/index.js.map +7 -0
  7. package/dist/bundles/sub-languages/capture/index.js +677 -0
  8. package/dist/bundles/sub-languages/capture/index.js.map +7 -0
  9. package/dist/bundles/sub-languages/projection/index.js +1647 -0
  10. package/dist/bundles/sub-languages/projection/index.js.map +7 -0
  11. package/dist/code-actions.d.ts +3 -0
  12. package/dist/code-actions.d.ts.map +1 -0
  13. package/dist/completion-items.d.ts +1 -0
  14. package/dist/completion-items.d.ts.map +1 -1
  15. package/dist/completion-planner.d.ts.map +1 -1
  16. package/dist/completions.d.ts.map +1 -1
  17. package/dist/diagnostic-codes.d.ts +3 -0
  18. package/dist/diagnostic-codes.d.ts.map +1 -1
  19. package/dist/diagnostics.d.ts.map +1 -1
  20. package/dist/hover-content.d.ts.map +1 -1
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/keyword-docs.d.ts.map +1 -1
  24. package/dist/language.d.ts +1 -0
  25. package/dist/language.d.ts.map +1 -1
  26. package/dist/production-destinations.d.ts.map +1 -1
  27. package/dist/symbols.d.ts +4 -0
  28. package/dist/symbols.d.ts.map +1 -1
  29. package/dist/tokens.d.ts.map +1 -1
  30. package/dist/validation.d.ts +1 -0
  31. package/dist/validation.d.ts.map +1 -1
  32. package/package.json +13 -9
  33. package/DestinationHint.ts +0 -8
  34. package/ProductionSymbol.ts +0 -11
  35. package/completion-items.ts +0 -261
  36. package/completion-planner.ts +0 -167
  37. package/completions.ts +0 -156
  38. package/diagnostic-codes.ts +0 -43
  39. package/diagnostics.ts +0 -55
  40. package/dist/DestinationHint.js +0 -4
  41. package/dist/DestinationHint.js.map +0 -1
  42. package/dist/ProductionSymbol.js +0 -4
  43. package/dist/ProductionSymbol.js.map +0 -1
  44. package/dist/completion-items.js +0 -228
  45. package/dist/completion-items.js.map +0 -1
  46. package/dist/completion-planner.js +0 -143
  47. package/dist/completion-planner.js.map +0 -1
  48. package/dist/completions.js +0 -101
  49. package/dist/completions.js.map +0 -1
  50. package/dist/diagnostic-codes.js +0 -41
  51. package/dist/diagnostic-codes.js.map +0 -1
  52. package/dist/diagnostics.js +0 -50
  53. package/dist/diagnostics.js.map +0 -1
  54. package/dist/document-context.js +0 -85
  55. package/dist/document-context.js.map +0 -1
  56. package/dist/event-analysis-source.js +0 -19
  57. package/dist/event-analysis-source.js.map +0 -1
  58. package/dist/event-context-catalog.js +0 -116
  59. package/dist/event-context-catalog.js.map +0 -1
  60. package/dist/event-context.js +0 -88
  61. package/dist/event-context.js.map +0 -1
  62. package/dist/file-imports.js +0 -58
  63. package/dist/file-imports.js.map +0 -1
  64. package/dist/file-references.js +0 -70
  65. package/dist/file-references.js.map +0 -1
  66. package/dist/hover-content.js +0 -98
  67. package/dist/hover-content.js.map +0 -1
  68. package/dist/hover.js +0 -15
  69. package/dist/hover.js.map +0 -1
  70. package/dist/index.js +0 -61
  71. package/dist/index.js.map +0 -1
  72. package/dist/inlay-hints.js +0 -15
  73. package/dist/inlay-hints.js.map +0 -1
  74. package/dist/inline-event-validation.js +0 -131
  75. package/dist/inline-event-validation.js.map +0 -1
  76. package/dist/keyword-docs.js +0 -148
  77. package/dist/keyword-docs.js.map +0 -1
  78. package/dist/language.js +0 -196
  79. package/dist/language.js.map +0 -1
  80. package/dist/production-destinations.js +0 -32
  81. package/dist/production-destinations.js.map +0 -1
  82. package/dist/sub-language-registry.js +0 -18
  83. package/dist/sub-language-registry.js.map +0 -1
  84. package/dist/sub-languages/capture/CompletionProvider.js +0 -332
  85. package/dist/sub-languages/capture/CompletionProvider.js.map +0 -1
  86. package/dist/sub-languages/capture/HoverProvider.js +0 -87
  87. package/dist/sub-languages/capture/HoverProvider.js.map +0 -1
  88. package/dist/sub-languages/capture/Validator.js +0 -72
  89. package/dist/sub-languages/capture/Validator.js.map +0 -1
  90. package/dist/sub-languages/capture/index.js +0 -58
  91. package/dist/sub-languages/capture/index.js.map +0 -1
  92. package/dist/sub-languages/capture/language.js +0 -160
  93. package/dist/sub-languages/capture/language.js.map +0 -1
  94. package/dist/sub-languages/cdl.js +0 -74
  95. package/dist/sub-languages/cdl.js.map +0 -1
  96. package/dist/sub-languages/pdl.js +0 -73
  97. package/dist/sub-languages/pdl.js.map +0 -1
  98. package/dist/sub-languages/projection/CodeActionProvider.js +0 -93
  99. package/dist/sub-languages/projection/CodeActionProvider.js.map +0 -1
  100. package/dist/sub-languages/projection/CompletionProvider.js +0 -595
  101. package/dist/sub-languages/projection/CompletionProvider.js.map +0 -1
  102. package/dist/sub-languages/projection/HoverProvider.js +0 -333
  103. package/dist/sub-languages/projection/HoverProvider.js.map +0 -1
  104. package/dist/sub-languages/projection/Validator.js +0 -388
  105. package/dist/sub-languages/projection/Validator.js.map +0 -1
  106. package/dist/sub-languages/projection/index.js +0 -160
  107. package/dist/sub-languages/projection/index.js.map +0 -1
  108. package/dist/sub-languages/projection/language.js +0 -171
  109. package/dist/sub-languages/projection/language.js.map +0 -1
  110. package/dist/symbols.js +0 -275
  111. package/dist/symbols.js.map +0 -1
  112. package/dist/themes/screenplay-dark.js +0 -30
  113. package/dist/themes/screenplay-dark.js.map +0 -1
  114. package/dist/themes/screenplay-light.js +0 -30
  115. package/dist/themes/screenplay-light.js.map +0 -1
  116. package/dist/tokens.js +0 -147
  117. package/dist/tokens.js.map +0 -1
  118. package/dist/validation.js +0 -248
  119. package/dist/validation.js.map +0 -1
  120. package/document-context.ts +0 -93
  121. package/event-analysis-source.ts +0 -18
  122. package/event-context-catalog.ts +0 -135
  123. package/event-context.ts +0 -119
  124. package/file-imports.ts +0 -70
  125. package/file-references.ts +0 -87
  126. package/for_documentContext/when_stripping_comments.ts +0 -32
  127. package/for_eventContext/when_resolving_generated_catalog_vectors.ts +0 -15
  128. package/for_eventGenerations/when_editing_event_generations.ts +0 -57
  129. package/for_fileImports/when_finding_file_imports.ts +0 -38
  130. package/for_fileReferences/when_recognizing_an_absolute_path/with_paths_of_every_shape.ts +0 -26
  131. package/for_fileReferences/when_scanning_a_document/inside_a_code_fence.ts +0 -26
  132. package/for_fileReferences/when_scanning_a_document/with_a_bare_file_keyword.ts +0 -19
  133. package/for_fileReferences/when_scanning_a_document/with_a_file_directive.ts +0 -30
  134. package/for_fileReferences/when_scanning_a_document/with_a_property_named_file.ts +0 -25
  135. package/for_fileReferences/when_scanning_a_document/with_a_trailing_comment.ts +0 -25
  136. package/for_fileReferences/when_scanning_a_document/with_directives_on_several_constructs.ts +0 -41
  137. package/for_importablePaths/when_listing_what_a_document_can_import.ts +0 -34
  138. package/for_inlineEvents/when_analyzing_many_inline_events.ts +0 -59
  139. package/for_inlineEvents/when_authoring_inline_events.ts +0 -149
  140. package/for_inlineEvents/when_completing_many_events.ts +0 -49
  141. package/for_inlineEvents/when_indexing_command_production_ownership.ts +0 -79
  142. package/for_planCompletions/when_completing_a_file_import.ts +0 -26
  143. package/for_planCompletions/when_completing_a_specification_query.ts +0 -24
  144. package/for_planCompletions/when_completing_a_specification_step.ts +0 -42
  145. package/for_planCompletions/when_completing_an_absent_read_model.ts +0 -14
  146. package/for_planCompletions/when_completing_reaction_reads.ts +0 -36
  147. package/for_projectionCompletionProvider/when_completing_an_event_context_path.ts +0 -102
  148. package/for_projectionHoverProvider/when_hovering_an_event_context_path.ts +0 -44
  149. package/for_projectionValidator/when_validating_a_projection_with_variants.ts +0 -128
  150. package/for_projectionValidator/when_validating_event_context_paths.ts +0 -31
  151. package/for_scanDocument/when_scanning_a_query/with_a_dotted_return_type.ts +0 -34
  152. package/for_scanDocument/when_scanning_aliased_reads.ts +0 -33
  153. package/for_scanDocument/when_scanning_many_commands.ts +0 -47
  154. package/for_tokens/when_highlighting_a_file_import.ts +0 -18
  155. package/for_tokens/when_highlighting_event_metadata.ts +0 -63
  156. package/for_tokens/when_highlighting_specification_steps.ts +0 -28
  157. package/for_validateLines/when_validating_a_document/with_a_problem_of_every_coded_kind.ts +0 -77
  158. package/for_validateLines/when_validating_a_document/with_an_unknown_policy.ts +0 -33
  159. package/for_validateLines/when_validating_a_file_placed_by_an_import/with_names_declared_in_other_files.ts +0 -43
  160. package/for_validateLines/when_validating_event_context_paths/in_a_projection.ts +0 -97
  161. package/for_validateLines/when_validating_file_imports/at_every_level.ts +0 -36
  162. package/for_validateLines/when_validating_production_destinations/with_an_available_identifier.ts +0 -120
  163. package/hover-content.ts +0 -117
  164. package/hover.ts +0 -23
  165. package/index.ts +0 -125
  166. package/inlay-hints.ts +0 -17
  167. package/inline-event-validation.ts +0 -115
  168. package/keyword-docs.ts +0 -152
  169. package/language.ts +0 -212
  170. package/production-destinations.ts +0 -32
  171. package/sub-language-registry.ts +0 -42
  172. package/sub-languages/capture/CompletionProvider.ts +0 -365
  173. package/sub-languages/capture/HoverProvider.ts +0 -99
  174. package/sub-languages/capture/Validator.ts +0 -97
  175. package/sub-languages/capture/index.ts +0 -72
  176. package/sub-languages/capture/language.ts +0 -176
  177. package/sub-languages/cdl.ts +0 -76
  178. package/sub-languages/pdl.ts +0 -75
  179. package/sub-languages/projection/CodeActionProvider.ts +0 -123
  180. package/sub-languages/projection/CompletionProvider.ts +0 -660
  181. package/sub-languages/projection/HoverProvider.ts +0 -377
  182. package/sub-languages/projection/Validator.ts +0 -441
  183. package/sub-languages/projection/index.ts +0 -223
  184. package/sub-languages/projection/language.ts +0 -193
  185. package/symbols.ts +0 -374
  186. package/themes/screenplay-dark.ts +0 -33
  187. package/themes/screenplay-light.ts +0 -33
  188. package/tokens.ts +0 -174
  189. package/validation.ts +0 -443
  190. package/vitest.setup.ts +0 -5
@@ -1,41 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- // The PLAY codes the editor reports. Every one of them mirrors a condition the compiler checks and
4
- // carries the compiler's own code for it, so the same problem is called the same thing whether it was
5
- // found by the CLI or by a squiggle - see Documentation/screenplay/diagnostics.md for the catalogue.
6
- //
7
- // A code is only ever added here for a condition the compiler can also report. The editor makes a few
8
- // structural checks the compiler does not - the capture and projection validators are where they live -
9
- // and those stay codeless deliberately: minting a PLAY number for something no compiler run can emit
10
- // would make the catalogue describe two different tools.
11
- export const diagnosticCodes = {
12
- eventSourceIdInPayload: 'PLAY0469',
13
- explicitProducesTargetsRequired: 'PLAY0470',
14
- redundantEventId: 'PLAY0471',
15
- invalidEventId: 'PLAY0472',
16
- inlineEventCollision: 'PLAY0473',
17
- inlineEventOutsideCommand: 'PLAY0474',
18
- inlineEventGeneration: 'PLAY0475',
19
- reservedProductionMetadata: 'PLAY0476',
20
- invalidEventDocumentation: 'PLAY0477',
21
- tabIndentation: 'PLAY0006',
22
- unknownPrimitiveType: 'PLAY0008',
23
- unknownSliceType: 'PLAY0028',
24
- duplicateCommandIdentifier: 'PLAY0036',
25
- unknownContextPath: 'PLAY0153',
26
- unknownContextCausedByProperty: 'PLAY0154',
27
- unknownContextIdentityProperty: 'PLAY0155',
28
- unclosedCodeBlock: 'PLAY0164',
29
- unknownType: 'PLAY0165',
30
- unknownEvent: 'PLAY0166',
31
- unknownPolicy: 'PLAY0167',
32
- duplicateDeclaration: 'PLAY0168',
33
- unknownEventContextMember: 'PLAY0295',
34
- unknownEventContextPath: 'PLAY0296',
35
- eventContextPathBelowCollection: 'PLAY0297',
36
- missingEventContextPath: 'PLAY0298',
37
- unresolvedDynamicKeySource: 'PLAY0299',
38
- invalidFileImport: 'PLAY0454',
39
- omittedProductionDestination: 'PLAY0478',
40
- };
41
- //# sourceMappingURL=diagnostic-codes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostic-codes.js","sourceRoot":"","sources":["../diagnostic-codes.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,mGAAmG;AACnG,sGAAsG;AACtG,qGAAqG;AACrG,EAAE;AACF,sGAAsG;AACtG,wGAAwG;AACxG,qGAAqG;AACrG,yDAAyD;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,sBAAsB,EAAE,UAAU;IAClC,+BAA+B,EAAE,UAAU;IAC3C,gBAAgB,EAAE,UAAU;IAC5B,cAAc,EAAE,UAAU;IAC1B,oBAAoB,EAAE,UAAU;IAChC,yBAAyB,EAAE,UAAU;IACrC,qBAAqB,EAAE,UAAU;IACjC,0BAA0B,EAAE,UAAU;IACtC,yBAAyB,EAAE,UAAU;IACrC,cAAc,EAAE,UAAU;IAC1B,oBAAoB,EAAE,UAAU;IAChC,gBAAgB,EAAE,UAAU;IAC5B,0BAA0B,EAAE,UAAU;IACtC,kBAAkB,EAAE,UAAU;IAC9B,8BAA8B,EAAE,UAAU;IAC1C,8BAA8B,EAAE,UAAU;IAC1C,iBAAiB,EAAE,UAAU;IAC7B,WAAW,EAAE,UAAU;IACvB,YAAY,EAAE,UAAU;IACxB,aAAa,EAAE,UAAU;IACzB,oBAAoB,EAAE,UAAU;IAChC,yBAAyB,EAAE,UAAU;IACrC,uBAAuB,EAAE,UAAU;IACnC,+BAA+B,EAAE,UAAU;IAC3C,uBAAuB,EAAE,UAAU;IACnC,0BAA0B,EAAE,UAAU;IACtC,iBAAiB,EAAE,UAAU;IAC7B,4BAA4B,EAAE,UAAU;CAClC,CAAC"}
@@ -1,50 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- import { languageId } from './language';
4
- import { validateLines } from './validation';
5
- const owner = 'screenplay';
6
- const validationDelay = 300;
7
- export function validate(monaco, model) {
8
- return validateLines(model.getLinesContent()).map((issue) => ({
9
- severity: issue.severity === 'error'
10
- ? monaco.MarkerSeverity.Error
11
- : issue.severity === 'information'
12
- ? monaco.MarkerSeverity.Info
13
- : monaco.MarkerSeverity.Warning,
14
- message: issue.message,
15
- code: issue.code,
16
- startLineNumber: issue.line + 1,
17
- startColumn: issue.startColumn,
18
- endLineNumber: issue.line + 1,
19
- endColumn: issue.endColumn,
20
- }));
21
- }
22
- function watch(monaco, model) {
23
- let handle;
24
- const run = () => {
25
- if (model.isDisposed())
26
- return;
27
- if (model.getLanguageId() !== languageId) {
28
- monaco.editor.setModelMarkers(model, owner, []);
29
- return;
30
- }
31
- monaco.editor.setModelMarkers(model, owner, validate(monaco, model));
32
- };
33
- const schedule = () => {
34
- if (handle !== undefined)
35
- clearTimeout(handle);
36
- handle = setTimeout(run, validationDelay);
37
- };
38
- model.onDidChangeContent(schedule);
39
- model.onDidChangeLanguage(run);
40
- model.onWillDispose(() => {
41
- if (handle !== undefined)
42
- clearTimeout(handle);
43
- });
44
- run();
45
- }
46
- export function attachDiagnostics(monaco) {
47
- monaco.editor.getModels().forEach((model) => watch(monaco, model));
48
- monaco.editor.onDidCreateModel((model) => watch(monaco, model));
49
- }
50
- //# sourceMappingURL=diagnostics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../diagnostics.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAU,UAAU,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,KAAK,GAAG,YAAY,CAAC;AAC3B,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,KAAwB;IAC7D,OAAO,aAAa,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC1D,QAAQ,EACJ,KAAK,CAAC,QAAQ,KAAK,OAAO;YACtB,CAAC,C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AAC,GAAG,EAAE;QACrB,IAAI,MAAM,KAAK,SAAS;YAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IACH,GAAG,EAAE,CAAC;AACV,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC5C,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IACnE,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -1,85 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- // Matches SourceLineSplitter.CommentStart: // inside a double-quoted string or a
4
- // backtick template is content; a backslash escapes the next character only in a string.
5
- export function withoutComment(line) {
6
- let inString = false;
7
- let inTemplate = false;
8
- for (let index = 0; index < line.length; index++) {
9
- const character = line[index];
10
- if (character === '\\' && inString && index + 1 < line.length) {
11
- index++;
12
- }
13
- else if (character === '"' && !inTemplate) {
14
- inString = !inString;
15
- }
16
- else if (character === '`' && !inString) {
17
- inTemplate = !inTemplate;
18
- }
19
- else if (!inString && !inTemplate && character === '/' && line[index + 1] === '/') {
20
- return line.slice(0, index);
21
- }
22
- }
23
- return line;
24
- }
25
- export function indentOf(line) {
26
- return line.length - line.trimStart().length;
27
- }
28
- export function firstWord(line) {
29
- return line.trim().split(/\s+/)[0] ?? '';
30
- }
31
- // Marks every line that is a code fence or lives inside one, so structural
32
- // scanning never mistakes inline C#/TypeScript/HTML for Screenplay.
33
- export function fenceMap(lines) {
34
- const map = new Array(lines.length).fill(false);
35
- let open = false;
36
- for (let index = 0; index < lines.length; index++) {
37
- if (/^\s*```(?:[a-z]+)?\s*$/.test(lines[index]) && (!open || /^\s*```\s*$/.test(lines[index]))) {
38
- map[index] = true;
39
- open = !open;
40
- continue;
41
- }
42
- map[index] = open;
43
- }
44
- return map;
45
- }
46
- // Walks upward from a position and returns the chain of enclosing block openers,
47
- // innermost first — e.g. ['command', 'slice', 'feature', 'module']. A block opener
48
- // is any less-indented line above; its first word names the construct (for layout
49
- // slots this is the slot name, which callers treat as an unknown construct).
50
- export function enclosingChain(lines, fences, lineIndex, indent) {
51
- const chain = [];
52
- let currentIndent = indent;
53
- for (let index = lineIndex - 1; index >= 0 && currentIndent > 0; index--) {
54
- if (fences[index])
55
- continue;
56
- const line = withoutComment(lines[index]);
57
- if (line.trim().length === 0)
58
- continue;
59
- const lineIndent = indentOf(line);
60
- if (lineIndent < currentIndent) {
61
- chain.push(firstWord(line));
62
- currentIndent = lineIndent;
63
- }
64
- }
65
- return chain;
66
- }
67
- // Returns the full trimmed text of the nearest enclosing block opener above a
68
- // position — the same line enclosingChain's first entry is derived from, but kept
69
- // whole rather than reduced to its first word. Used where the construct is not
70
- // identified by a fixed leading keyword, such as a validation rule line, whose
71
- // first word is the property it applies to rather than "rule".
72
- export function nearestEnclosingLine(lines, fences, lineIndex, indent) {
73
- for (let index = lineIndex - 1; index >= 0 && indent > 0; index--) {
74
- if (fences[index])
75
- continue;
76
- const line = withoutComment(lines[index]);
77
- if (line.trim().length === 0)
78
- continue;
79
- if (indentOf(line) < indent) {
80
- return line.trim();
81
- }
82
- }
83
- return undefined;
84
- }
85
- //# sourceMappingURL=document-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-context.js","sourceRoot":"","sources":["../document-context.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,iFAAiF;AACjF,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAC,IAAY;IACvC,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,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CAAC;AAED,8EAA8E;AAC9E,kFAAkF;AAClF,+EAA+E;AAC/E,+EAA+E;AAC/E,+DAA+D;AAC/D,MAAM,UAAU,oBAAoB,CAChC,KAAe,EACf,MAAiB,EACjB,SAAiB,EACjB,MAAc;IAEd,KAAK,IAAI,KAAK,GAAG,SAAS,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAChE,IAAI,MAAM,CAAC,KAAK,CAAC;YAAE,SAAS;QAC5B,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACvC,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -1,19 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- import { withoutComment } from './document-context';
4
- // Match SourceLineSplitter: comments begin outside strings/templates; fenced bodies remain opaque.
5
- export function eventAnalysisSource(lines) {
6
- let fenced = false;
7
- return lines.map(line => {
8
- if (fenced) {
9
- if (line.trim() === '```')
10
- fenced = false;
11
- return line;
12
- }
13
- const text = withoutComment(line);
14
- if (/^\s*```(?:[a-z]+)?\s*$/.test(text))
15
- fenced = true;
16
- return text.trimEnd();
17
- });
18
- }
19
- //# sourceMappingURL=event-analysis-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-analysis-source.js","sourceRoot":"","sources":["../event-analysis-source.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,mGAAmG;AACnG,MAAM,UAAU,mBAAmB,CAAC,KAAe;IAC/C,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACpB,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK;gBAAE,MAAM,GAAG,KAAK,CAAC;YAC1C,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,MAAM,GAAG,IAAI,CAAC;QACvD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,116 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- export const eventContextRootType = 'EventContext';
4
- // The members of each type a path passes through, keyed by type name.
5
- export const eventContextTypes = {
6
- 'EventContext': [
7
- { name: 'eventType', type: 'EventType', kind: 'composite', description: 'The type of the event - its identifier, generation and whether it is a tombstone.' },
8
- { name: 'eventSourceType', type: 'EventSourceType', kind: 'value', description: 'The type of the event source the event was appended to.' },
9
- { name: 'eventSourceId', type: 'EventSourceId', kind: 'value', description: 'The identifier of the event source the event was appended to - the value $eventSourceId resolves.' },
10
- { name: 'eventStreamType', type: 'EventStreamType', kind: 'value', description: 'The type of the event stream the event belongs to.' },
11
- { name: 'eventStreamId', type: 'EventStreamId', kind: 'value', description: 'The identifier of the event stream the event belongs to.' },
12
- { name: 'sequenceNumber', type: 'EventSequenceNumber', kind: 'value', description: 'The position of the event in its event sequence.' },
13
- { name: 'occurred', type: 'DateTimeOffset', kind: 'value', description: 'When the event occurred - the time it was appended unless one was given.' },
14
- { name: 'eventStore', type: 'EventStoreName', kind: 'value', description: 'The name of the event store the event belongs to.' },
15
- { name: 'namespace', type: 'EventStoreNamespaceName', kind: 'value', description: 'The namespace within the event store the event belongs to.' },
16
- { name: 'correlationId', type: 'CorrelationId', kind: 'value', description: 'The correlation identifier the event was appended with.' },
17
- { name: 'causation', type: 'IEnumerable<Causation>', kind: 'collection', description: 'The chain of causes that led to the event - a collection, not addressable below.' },
18
- { name: 'causedBy', type: 'Identity', kind: 'composite', description: 'The identity that caused the event.' },
19
- { name: 'tags', type: 'IEnumerable<Tag>', kind: 'collection', description: 'The tags the event was appended with - a collection, not addressable below.' },
20
- { name: 'hash', type: 'EventHash', kind: 'value', description: 'The hash of the event content.' },
21
- { name: 'observationState', type: 'EventObservationState', kind: 'value', description: 'Whether the observer sees the event for the first time or again on replay - differs between live processing and replay.' },
22
- { name: 'subject', type: 'Subject', kind: 'value', description: 'The compliance subject the event is about - the event source identifier unless one was given.' },
23
- { name: 'subjectIsEventSourceId', type: 'bool', kind: 'value', description: 'Whether the subject is the event source identifier.' },
24
- ],
25
- 'EventType': [
26
- { name: 'id', type: 'EventTypeId', kind: 'value', description: 'The identifier of the event type.' },
27
- { name: 'generation', type: 'EventTypeGeneration', kind: 'value', description: 'The generation of the event type.' },
28
- { name: 'tombstone', type: 'bool', kind: 'value', description: 'Whether the event is a tombstone event.' },
29
- ],
30
- 'EventSourceType': [
31
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
32
- ],
33
- 'EventSourceId': [
34
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
35
- ],
36
- 'EventStreamType': [
37
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
38
- ],
39
- 'EventStreamId': [
40
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
41
- ],
42
- 'EventSequenceNumber': [
43
- { name: 'value', type: 'ulong', kind: 'value', description: 'The underlying ulong value.' },
44
- ],
45
- 'DateTimeOffset': [
46
- { name: 'Week', type: 'int', kind: 'function', description: 'The ISO 8601 week of the year the value falls in.' },
47
- ],
48
- 'EventStoreName': [
49
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
50
- ],
51
- 'EventStoreNamespaceName': [
52
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
53
- ],
54
- 'CorrelationId': [
55
- { name: 'value', type: 'Guid', kind: 'value', description: 'The underlying Guid value.' },
56
- ],
57
- 'Identity': [
58
- { name: 'subject', type: 'string', kind: 'value', description: 'The subject identifier of the identity.' },
59
- { name: 'name', type: 'string', kind: 'value', description: 'The display name of the identity.' },
60
- { name: 'userName', type: 'string', kind: 'value', description: 'The user name of the identity.' },
61
- { name: 'onBehalfOf', type: 'Identity', kind: 'composite', description: 'The identity this identity acted on behalf of, if any - an identity with the same members.' },
62
- ],
63
- 'EventHash': [
64
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
65
- ],
66
- 'Subject': [
67
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
68
- ],
69
- 'EventTypeId': [
70
- { name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
71
- ],
72
- 'EventTypeGeneration': [
73
- { name: 'value', type: 'uint', kind: 'value', description: 'The underlying uint value.' },
74
- ],
75
- };
76
- // Every path the catalog lists, depth first in declaration order.
77
- export const eventContextPaths = [
78
- { path: 'eventType', name: 'eventType', type: 'EventType', kind: 'composite', description: 'The type of the event - its identifier, generation and whether it is a tombstone.' },
79
- { path: 'eventType.id', name: 'id', type: 'EventTypeId', kind: 'value', description: 'The identifier of the event type.' },
80
- { path: 'eventType.id.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
81
- { path: 'eventType.generation', name: 'generation', type: 'EventTypeGeneration', kind: 'value', description: 'The generation of the event type.' },
82
- { path: 'eventType.generation.value', name: 'value', type: 'uint', kind: 'value', description: 'The underlying uint value.' },
83
- { path: 'eventType.tombstone', name: 'tombstone', type: 'bool', kind: 'value', description: 'Whether the event is a tombstone event.' },
84
- { path: 'eventSourceType', name: 'eventSourceType', type: 'EventSourceType', kind: 'value', description: 'The type of the event source the event was appended to.' },
85
- { path: 'eventSourceType.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
86
- { path: 'eventSourceId', name: 'eventSourceId', type: 'EventSourceId', kind: 'value', description: 'The identifier of the event source the event was appended to - the value $eventSourceId resolves.' },
87
- { path: 'eventSourceId.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
88
- { path: 'eventStreamType', name: 'eventStreamType', type: 'EventStreamType', kind: 'value', description: 'The type of the event stream the event belongs to.' },
89
- { path: 'eventStreamType.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
90
- { path: 'eventStreamId', name: 'eventStreamId', type: 'EventStreamId', kind: 'value', description: 'The identifier of the event stream the event belongs to.' },
91
- { path: 'eventStreamId.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
92
- { path: 'sequenceNumber', name: 'sequenceNumber', type: 'EventSequenceNumber', kind: 'value', description: 'The position of the event in its event sequence.' },
93
- { path: 'sequenceNumber.value', name: 'value', type: 'ulong', kind: 'value', description: 'The underlying ulong value.' },
94
- { path: 'occurred', name: 'occurred', type: 'DateTimeOffset', kind: 'value', description: 'When the event occurred - the time it was appended unless one was given.' },
95
- { path: 'occurred.Week', name: 'Week', type: 'int', kind: 'function', description: 'The ISO 8601 week of the year the value falls in.' },
96
- { path: 'eventStore', name: 'eventStore', type: 'EventStoreName', kind: 'value', description: 'The name of the event store the event belongs to.' },
97
- { path: 'eventStore.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
98
- { path: 'namespace', name: 'namespace', type: 'EventStoreNamespaceName', kind: 'value', description: 'The namespace within the event store the event belongs to.' },
99
- { path: 'namespace.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
100
- { path: 'correlationId', name: 'correlationId', type: 'CorrelationId', kind: 'value', description: 'The correlation identifier the event was appended with.' },
101
- { path: 'correlationId.value', name: 'value', type: 'Guid', kind: 'value', description: 'The underlying Guid value.' },
102
- { path: 'causation', name: 'causation', type: 'IEnumerable<Causation>', kind: 'collection', description: 'The chain of causes that led to the event - a collection, not addressable below.' },
103
- { path: 'causedBy', name: 'causedBy', type: 'Identity', kind: 'composite', description: 'The identity that caused the event.' },
104
- { path: 'causedBy.subject', name: 'subject', type: 'string', kind: 'value', description: 'The subject identifier of the identity.' },
105
- { path: 'causedBy.name', name: 'name', type: 'string', kind: 'value', description: 'The display name of the identity.' },
106
- { path: 'causedBy.userName', name: 'userName', type: 'string', kind: 'value', description: 'The user name of the identity.' },
107
- { path: 'causedBy.onBehalfOf', name: 'onBehalfOf', type: 'Identity', kind: 'composite', description: 'The identity this identity acted on behalf of, if any - an identity with the same members.' },
108
- { path: 'tags', name: 'tags', type: 'IEnumerable<Tag>', kind: 'collection', description: 'The tags the event was appended with - a collection, not addressable below.' },
109
- { path: 'hash', name: 'hash', type: 'EventHash', kind: 'value', description: 'The hash of the event content.' },
110
- { path: 'hash.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
111
- { path: 'observationState', name: 'observationState', type: 'EventObservationState', kind: 'value', description: 'Whether the observer sees the event for the first time or again on replay - differs between live processing and replay.' },
112
- { path: 'subject', name: 'subject', type: 'Subject', kind: 'value', description: 'The compliance subject the event is about - the event source identifier unless one was given.' },
113
- { path: 'subject.value', name: 'value', type: 'string', kind: 'value', description: 'The underlying string value.' },
114
- { path: 'subjectIsEventSourceId', name: 'subjectIsEventSourceId', type: 'bool', kind: 'value', description: 'Whether the subject is the event source identifier.' },
115
- ];
116
- //# sourceMappingURL=event-context-catalog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-context-catalog.js","sourceRoot":"","sources":["../event-context-catalog.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAmBrG,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAEnD,sEAAsE;AACtE,MAAM,CAAC,MAAM,iBAAiB,GAA4D;IACtF,cAAc,EAAE;QACZ,EAAE,IAAI,EAAE,WAAW,EAAE,IA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AU,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,4FAA4F,EAAE;IACnM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,6EAA6E,EAAE;IACxK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,gCAAgC,EAAE;IAC/G,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE;IACjH,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,yHAAyH,EAAE;IAC5O,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,+FAA+F,EAAE;IAClL,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE;IACpH,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,qDAAqD,EAAE;CACtK,CAAC"}
@@ -1,88 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- // Reads the generated event-context catalog. Every editor surface that describes $eventContext - projection
4
- // completion and hover, and the host editor's context-variable docs and completions - goes through here, so
5
- // none of them carries a list of its own.
6
- import { eventContextPaths, eventContextRootType, eventContextTypes } from './event-context-catalog';
7
- export { eventContextPaths };
8
- /**
9
- * Whether a written path segment names a member. Mirrors EventContextMember.IsNamedBy in the compiler: a property
10
- * resolves camelCase or with only its first character uppercased; a function resolves by its exact name, with or
11
- * without parentheses.
12
- */
13
- export function namesEventContextMember(member, segment) {
14
- if (member.kind === 'function') {
15
- return segment === member.name || segment === `${member.name}()`;
16
- }
17
- const declared = member.name[0].toUpperCase() + member.name.slice(1);
18
- return segment === declared || (segment.length > 0 && segment[0].toUpperCase() + segment.slice(1) === declared);
19
- }
20
- /** The members of the event context itself - the first segment of every path. */
21
- export const eventContextMembers = eventContextTypes[eventContextRootType];
22
- /**
23
- * The members that may follow the given segments after `$eventContext.`, or undefined when the segments do not
24
- * resolve or stop at a collection or function, below which nothing is addressable.
25
- */
26
- export function eventContextMembersAfter(segments) {
27
- let members = eventContextMembers;
28
- for (const segment of segments) {
29
- const member = members.find((candidate) => namesEventContextMember(candidate, segment));
30
- if (!member || member.kind === 'collection' || member.kind === 'function') {
31
- return undefined;
32
- }
33
- members = eventContextTypes[member.type] ?? [];
34
- }
35
- return members;
36
- }
37
- /** The member the given segments name, or undefined when they do not resolve. */
38
- export function eventContextMemberAt(segments) {
39
- if (segments.length === 0) {
40
- return undefined;
41
- }
42
- const members = eventContextMembersAfter(segments.slice(0, -1));
43
- return members?.find((member) => namesEventContextMember(member, segments[segments.length - 1]));
44
- }
45
- /**
46
- * Resolves a path, as written after `$eventContext.`, the way EventContextCatalog.Resolve in the compiler does, so the
47
- * editor reports what the compiler reports.
48
- */
49
- export function resolveEventContextPath(path) {
50
- let current;
51
- let expected = eventContextMembers;
52
- for (const segment of path.split('.')) {
53
- if (segment.length === 0) {
54
- return { status: 'missing', member: current, expected };
55
- }
56
- if (current?.kind === 'collection') {
57
- return { status: 'belowCollection', member: current, segment, expected: [] };
58
- }
59
- const next = expected.find((member) => namesEventContextMember(member, segment));
60
- if (!next) {
61
- return { status: current ? 'unknownSubPath' : 'unknownMember', member: current, segment, expected };
62
- }
63
- current = next;
64
- expected = next.kind === 'function' ? [] : eventContextTypes[next.type] ?? [];
65
- }
66
- return { status: 'known', member: current, expected: [] };
67
- }
68
- /** Markdown describing $eventContext and its members, for hovers. */
69
- export function describeEventContext() {
70
- return [
71
- '**$eventContext**',
72
- '',
73
- 'Metadata about the event being projected. Paths are checked against the event-context catalog; `causation` and `tags` are collections and cannot be addressed below.',
74
- '',
75
- '**Members:**',
76
- ...eventContextMembers.map((member) => `- \`${member.name}\` (${member.type}) - ${member.description}`),
77
- ].join('\n');
78
- }
79
- /** Markdown describing one member of the event context, for hovers. */
80
- export function describeEventContextMember(path, member) {
81
- const below = member.kind === 'collection' || member.kind === 'function' ? [] : eventContextTypes[member.type] ?? [];
82
- const lines = [`**$eventContext.${path}**: \`${member.type}\``, '', member.description];
83
- if (below.length > 0) {
84
- lines.push('', `**Members:** ${below.map((child) => `\`${child.name}\``).join(', ')}`);
85
- }
86
- return lines.join('\n');
87
- }
88
- //# sourceMappingURL=event-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-context.js","sourceRoot":"","sources":["../event-context.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,4GAA4G;AAC5G,4GAA4G;AAC5G,0CAA0C;AAE1C,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGrG,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAG7B;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAA0B,EAAE,OAAe;IAC/E,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC7B,OAAO,OAAO,KAAK,MAAM,CAAC,IAAI,IAAI,OAAO,KAAK,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC;IACrE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,E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,qEAAqE;AACrE,MAAM,UAAU,oBAAoB;IAChC,OAAO;QACH,mBAAmB;QACnB,EAAE;QACF,sKAAsK;QACtK,EAAE;QACF,cAAc;QACd,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;KAC1G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,0BAA0B,CAAC,IAAY,EAAE,MAA0B;IAC/E,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,KAAK,YAAY,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrH,MAAM,KAAK,GAAG,CAAC,mBAAmB,IAAI,SAAS,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACxF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
@@ -1,58 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- import { fenceMap, indentOf } from './document-context';
4
- // The compiler's own shape for a file import (FileImportParser): a quoted operand without quotes or escapes.
5
- const fileImportPattern = /^import(\s+)"([^"\\]+)"\s*(?:\/\/.*)?$/;
6
- const quotedImportPattern = /^import\s+"/;
7
- // Whether a line imports files rather than a qualified name - its operand is quoted.
8
- export function isFileImportLine(line) {
9
- return quotedImportPattern.test(line.trim());
10
- }
11
- // The file import on a single line, or undefined when the line is not a well-formed one.
12
- export function fileImportOn(line, lineIndex) {
13
- const indent = indentOf(line);
14
- const match = line.slice(indent).match(fileImportPattern);
15
- if (!match)
16
- return undefined;
17
- const startColumn = indent + 'import'.length + match[1].length + 2;
18
- return { pattern: match[2], line: lineIndex, startColumn, endColumn: startColumn + match[2].length };
19
- }
20
- // Every well-formed file import in a document, in document order, skipping code fences.
21
- export function fileImports(lines) {
22
- const fences = fenceMap(lines);
23
- const found = [];
24
- for (let index = 0; index < lines.length; index++) {
25
- if (fences[index])
26
- continue;
27
- const fileImport = fileImportOn(lines[index], index);
28
- if (fileImport)
29
- found.push(fileImport);
30
- }
31
- return found;
32
- }
33
- const folderOf = (path) => path.split('/').slice(0, -1);
34
- function relativeTo(from, path) {
35
- const segments = path.split('/');
36
- let common = 0;
37
- while (common < from.length && common < segments.length - 1 && from[common] === segments[common])
38
- common++;
39
- return [...from.slice(common).map(() => '..'), ...segments.slice(common)].join('/');
40
- }
41
- // What an import written in a document can name: every other .play file, relative to the document's folder;
42
- // a glob for the files directly in each folder holding one; and a glob for everything beneath each folder on
43
- // the way to them. Paths are portable ('/' separated) and relative to one root, the way the compiler resolves them.
44
- export function importablePaths(documentPath, files) {
45
- const from = folderOf(documentPath);
46
- const paths = new Set();
47
- for (const file of files.filter((candidate) => candidate !== documentPath && candidate.toLowerCase().endsWith('.play'))) {
48
- const relative = relativeTo(from, file);
49
- const folders = folderOf(relative);
50
- paths.add(relative);
51
- paths.add([...folders, '*.play'].join('/'));
52
- for (let depth = 0; depth <= folders.length; depth++) {
53
- paths.add([...folders.slice(0, depth), '**', '*.play'].join('/'));
54
- }
55
- }
56
- return [...paths].sort();
57
- }
58
- //# sourceMappingURL=file-imports.js.map
@@ -1 +0,0 @@
1
- {"version":3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,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACtH,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpB,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YACnD,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACtE,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7B,CAAC"}
@@ -1,70 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- import { fenceMap, firstWord, indentOf } from './document-context';
4
- // The keyword the directive opens with — the single word the language points at a file with.
5
- export const fileReferenceKeyword = 'file';
6
- // `file String` is a property named `file`; `file Invoices/Register.cs` is the directive. The two are
7
- // told apart by shape, the way the compiler tells them apart: a type reference is a bare identifier,
8
- // so anything carrying a separator or an extension is a path and nothing else. The property wins the
9
- // tie, because a document that used the name before the directive existed keeps meaning what it meant.
10
- const typeReferencePattern = /^[A-Za-z_]\w*(?:\[\])?\??$/;
11
- // A path naming a place on one machine rather than a place in the repository. The compiler warns about
12
- // these; nothing here rejects one, so a resolver can still probe it and come up empty on other machines.
13
- const absolutePathPattern = /^(?:[/\\]|[A-Za-z]:[/\\]|~[/\\])/;
14
- export function isAbsoluteFileReferencePath(path) {
15
- return absolutePathPattern.test(path);
16
- }
17
- // Drops a trailing `//` comment without cutting into a string or a template, mirroring how the
18
- // compiler strips one before it reads the line.
19
- function withoutComment(text) {
20
- let inString = false;
21
- let inTemplate = false;
22
- for (let index = 0; index < text.length; index++) {
23
- const current = text[index];
24
- if (current === '\\' && inString && index + 1 < text.length) {
25
- index++;
26
- }
27
- else if (current === '"' && !inTemplate) {
28
- inString = !inString;
29
- }
30
- else if (current === '`' && !inString) {
31
- inTemplate = !inTemplate;
32
- }
33
- else if (!inString && !inTemplate && current === '/' && text[index + 1] === '/') {
34
- return text.slice(0, index);
35
- }
36
- }
37
- return text;
38
- }
39
- // The `file` directive on a single line, or undefined when the line is not one. Callers that scan a
40
- // whole document go through fileReferences instead, so code fences are accounted for.
41
- export function fileReferenceOn(line, lineIndex) {
42
- const indent = indentOf(line);
43
- const content = withoutComment(line.slice(indent)).trimEnd();
44
- if (firstWord(content) !== fileReferenceKeyword)
45
- return undefined;
46
- const afterKeyword = content.slice(fileReferenceKeyword.length);
47
- const path = afterKeyword.trim();
48
- // A bare `file` leaves the word available as a name to whatever the enclosing block reads a bare
49
- // word as, and a bare identifier after it is a property type rather than a path.
50
- if (path.length === 0 || typeReferencePattern.test(path))
51
- return undefined;
52
- const separatorLength = afterKeyword.length - afterKeyword.trimStart().length;
53
- const startColumn = indent + fileReferenceKeyword.length + separatorLength + 1;
54
- return { path, line: lineIndex, startColumn, endColumn: startColumn + path.length };
55
- }
56
- // Every `file` directive in a document, in document order. Lines inside a code fence are skipped, so
57
- // a `file` line in an inline C# or TypeScript block is never mistaken for one of ours.
58
- export function fileReferences(lines) {
59
- const fences = fenceMap(lines);
60
- const references = [];
61
- for (let index = 0; index < lines.length; index++) {
62
- if (fences[index])
63
- continue;
64
- const reference = fileReferenceOn(lines[index], index);
65
- if (reference)
66
- references.push(reference);
67
- }
68
- return references;
69
- }
70
- //# sourceMappingURL=file-references.js.map
@@ -1 +0,0 @@
1
- {"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