Mirror: TypeScript LSP plugin that finds GraphQL documents in your code and provides diagnostics, auto-complete and hover-information.

Add support for unrolling default exports (#372)

authored by

Jovi De Croock and committed by
GitHub
731b69e8 c961c171

+9
+5
.changeset/many-garlics-visit.md
··· 1 + --- 2 + '@0no-co/graphqlsp': patch 3 + --- 4 + 5 + Fix support for default exported graphql() invocations
+4
packages/graphqlsp/src/ast/declaration.ts
··· 10 10 | ts.ConstructorDeclaration 11 11 | ts.EnumDeclaration 12 12 | ts.EnumMember 13 + | ts.ExportAssignment 13 14 | ts.ExportSpecifier 14 15 | ts.FunctionDeclaration 15 16 | ts.FunctionExpression ··· 56 57 case ts.SyntaxKind.Constructor: 57 58 case ts.SyntaxKind.EnumDeclaration: 58 59 case ts.SyntaxKind.EnumMember: 60 + case ts.SyntaxKind.ExportAssignment: 59 61 case ts.SyntaxKind.FunctionDeclaration: 60 62 case ts.SyntaxKind.FunctionExpression: 61 63 case ts.SyntaxKind.GetAccessor: ··· 111 113 case ts.SyntaxKind.PropertyDeclaration: 112 114 case ts.SyntaxKind.VariableDeclaration: 113 115 return node.initializer; 116 + case ts.SyntaxKind.ExportAssignment: 117 + return node.expression; 114 118 case ts.SyntaxKind.BinaryExpression: 115 119 return isAssignmentOperator(node.operatorToken) ? node.right : undefined; 116 120 case ts.SyntaxKind.ShorthandPropertyAssignment: