@effect/language-service 0.38.2 → 0.38.4
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 +1 -1
- package/cli.js +15 -4
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +32 -12
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +33 -13
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +32 -12
- package/transform.js.map +1 -1
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ And you're done! You'll now be able to use a set of refactors and diagnostics th
|
|
|
79
79
|
- Transform an async function definition, into an Effect by using Effect.fn.
|
|
80
80
|
- Transform an async function definition, into an Effect by using Effect.fn, and generating a tagged error for each promise call.
|
|
81
81
|
- Transform a function returning an Effect.gen into a Effect.fn
|
|
82
|
-
- Implement Service accessors in an `Effect.Service` or `
|
|
82
|
+
- Implement Service accessors in an `Effect.Service`, `Context.Tag` or `Effect.Tag` declaration
|
|
83
83
|
- Function calls to pipe: Transform a set of function calls to a pipe() call.
|
|
84
84
|
- Pipe to datafirst: Transform a pipe() call into a series of datafirst function calls (where available).
|
|
85
85
|
- Toggle return type signature: With a single refactor, adds or removes type annotations from the definition.
|
package/cli.js
CHANGED
|
@@ -29138,10 +29138,10 @@ function makeTypeScriptUtils(ts4) {
|
|
|
29138
29138
|
if (!hasProperty(packageJsonScope.contents, "packageJsonContent")) return;
|
|
29139
29139
|
const packageJsonContent = packageJsonScope.contents.packageJsonContent;
|
|
29140
29140
|
if (!hasProperty(packageJsonContent, "name")) return;
|
|
29141
|
-
if (!hasProperty(packageJsonContent, "version")) return;
|
|
29142
29141
|
if (!hasProperty(packageJsonScope, "packageDirectory")) return;
|
|
29143
29142
|
if (!isString(packageJsonScope.packageDirectory)) return;
|
|
29144
|
-
const { name
|
|
29143
|
+
const { name } = packageJsonContent;
|
|
29144
|
+
const version = hasProperty(packageJsonScope, "version") ? packageJsonScope.version : "";
|
|
29145
29145
|
if (!isString(name)) return;
|
|
29146
29146
|
if (!isString(version)) return;
|
|
29147
29147
|
const hasEffectInPeerDependencies = hasProperty(packageJsonContent, "peerDependencies") && isObject(packageJsonContent.peerDependencies) && hasProperty(packageJsonContent.peerDependencies, "effect");
|
|
@@ -29163,9 +29163,20 @@ function makeTypeScriptUtils(ts4) {
|
|
|
29163
29163
|
exportsKeys
|
|
29164
29164
|
};
|
|
29165
29165
|
}
|
|
29166
|
-
function resolveModulePattern(sourceFile, pattern2) {
|
|
29166
|
+
function resolveModulePattern(program, sourceFile, pattern2) {
|
|
29167
29167
|
if (pattern2.indexOf("*") === -1) return [pattern2.toLowerCase()];
|
|
29168
|
-
|
|
29168
|
+
let packageJsonScope = parsePackageContentNameAndVersionFromScope(sourceFile);
|
|
29169
|
+
if (!packageJsonScope && hasProperty(ts4, "getPackageScopeForPath") && isFunction2(ts4.getPackageScopeForPath) && hasProperty(ts4, "getTemporaryModuleResolutionState") && isFunction2(ts4.getTemporaryModuleResolutionState) && hasProperty(ts4, "getPackageScopeForPath") && isFunction2(ts4.getPackageScopeForPath)) {
|
|
29170
|
+
const temporaryModuleResolutionState = ts4.getTemporaryModuleResolutionState(
|
|
29171
|
+
void 0,
|
|
29172
|
+
program,
|
|
29173
|
+
program.getCompilerOptions()
|
|
29174
|
+
);
|
|
29175
|
+
packageJsonScope = parsePackageContentNameAndVersionFromScope({
|
|
29176
|
+
...sourceFile,
|
|
29177
|
+
packageJsonScope: ts4.getPackageScopeForPath(sourceFile.fileName, temporaryModuleResolutionState)
|
|
29178
|
+
});
|
|
29179
|
+
}
|
|
29169
29180
|
const referencedPackages = [];
|
|
29170
29181
|
for (const statement of sourceFile.statements) {
|
|
29171
29182
|
if (ts4.isImportDeclaration(statement) && ts4.isStringLiteral(statement.moduleSpecifier)) {
|