@cratis/screenplay-language 4.53.0 → 4.54.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.
- package/README.md +15 -0
- package/dist/bundles/{chunk-7WJEZ72S.js → chunk-GJX4NJYC.js} +464 -91
- package/dist/bundles/chunk-GJX4NJYC.js.map +7 -0
- package/dist/bundles/index.js +12 -5
- package/dist/bundles/index.js.map +2 -2
- package/dist/bundles/sub-languages/projection/index.js +1 -1
- package/dist/code-actions.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/bundles/chunk-7WJEZ72S.js.map +0 -7
package/dist/bundles/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
importablePaths,
|
|
24
24
|
indentOf,
|
|
25
25
|
isFileImportLine,
|
|
26
|
+
isQuickFixDiagnostic,
|
|
26
27
|
knownEventNames,
|
|
27
28
|
knownTriggerNames,
|
|
28
29
|
knownTypeNames,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
typeReferenceSymbol,
|
|
42
43
|
typeReferenceText,
|
|
43
44
|
validateLines
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-GJX4NJYC.js";
|
|
45
46
|
|
|
46
47
|
// tokens.ts
|
|
47
48
|
var embeddedLanguages = {
|
|
@@ -999,13 +1000,14 @@ function createCodeActionProvider(placement) {
|
|
|
999
1000
|
return {
|
|
1000
1001
|
provideCodeActions(model, range, context, token) {
|
|
1001
1002
|
const migrationRequested = context.only !== void 0 && containsKind(context.only, migrateOptional);
|
|
1003
|
+
const migrationOnly = context.only !== void 0 && migrationRequested && !containsKind(context.only, "quickfix");
|
|
1002
1004
|
if (token.isCancellationRequested || context.only !== void 0 && !migrationRequested && !containsKind(context.only, "quickfix")) return { actions: [], dispose() {
|
|
1003
1005
|
} };
|
|
1004
|
-
const
|
|
1006
|
+
const diagnostics = context.markers.filter((marker) => {
|
|
1005
1007
|
const code = typeof marker.code === "object" ? marker.code.value : marker.code;
|
|
1006
|
-
return code
|
|
1008
|
+
return isQuickFixDiagnostic(code) && intersects(marker, range);
|
|
1007
1009
|
});
|
|
1008
|
-
if (!migrationRequested &&
|
|
1010
|
+
if (!migrationRequested && diagnostics.length === 0) return { actions: [], dispose() {
|
|
1009
1011
|
} };
|
|
1010
1012
|
const version = model.getVersionId();
|
|
1011
1013
|
const placementKey = JSON.stringify(placement) ?? "";
|
|
@@ -1014,7 +1016,12 @@ function createCodeActionProvider(placement) {
|
|
|
1014
1016
|
analysis = { version, placement: placementKey, fixes: prepareQuickFixes(model.getValue(), { placement }) };
|
|
1015
1017
|
cache.set(model, analysis);
|
|
1016
1018
|
}
|
|
1017
|
-
const
|
|
1019
|
+
const occurrences = migrationOnly ? [] : analysis.fixes(diagnostics.map((diagnostic) => ({
|
|
1020
|
+
line: diagnostic.startLineNumber,
|
|
1021
|
+
diagnosticCode: String(typeof diagnostic.code === "object" ? diagnostic.code.value : diagnostic.code)
|
|
1022
|
+
}))).filter((fix) => fix.scope === "occurrence");
|
|
1023
|
+
const requested = [...occurrences, ...context.only === void 0 || migrationRequested ? analysis.fixes(void 0, DiagnosticCodes.LegacyOptionalSuffix) : []];
|
|
1024
|
+
const fixes = requested.filter((fix) => context.only === void 0 || containsKind(context.only, fix.scope === "document" ? migrateOptional : "quickfix"));
|
|
1018
1025
|
if (token.isCancellationRequested || model.getVersionId() !== version) return { actions: [], dispose() {
|
|
1019
1026
|
} };
|
|
1020
1027
|
return {
|