Repository navigation
Description
Summary
A parenthesized decorator @( ... ) whose expression is a call expression followed by a line break before .member is rejected by the TypeScript AST extractor. The file is reported as having a syntax error and every symbol after the decorator is dropped from the graph.
tsc accepts the same file without a single diagnostic.
This formatting is what Prettier produces for chained decorator factories, so it is common in decorator-heavy codebases (NestJS, TypeORM, and in my case @sqb/connect).
Minimal reproduction
x.ts — 7 lines, clean under tsc --noEmit:
declare function Link(): any;
export class C {
@(Link()
.toMany())
a: unknown;
}$ graphify update .
warning: 1 file(s) had syntax errors and may be partially extracted: x.ts (first error at line 4, 1 symbol(s) extracted)
Only C is extracted; the property a is lost.
What exactly triggers it
I bisected the construct. The line break before . only matters when the receiver is a call expression:
| # | Decorator | Result |
|---|---|---|
| 1 | @(Link().toMany()) — one line |
✅ clean |
| 2 | @(Link\n .toMany()) — line break, identifier receiver |
✅ clean |
| 3 | @(\n Link().toMany()\n) — line break after @(, expression on one line |
✅ clean |
| 4 | @(Link()\n .toMany()) — line break, call receiver |
❌ syntax error |
| 5 | @(Link({ a: 1 })\n .toMany(() => X, {})\n .toOne(() => Y, {})) |
❌ syntax error |
| 6 | const v = Link()\n .toMany(); — same chain, plain statement |
✅ clean |
Rows 2 and 3 show parenthesized decorators are supported in general, and row 6 shows multi-line call chains are fine outside decorator position — so this is specific to a call-expression receiver continuing onto the next line inside a decorator.
Line breaks inside the argument list are fine; it is only the break before the .:
// clean
@(Link({ exclusive: true }).toMany(
async () => (await import('./country.entity.js')).Country,
{ sourceKey: 'code' },
))Secondary issue: the reported line number points at the wrong decorator
In my real file (continent.entity.ts, 43 lines, 3 decorated properties) the warning says:
warning: 1 file(s) had syntax errors and may be partially extracted:
packages/connect/test/_support/continent.entity.ts (first error at line 14, 4 symbol(s) extracted)
Line 14 is a decorator of the row-1/argument-list shape above, which parses fine in isolation. The actual culprit is the chained decorator at lines 33–41. Deleting lines 33–42 makes the file extract cleanly (9 nodes, no warning); deleting the line-14 decorator instead does not help.
So the "first error at line N" position is taken from a tree-sitter ERROR node that starts well before the construct that actually fails, which sent me to the wrong place for a while. Reporting the position of the failing node — or the whole ERROR range — would make these warnings much more actionable.
Environment
- graphifyy 0.9.94 (also reproduces on 0.9.53)
- tree-sitter-typescript 0.23.2 — which is the latest release on PyPI, so there is no newer grammar to bump to; the parse failure likely needs either an upstream grammar fix or a workaround in the extractor
- tree-sitter 0.25.2, Python 3.14.5
- macOS 26.7.1 (Darwin 25.6.0), arm64, installed via
uv tool install graphifyy
Impact
Low severity, but silent: the warning says "may be partially extracted" and the run otherwise succeeds, so the missing symbols and relations are easy to miss. In my case the @Link relations of one entity are simply absent from the graph, which is exactly the kind of edge the graph is for.
Possibly related: #3597 (export type * partial extraction, also tree-sitter-typescript predating current TS syntax).
Activity
github-actions commentedon Oct 23, 2026
Thanks for opening this issue, @erayhanoglu. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
Deepjyoti-Sarmah commentedon Oct 23, 2026
I reproduced this on v8 with the 7-line
x.ts: same warning at line 4, and onlyCin the graph.The parse failure is in tree-sitter-typescript 0.23.2, not in the extractor.
@(Link().toMany())already setshas_erroron one line; the line break before.toManyonly changes the recovery. The ERROR wrapsLink()and the.('Link()\n .'), andtoMany()comes back as a separate call expression.Three things explain the report:
first error at line Nis the first ERROR in document order. Incontinent.entity.tsthe single-line ERRORs on the@(Link({...}).toMany(...))fields at lines 14 and 23 come before the multiline one at line 33, so the warning stops at 14._ts_decorator_namehandlesidentifierandmember_expressionand returnsNoneforparenthesized_expression, so@(Link\n.toMany()), which parses cleanly, also emits no edge.One correction so a fix targets the right loss: a typed field (
a: unknown,declare code: string) is not a graph node even when the file parses cleanly. The field is not dropped; the missing output is the decoratorreferencesedge. Methods after the failing decorator still extracted in my tests.I'm working on a fix for both the parse recovery and the parenthesized decorator name, and will open a PR.
fix: recover chained TS decorators and report the lossy parse region (#…
test(ts): chained decorator edges and warning region line (#4711)
safishamsi commentedon Oct 26, 2026
Fixed in v0.9.96 via #4715, now on PyPI (pip install graphifyy==0.9.96). Parenthesized/chained TS decorators are recovered instead of dropping later symbols. Thanks for the report, @erayhanoglu.
Merge v8 into fix/python-imported-module-decorators