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

Configure Feed

Select the types of activity you want to include in your feed.

chore(core): support property access (#324)

authored by

Jovi De Croock and committed by
GitHub
cad03d64 f700878d

+10 -1
+5
.changeset/lemon-papayas-brush.md
··· 1 + --- 2 + '@0no-co/graphqlsp': patch 3 + --- 4 + 5 + Support property-access-chain in binary-expression assignment
+5 -1
packages/graphqlsp/src/ast/index.ts
··· 81 81 } else if (ts.isPropertyAssignment(found.parent)) { 82 82 found = found.parent.initializer; 83 83 } else if (ts.isBinaryExpression(found.parent)) { 84 - found = found.parent.right; 84 + if (ts.isPropertyAccessExpression(found.parent.right)) { 85 + found = found.parent.right.name as ts.Identifier; 86 + } else { 87 + found = found.parent.right; 88 + } 85 89 } 86 90 87 91 // If we found another identifier, we repeat trying to find the original