Skip to content

Dev Meeting 2020.11.23

Thibaut Mattio edited this page Nov 24, 2020 · 2 revisions

Agenda

  • Integration of lsp & dune.
  • Prioritization of 3.16 features.
  • Installation experience of ocamllsp.
  • UI for opam & docs.ocaml.org

Notes

Attendees: @avsm @rgrinberg @voodoos @mnxn @ulugbekna @tmattio @emillon. Notes taken by @tmattio

Integration with Dune's RPC system

  • Support diagnostic
  • Support promotion
  • Listing dune's target in a UI
  • Dune RPC system is 90% done - we expect to be able to start implementing the requests and the integration with ocaml-lsp - @tmattio to work on this once it's ready

Installation experience on LSP

  • Need to install binaries for the different tools we use (ocaml-lsp-server, ocamlformat, etc.)
  • A few options
    • Provide binaries for all platforms and OCaml versions (with ocaml-ci for instance, which would allow us to sign the binaries)
    • Using opam-tools, but it probably needs a bit of work. @tmattio - to organize a meeting w/ Etienne and Anil to understand the state of the project and what needs to be done to be able to use in VSCode to install the various tools
    • Use the source version and install it in the sandbox. It is slow, but much easier (maybe as a first step, and use pre-built binaries little by little to replace the source installation)

Syntax Highlighting

  • Room for improvement
    • Highlight different constructs (modules, variants, poly variants, keywords, etc.)
    • Highlight partially applied functions
    • Highlight partially format strings
  • Now that VSCode supports semantic highlighting, we don't want to invest effort in Regex anymore.
  • Blocked by Language Server Protocol v3.16 - waiting for it to be released to continue work on syntax highlighting improvements
  • @ulugbekna to start exploring the semantic highlighting

ocamlformat

  • Problem: types on hover, or code inserted by code actions are not formatted
  • Can we have an API in ocamlformat to solve this (similar to Dune's RPC)?
  • Range formatting could solve most of our use cases, but might be heavy
  • @emillon to investigate how we could provide an API in ocamlformat, starting with formatting the destruct code action output

UI for OCaml tools (opam, dune, etc.)

  • Opam dependency list are not machine-readable
    • we can use opam-client - but it depends on Unix, so can't be use in vscode-ocaml-platform. One solution would be to fork it to replace the unix dependency
    • we can't depend on Opam release cycle
  • @ulugbekna to draft a spec on how the UI features
  • In ~/.opam, there is a file .opam-switch in every switch that lists the state of the switch. Could be enough for our needs

Debugger

  • ocamlearlybird provides a debugger adapter already - not much to do on our side
  • We can try using ocamlearlybird and see how complicated the integration is at the moment, write a report on things we can do to have a good debugging experience in VSCode