@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/index.js CHANGED
@@ -3771,10 +3771,42 @@ function makeTypeCheckerUtils(ts, typeChecker, tsUtils) {
3771
3771
  if (node.parent && ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node) return;
3772
3772
  if (node.parent && ts.isJsxClosingElement(node.parent) && node.parent.tagName === node) return;
3773
3773
  if (node.parent && ts.isJsxAttribute(node.parent) && node.parent.name === node) return;
3774
+ if (isInsideTypeOnlyHeritageExpression(node)) return;
3774
3775
  if (ts.isExpression(node) || ts.isTypeNode(node)) {
3775
3776
  return typeChecker.getTypeAtLocation(node);
3776
3777
  }
3777
3778
  }
3779
+ function isInsideTypeOnlyHeritageExpression(node) {
3780
+ if (ts.isExpressionWithTypeArguments(node)) {
3781
+ return isTypeOnlyHeritageClause(node.parent);
3782
+ }
3783
+ if (!ts.isIdentifier(node) && !ts.isPropertyAccessExpression(node)) {
3784
+ return false;
3785
+ }
3786
+ for (let current = node.parent; current; current = current.parent) {
3787
+ if (ts.isPropertyAccessExpression(current)) {
3788
+ continue;
3789
+ }
3790
+ if (ts.isExpressionWithTypeArguments(current)) {
3791
+ return isTypeOnlyHeritageClause(current.parent);
3792
+ }
3793
+ return false;
3794
+ }
3795
+ return false;
3796
+ }
3797
+ function isTypeOnlyHeritageClause(node) {
3798
+ if (!node || !ts.isHeritageClause(node)) {
3799
+ return false;
3800
+ }
3801
+ const container = node.parent;
3802
+ if (!container) {
3803
+ return false;
3804
+ }
3805
+ if (ts.isInterfaceDeclaration(container)) {
3806
+ return true;
3807
+ }
3808
+ return ts.isClassLike(container) && node.token === ts.SyntaxKind.ImplementsKeyword;
3809
+ }
3778
3810
  function resolveToGlobalSymbol(symbol3) {
3779
3811
  if (symbol3.flags & ts.SymbolFlags.Alias) {
3780
3812
  symbol3 = typeChecker.getAliasedSymbol(symbol3);