-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Debugging Flow #4181
Comments
I faced the same problem and I didn't solve it. For the reference, I tried {
"program": "${workspaceRoot}/bin/flow",
"arguments": ["check", "path/to/mycode.js"],
} The error occurred at |
Still examining, but it seems to get some progress. As I guessed at the comment above, the problem caused by some process that created behind Then, I try out arguments "--max-workers" that described with I don't understand it in detail, but it seems related to some process behind
And the result looks as I expected. |
@agentcooper @kogai have you tried to get debugger working with OCaml Debugger? I can get the debugger working with simple example using |
Looks like ocaml debugger runs roughly this kind of command:
Maybe this is the culprit? E: When downgrading ocaml from 4.06.0 to 4.05.0, the error changes to:
E2: When removing _build and running the
E3: After pulling the latest flow, the error changed to
Any hints on how to fix this? would e.g @jbrown215 be able to shed a bit light on the Flow & OCaml debugging setup? |
I don't use the ocaml debugger, but flow has a few debugging commands that I use to debug type checker behavior. |
Nice, this probably already helps a lot, thanks for being so helpful! |
Ok, got debugger finally working in VS Code! Build command
VS Code debugger config
Other requirements
I also recommend to install Merlin: https://github.com/ocaml/merlin
This might be worth documenting to e.g Flow wiki or readme. |
I would also suggest using |
@villesau thanks for the instructions. Being able to step through things is going to be a big help. |
Thanks @villesau for such a useful comment. I was unable to get mine running until I added to my user settings.json: {
"reason.path.ocamlmerlin": "_opam/bin/ocamlmerlin",
"reason.diagnostics.tools": [
"merlin"
],
"editor.formatOnSave": true,
"reason.codelens.enabled": true,
} and to my debug configuration: /* start ocamlearlybird --server --port 4711 before running */
"debugServer": 4711 I then run |
Closing since none of our team member uses debuggers regularly, so we also have no ideas... |
I am using Visual Studio Code with vscode-ocaml extension.
./bin/flow
is compiled usingmake build-flow-debug
(see also: #4177)..vscode/launch.json
:local-test/test.js
:Debugging
main
seems to work:However If I set a breakpoint somewhere in
src/typings/
, for examplestatement.ml
, insidevariable_decl
function, then the breakpoint is skipped.I suspect this is because of the server-client architecture - actual type checking happens inside a different process.
Is there any good way around this?
The text was updated successfully, but these errors were encountered: