wix-incubator / vscode-glean

The extension provides refactoring tools for your React codebase
MIT License
1.46k stars 56 forks source link

Does glean support flow? #80

Open kevinbarabash opened 5 years ago

kevinbarabash commented 5 years ago

I noticed that TypeScript is mentioned in the README.md but not Flow. I assume that the omission means that Flow isn't supported, but wanted to double check.

borislit commented 5 years ago

@kevinbarabash You've are correct. However, adding such support should be REALLY trivial. If you are willing to take up the challenge, I'd love to help :)

kevinbarabash commented 5 years ago

It looks like I'd have to change parsingOptions to include "flow" instead of "typescript" based on the current file. Is that it? I wonder if it would be easier to have a flow/typescript setting for the plugin. What would you suggest?

borislit commented 5 years ago

@kevinbarabash I think that would do for initial support, but If you want to support actual Props/State type annotation, You would need to change some of the parsing logic. For example: https://github.com/wix/vscode-glean/blob/master/src/modules/stateful-to-stateless.ts#L380

kevinbarabash commented 5 years ago

Thanks for pointing me to that.