hackwaly / ocamlearlybird

OCaml debug adapter
MIT License
208 stars 23 forks source link

`Typenv__Envaux_hack.Error(...)` and Dune integration #28

Open hackwaly opened 3 years ago

hackwaly commented 3 years ago

Since debug informations provided by bytecode file sometimes are not enough to use to debug. It is a good point that if we can use merlin config produced by dune.

And we can upgrade the user experience by available to list debuggable programs via dune integration.

image

PavelKotov1 commented 3 years ago

Hello, i am very new to ocaml, so please do not be angry with me! I am having trouble understanding the difference between using ocamlc -g main.ml approach and compiling using dune producing main.bc file. Is it only used to debug utop examples? What is the difference between the files produced by ocamlc -g and dune produced *.bc file? How different is it from "traditional" approach? You still provide lanch.json file. I am very confuse... Could somebody explain? Thanks in advance!

atagunov commented 3 years ago

It is my impression dune might have stopped or may stop producing those .merlin files replacing them with a new command

dune ocaml-merlin

Or that it may still be producing .merlin files but this is supposed to be better.

I understand it may work a little like LSP: you start dune process with this command, feed requests to its stdin and read answers from stdout. This is touted to be a better facility as you presumably can ask questions about particular source files rather than get folder-level info.

I haven't found many references online but links from changelog provide useful info

hackwaly commented 3 years ago

Thank you. I have found this command and dune describe command both can be used. I'm investigating which is best fit our case.

hackwaly commented 3 years ago

ref https://github.com/ocaml/dune/issues/4263