@cratis/screenplay-language 4.54.0 → 4.55.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.
@@ -19,9 +19,13 @@ import {
19
19
  fenceMap,
20
20
  fileImportOn,
21
21
  fileImports,
22
+ fileReferenceKeyword,
23
+ fileReferenceOn,
24
+ fileReferences,
22
25
  firstWord,
23
26
  importablePaths,
24
27
  indentOf,
28
+ isAbsoluteFileReferencePath,
25
29
  isFileImportLine,
26
30
  isQuickFixDiagnostic,
27
31
  knownEventNames,
@@ -42,7 +46,7 @@ import {
42
46
  typeReferenceSymbol,
43
47
  typeReferenceText,
44
48
  validateLines
45
- } from "./chunk-GJX4NJYC.js";
49
+ } from "./chunk-LXM5L4YK.js";
46
50
 
47
51
  // tokens.ts
48
52
  var embeddedLanguages = {
@@ -1283,52 +1287,6 @@ var screenplayLight = {
1283
1287
  }
1284
1288
  };
1285
1289
 
1286
- // file-references.ts
1287
- var fileReferenceKeyword = "file";
1288
- var typeReferencePattern = /^[A-Za-z_]\w*(?:\[\])?(?:\?|\s+optional)?$/;
1289
- var absolutePathPattern = /^(?:[/\\]|[A-Za-z]:[/\\]|~[/\\])/;
1290
- function isAbsoluteFileReferencePath(path) {
1291
- return absolutePathPattern.test(path);
1292
- }
1293
- function withoutComment(text) {
1294
- let inString = false;
1295
- let inTemplate = false;
1296
- for (let index = 0; index < text.length; index++) {
1297
- const current = text[index];
1298
- if (current === "\\" && inString && index + 1 < text.length) {
1299
- index++;
1300
- } else if (current === '"' && !inTemplate) {
1301
- inString = !inString;
1302
- } else if (current === "`" && !inString) {
1303
- inTemplate = !inTemplate;
1304
- } else if (!inString && !inTemplate && current === "/" && text[index + 1] === "/") {
1305
- return text.slice(0, index);
1306
- }
1307
- }
1308
- return text;
1309
- }
1310
- function fileReferenceOn(line, lineIndex) {
1311
- const indent = indentOf(line);
1312
- const content = withoutComment(line.slice(indent)).trimEnd();
1313
- if (firstWord(content) !== fileReferenceKeyword) return void 0;
1314
- const afterKeyword = content.slice(fileReferenceKeyword.length);
1315
- const path = afterKeyword.trim();
1316
- if (path.length === 0 || typeReferencePattern.test(path)) return void 0;
1317
- const separatorLength = afterKeyword.length - afterKeyword.trimStart().length;
1318
- const startColumn = indent + fileReferenceKeyword.length + separatorLength + 1;
1319
- return { path, line: lineIndex, startColumn, endColumn: startColumn + path.length };
1320
- }
1321
- function fileReferences(lines) {
1322
- const fences = fenceMap(lines);
1323
- const references = [];
1324
- for (let index = 0; index < lines.length; index++) {
1325
- if (fences[index]) continue;
1326
- const reference = fileReferenceOn(lines[index], index);
1327
- if (reference) references.push(reference);
1328
- }
1329
- return references;
1330
- }
1331
-
1332
1290
  // index.ts
1333
1291
  var registeredInstances = /* @__PURE__ */ new Set();
1334
1292
  function applyTokensProvider(monaco) {