@effect/language-service 0.31.2 → 0.32.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 +2 -1
- package/cli.js +6 -3
- package/cli.js.map +1 -1
- package/index.js +48 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +6 -3
- package/transform.js.map +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,8 @@ Few options can be provided alongside the initialization of the Language Service
|
|
|
99
99
|
"goto": true, // controls Effect goto references (default: true)
|
|
100
100
|
"allowedDuplicatedPackages": [], // list of package names that have effect in peer dependencies and are allowed to be duplicated (default: [])
|
|
101
101
|
"barrelImportPackages": [], // package names that should be preferred as imported from the top level barrel file (default: [])
|
|
102
|
-
"namespaceImportPackages": [] // package names that should be preferred as imported with namespace imports e.g. ["effect", "@effect/*"] (default: [])
|
|
102
|
+
"namespaceImportPackages": [], // package names that should be preferred as imported with namespace imports e.g. ["effect", "@effect/*"] (default: [])
|
|
103
|
+
"topLevelNamedReexports": "ignore" // for namespaceImportPackages, how should top level named re-exports (e.g. {pipe} from "effect") be treated? "ignore" will leave them as is, "follow" will rewrite them to the re-exported module (e.g. {pipe} from "effect/Function")
|
|
103
104
|
}
|
|
104
105
|
]
|
|
105
106
|
}
|
package/cli.js
CHANGED
|
@@ -28786,7 +28786,8 @@ function parse4(config2) {
|
|
|
28786
28786
|
goto: isObject(config2) && hasProperty(config2, "goto") && isBoolean(config2.goto) ? config2.goto : true,
|
|
28787
28787
|
allowedDuplicatedPackages: isObject(config2) && hasProperty(config2, "allowedDuplicatedPackages") && isArray(config2.allowedDuplicatedPackages) && config2.allowedDuplicatedPackages.every(isString) ? config2.allowedDuplicatedPackages.map((_) => _.toLowerCase()) : [],
|
|
28788
28788
|
namespaceImportPackages: isObject(config2) && hasProperty(config2, "namespaceImportPackages") && isArray(config2.namespaceImportPackages) && config2.namespaceImportPackages.every(isString) ? config2.namespaceImportPackages.map((_) => _.toLowerCase()) : [],
|
|
28789
|
-
barrelImportPackages: isObject(config2) && hasProperty(config2, "barrelImportPackages") && isArray(config2.barrelImportPackages) && config2.barrelImportPackages.every(isString) ? config2.barrelImportPackages.map((_) => _.toLowerCase()) : []
|
|
28789
|
+
barrelImportPackages: isObject(config2) && hasProperty(config2, "barrelImportPackages") && isArray(config2.barrelImportPackages) && config2.barrelImportPackages.every(isString) ? config2.barrelImportPackages.map((_) => _.toLowerCase()) : [],
|
|
28790
|
+
topLevelNamedReexports: isObject(config2) && hasProperty(config2, "topLevelNamedReexports") && isString(config2.topLevelNamedReexports) && (config2.topLevelNamedReexports.toLowerCase() === "ignore" || config2.topLevelNamedReexports.toLowerCase() === "follow") ? config2.topLevelNamedReexports.toLowerCase() : "ignore"
|
|
28790
28791
|
};
|
|
28791
28792
|
}
|
|
28792
28793
|
|
|
@@ -30817,9 +30818,11 @@ var floatingEffect = createDiagnostic({
|
|
|
30817
30818
|
option4
|
|
30818
30819
|
);
|
|
30819
30820
|
if (isNone2(allowedFloatingEffects)) {
|
|
30821
|
+
const isStrictEffect = yield* option4(typeParser.strictEffectType(type2, node.expression));
|
|
30822
|
+
const name = isSome2(isStrictEffect) ? "Effect" : "Effect-able " + typeChecker.typeToString(type2);
|
|
30820
30823
|
report({
|
|
30821
30824
|
location: node,
|
|
30822
|
-
messageText:
|
|
30825
|
+
messageText: `${name} must be yielded or assigned to a variable.`,
|
|
30823
30826
|
fixes: []
|
|
30824
30827
|
});
|
|
30825
30828
|
}
|
|
@@ -31446,7 +31449,7 @@ var missingReturnYieldStar = createDiagnostic({
|
|
|
31446
31449
|
}] : [];
|
|
31447
31450
|
report({
|
|
31448
31451
|
location: node,
|
|
31449
|
-
messageText: `
|
|
31452
|
+
messageText: `It is recommended to use return yield* for Effects that never succeed to signal a definitive exit point for type narrowing and tooling support.`,
|
|
31450
31453
|
fixes: fix
|
|
31451
31454
|
});
|
|
31452
31455
|
}
|