-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore commented code #174
Comments
@jonaskello , you are right, I will fix it soon. |
IIRC the checks are now done with regexp. I think maybe a better approach would be to parse it into an AST using babel or typescript. That would probably be more accurate than a regexp. But of course it would be more complex to implement and maybe slower too. |
@jonaskello Yeah sure it makes sense. Do you have a reference or example for checking a code file as AST? I'll give it a try :) |
@jonaskello Please see #192 What do you think? |
Fixed in 0.8.19 :) |
IMO, using strip-comments is a simpler solution and therefore better :-). If there are more advanced code-analysis needed later we can look into parsing into an abstract syntax tree at that point. |
Yea well, this wasn't a good move. See #196 ;) I think it will require an approach that @jonaskello mentioned and go with AST. Just my two cents. In VSCode I am using https://www.npmjs.com/package/@playlyfe/gql to essentially highlight and intellisense graphql queries. That would mean it can parse it just fine and apparently works cross-language, so it might be worth investigating. Perhaps it's possible it could fulfill a duty of file watcher as well to have generated types refreshed automatically? |
@jonaskello @FredyC |
Currently when a string with the
gql
tag exists but is commented, there will be an exception:The text was updated successfully, but these errors were encountered: