@effect/language-service 0.84.1 → 0.84.2
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 +33 -1
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +32 -0
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +32 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +32 -0
- package/transform.js.map +1 -1
package/package.json
CHANGED
package/transform.js
CHANGED
|
@@ -3118,10 +3118,42 @@ function makeTypeCheckerUtils(ts, typeChecker, tsUtils) {
|
|
|
3118
3118
|
if (node.parent && ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node) return;
|
|
3119
3119
|
if (node.parent && ts.isJsxClosingElement(node.parent) && node.parent.tagName === node) return;
|
|
3120
3120
|
if (node.parent && ts.isJsxAttribute(node.parent) && node.parent.name === node) return;
|
|
3121
|
+
if (isInsideTypeOnlyHeritageExpression(node)) return;
|
|
3121
3122
|
if (ts.isExpression(node) || ts.isTypeNode(node)) {
|
|
3122
3123
|
return typeChecker.getTypeAtLocation(node);
|
|
3123
3124
|
}
|
|
3124
3125
|
}
|
|
3126
|
+
function isInsideTypeOnlyHeritageExpression(node) {
|
|
3127
|
+
if (ts.isExpressionWithTypeArguments(node)) {
|
|
3128
|
+
return isTypeOnlyHeritageClause(node.parent);
|
|
3129
|
+
}
|
|
3130
|
+
if (!ts.isIdentifier(node) && !ts.isPropertyAccessExpression(node)) {
|
|
3131
|
+
return false;
|
|
3132
|
+
}
|
|
3133
|
+
for (let current = node.parent; current; current = current.parent) {
|
|
3134
|
+
if (ts.isPropertyAccessExpression(current)) {
|
|
3135
|
+
continue;
|
|
3136
|
+
}
|
|
3137
|
+
if (ts.isExpressionWithTypeArguments(current)) {
|
|
3138
|
+
return isTypeOnlyHeritageClause(current.parent);
|
|
3139
|
+
}
|
|
3140
|
+
return false;
|
|
3141
|
+
}
|
|
3142
|
+
return false;
|
|
3143
|
+
}
|
|
3144
|
+
function isTypeOnlyHeritageClause(node) {
|
|
3145
|
+
if (!node || !ts.isHeritageClause(node)) {
|
|
3146
|
+
return false;
|
|
3147
|
+
}
|
|
3148
|
+
const container = node.parent;
|
|
3149
|
+
if (!container) {
|
|
3150
|
+
return false;
|
|
3151
|
+
}
|
|
3152
|
+
if (ts.isInterfaceDeclaration(container)) {
|
|
3153
|
+
return true;
|
|
3154
|
+
}
|
|
3155
|
+
return ts.isClassLike(container) && node.token === ts.SyntaxKind.ImplementsKeyword;
|
|
3156
|
+
}
|
|
3125
3157
|
function resolveToGlobalSymbol(symbol3) {
|
|
3126
3158
|
if (symbol3.flags & ts.SymbolFlags.Alias) {
|
|
3127
3159
|
symbol3 = typeChecker.getAliasedSymbol(symbol3);
|