dsherret / ts-morph

TypeScript Compiler API wrapper for static analysis and programmatic code changes.

Home Page:https://ts-morph.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing file fails sometimes if function being parsed starts on first line of the file.

kwalkerAvst opened this issue · comments

I have found an issue when parsing a script file where if the function I want to extract the value starts on the first line, sometimes the parsing fails to extract the value.

As a workaround, if I add a new line to the file with a blank comment on it before parsing then it always parses as expected.

Does anyone know what may cause this, and has this issue been seen before?

My colleague raised a similar issue before at #1468 but we never heard of any reason this may occur.