@effect/language-service 0.40.0 → 0.40.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.
- package/cli.js +77 -35
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +5 -2
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +50 -36
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +5 -2
- package/transform.js.map +1 -1
package/index.js
CHANGED
|
@@ -3499,7 +3499,10 @@ var generate = fn("writeTagClassAccessors.generate")(function* (sourceFile, serv
|
|
|
3499
3499
|
]
|
|
3500
3500
|
);
|
|
3501
3501
|
return ts.factory.createPropertyDeclaration(
|
|
3502
|
-
[
|
|
3502
|
+
[
|
|
3503
|
+
ts.factory.createModifier(ts.SyntaxKind.StaticKeyword),
|
|
3504
|
+
ts.factory.createModifier(ts.SyntaxKind.OverrideKeyword)
|
|
3505
|
+
],
|
|
3503
3506
|
propertyName,
|
|
3504
3507
|
void 0,
|
|
3505
3508
|
type,
|
|
@@ -3865,7 +3868,7 @@ var classSelfMismatch = createDiagnostic({
|
|
|
3865
3868
|
);
|
|
3866
3869
|
if (result) {
|
|
3867
3870
|
const { className, selfTypeNode } = result;
|
|
3868
|
-
let actualName =
|
|
3871
|
+
let actualName = sourceFile.text.substring(selfTypeNode.pos, selfTypeNode.end);
|
|
3869
3872
|
if (ts.isTypeReferenceNode(selfTypeNode)) {
|
|
3870
3873
|
if (ts.isIdentifier(selfTypeNode.typeName)) {
|
|
3871
3874
|
actualName = ts.idText(selfTypeNode.typeName);
|
|
@@ -13694,45 +13697,56 @@ var init = (modules) => {
|
|
|
13694
13697
|
}
|
|
13695
13698
|
return applicableRenameInfo;
|
|
13696
13699
|
};
|
|
13697
|
-
|
|
13698
|
-
|
|
13699
|
-
|
|
13700
|
-
|
|
13701
|
-
|
|
13702
|
-
|
|
13703
|
-
|
|
13704
|
-
|
|
13705
|
-
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
response
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13700
|
+
const additionalProtocolHandlers = {
|
|
13701
|
+
"_effectGetLayerMermaid": (arg) => {
|
|
13702
|
+
const { character, line, path } = arg.arguments;
|
|
13703
|
+
const normalizedPath = modules.typescript.server.toNormalizedPath(path);
|
|
13704
|
+
const projectService = info.project.projectService;
|
|
13705
|
+
const scriptInfo = projectService.getScriptInfoForNormalizedPath(normalizedPath);
|
|
13706
|
+
if (scriptInfo) {
|
|
13707
|
+
const targetProject = scriptInfo.getDefaultProject();
|
|
13708
|
+
if (targetProject) {
|
|
13709
|
+
const program = targetProject.getLanguageService().getProgram();
|
|
13710
|
+
if (program) {
|
|
13711
|
+
const sourceFile = targetProject.getSourceFile(scriptInfo.path);
|
|
13712
|
+
if (sourceFile) {
|
|
13713
|
+
return pipe(
|
|
13714
|
+
effectApiGetLayerGraph(sourceFile, line, character),
|
|
13715
|
+
map3((response) => ({
|
|
13716
|
+
response: {
|
|
13717
|
+
success: true,
|
|
13718
|
+
...response
|
|
13719
|
+
}
|
|
13720
|
+
})),
|
|
13721
|
+
runNano(program),
|
|
13722
|
+
getOrElse((e) => ({
|
|
13723
|
+
response: {
|
|
13724
|
+
success: false,
|
|
13725
|
+
error: e.message
|
|
13726
|
+
}
|
|
13727
|
+
}))
|
|
13728
|
+
);
|
|
13729
|
+
}
|
|
13725
13730
|
}
|
|
13726
13731
|
}
|
|
13727
13732
|
}
|
|
13733
|
+
return {
|
|
13734
|
+
response: {
|
|
13735
|
+
success: false,
|
|
13736
|
+
error: "No source file found"
|
|
13737
|
+
}
|
|
13738
|
+
};
|
|
13728
13739
|
}
|
|
13729
|
-
|
|
13730
|
-
|
|
13731
|
-
|
|
13732
|
-
|
|
13740
|
+
};
|
|
13741
|
+
if (info.session) {
|
|
13742
|
+
for (const [key, value] of Object.entries(additionalProtocolHandlers)) {
|
|
13743
|
+
try {
|
|
13744
|
+
info.session.addProtocolHandler(key, value);
|
|
13745
|
+
} catch (e) {
|
|
13746
|
+
info.project.log("[@effect/language-service] Skipped adding " + key + " protocol handler due to error: " + e);
|
|
13733
13747
|
}
|
|
13734
|
-
}
|
|
13735
|
-
}
|
|
13748
|
+
}
|
|
13749
|
+
}
|
|
13736
13750
|
return proxy;
|
|
13737
13751
|
}
|
|
13738
13752
|
return { create, onConfigurationChanged };
|