@effect/language-service 0.31.2 → 0.33.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 +6 -2
- package/cli.js +30 -10
- package/cli.js.map +1 -1
- package/index.js +150 -19
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +30 -10
- package/transform.js.map +1 -1
package/package.json
CHANGED
package/transform.js
CHANGED
|
@@ -1116,16 +1116,34 @@ function parseDiagnosticSeverity(config) {
|
|
|
1116
1116
|
)
|
|
1117
1117
|
);
|
|
1118
1118
|
}
|
|
1119
|
+
var defaults = {
|
|
1120
|
+
refactors: true,
|
|
1121
|
+
diagnostics: true,
|
|
1122
|
+
diagnosticSeverity: {},
|
|
1123
|
+
quickinfo: true,
|
|
1124
|
+
quickinfoEffectParameters: "whentruncated",
|
|
1125
|
+
completions: true,
|
|
1126
|
+
goto: true,
|
|
1127
|
+
inlays: true,
|
|
1128
|
+
allowedDuplicatedPackages: [],
|
|
1129
|
+
namespaceImportPackages: [],
|
|
1130
|
+
barrelImportPackages: [],
|
|
1131
|
+
topLevelNamedReexports: "ignore"
|
|
1132
|
+
};
|
|
1119
1133
|
function parse(config) {
|
|
1120
1134
|
return {
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1135
|
+
refactors: isObject(config) && hasProperty(config, "refactors") && isBoolean(config.refactors) ? config.refactors : defaults.refactors,
|
|
1136
|
+
diagnostics: isObject(config) && hasProperty(config, "diagnostics") && isBoolean(config.diagnostics) ? config.diagnostics : defaults.diagnostics,
|
|
1137
|
+
diagnosticSeverity: isObject(config) && hasProperty(config, "diagnosticSeverity") && isRecord(config.diagnosticSeverity) ? parseDiagnosticSeverity(config.diagnosticSeverity) : defaults.diagnosticSeverity,
|
|
1138
|
+
quickinfo: isObject(config) && hasProperty(config, "quickinfo") && isBoolean(config.quickinfo) ? config.quickinfo : defaults.quickinfo,
|
|
1139
|
+
quickinfoEffectParameters: isObject(config) && hasProperty(config, "quickinfoEffectParameters") && isString(config.quickinfoEffectParameters) && ["always", "never", "whentruncated"].includes(config.quickinfoEffectParameters.toLowerCase()) ? config.quickinfoEffectParameters.toLowerCase() : defaults.quickinfoEffectParameters,
|
|
1140
|
+
completions: isObject(config) && hasProperty(config, "completions") && isBoolean(config.completions) ? config.completions : defaults.completions,
|
|
1141
|
+
goto: isObject(config) && hasProperty(config, "goto") && isBoolean(config.goto) ? config.goto : defaults.goto,
|
|
1142
|
+
inlays: isObject(config) && hasProperty(config, "inlays") && isBoolean(config.inlays) ? config.inlays : defaults.inlays,
|
|
1143
|
+
allowedDuplicatedPackages: isObject(config) && hasProperty(config, "allowedDuplicatedPackages") && isArray(config.allowedDuplicatedPackages) && config.allowedDuplicatedPackages.every(isString) ? config.allowedDuplicatedPackages.map((_) => _.toLowerCase()) : defaults.allowedDuplicatedPackages,
|
|
1144
|
+
namespaceImportPackages: isObject(config) && hasProperty(config, "namespaceImportPackages") && isArray(config.namespaceImportPackages) && config.namespaceImportPackages.every(isString) ? config.namespaceImportPackages.map((_) => _.toLowerCase()) : defaults.namespaceImportPackages,
|
|
1145
|
+
barrelImportPackages: isObject(config) && hasProperty(config, "barrelImportPackages") && isArray(config.barrelImportPackages) && config.barrelImportPackages.every(isString) ? config.barrelImportPackages.map((_) => _.toLowerCase()) : defaults.barrelImportPackages,
|
|
1146
|
+
topLevelNamedReexports: isObject(config) && hasProperty(config, "topLevelNamedReexports") && isString(config.topLevelNamedReexports) && ["ignore", "follow"].includes(config.topLevelNamedReexports.toLowerCase()) ? config.topLevelNamedReexports.toLowerCase() : defaults.topLevelNamedReexports
|
|
1129
1147
|
};
|
|
1130
1148
|
}
|
|
1131
1149
|
|
|
@@ -3156,9 +3174,11 @@ var floatingEffect = createDiagnostic({
|
|
|
3156
3174
|
option
|
|
3157
3175
|
);
|
|
3158
3176
|
if (isNone2(allowedFloatingEffects)) {
|
|
3177
|
+
const isStrictEffect = yield* option(typeParser.strictEffectType(type, node.expression));
|
|
3178
|
+
const name = isSome2(isStrictEffect) ? "Effect" : "Effect-able " + typeChecker.typeToString(type);
|
|
3159
3179
|
report({
|
|
3160
3180
|
location: node,
|
|
3161
|
-
messageText:
|
|
3181
|
+
messageText: `${name} must be yielded or assigned to a variable.`,
|
|
3162
3182
|
fixes: []
|
|
3163
3183
|
});
|
|
3164
3184
|
}
|
|
@@ -3785,7 +3805,7 @@ var missingReturnYieldStar = createDiagnostic({
|
|
|
3785
3805
|
}] : [];
|
|
3786
3806
|
report({
|
|
3787
3807
|
location: node,
|
|
3788
|
-
messageText: `
|
|
3808
|
+
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.`,
|
|
3789
3809
|
fixes: fix
|
|
3790
3810
|
});
|
|
3791
3811
|
}
|