-
Notifications
You must be signed in to change notification settings - Fork 112
Add try / playground support #84
Comments
I have being trying to figure out the way to implement this, digging through flow-base code but honestly I'm quite lost. From what I understand there is hard wired assumption that there is If someone more knowledgeable about the code base could offer a guidance I'd like to take a stab at it. Maybe @nmote ? |
Looking into this further it seems that there is no way to run It seems there is also facebook/flow#389 issue on file with a request to make In the meantime I'm considering to add |
- Add `playground/.flowconfig` blank file to workaround flow’s requirement to have `.flowconfig` file (see facebook/flow#389) - Add `playground/try.js` blank file that will be used as file parameter when running `flow check-contents` so that `playground` will be treated as project root & defaults will be used for flow configuration. - Made changes to flowDiagnostics module so that untitled js documents with @flow pragma are type checked with flow similar to how flowptype.org/try does it.
So I created pull #88 that implements this functionality. Specifically if you create new tab and set language to Still I think proper solution would be to remove a Now there is one scenario where #88 still won't type check. Say you do draft the code in unsaved buffer and everything is fine, and then you save that buffer into file that isn't under the directory containing |
Implement flow support for unsaved docs as per #84
Currently to sketch some ideas I with flow one needs to create a project with flow configuration, for that reason I often time tend to reach over for flowtype.org/try instead. It would be really nice if I were able to type check arbitrary buffers with flow if they are starting with
@flow
pragma.The text was updated successfully, but these errors were encountered: