Logo

dev-resources.site

for different kinds of informations.

Editor Support for ReasonML in VSCode with Melange

Published at
5/31/2022
Categories
reason
vscode
Author
idkjs
Categories
2 categories in total
reason
open
vscode
open
Author
5 person written this
idkjs
open
Editor Support for ReasonML in VSCode with Melange

I have been trying for a long while now to work with ReasonML files in VSCode and get some syntax highlighting. This has been a problem since ReasonML on the frontend has moved on to Rescript. The solution would be using Melange but I could not get the editor highlighting to work. I have a bunch of old ReasonML projects that I still refer to so losing the editor support has been less than ideal. The code still works but you are stuck relying on the terminal output for errors.

I finally got it to work with the help of @zecklar on the ReasonML Discord forum.

Here is the solution that works.

  1. Install OCaml plugin https://marketplace.visualstudio.com/items?itemName=ocamllabs.ocaml-platform
  2. Build your project esy build
  3. Launch VSCode in your esy dev environment esy code .
  4. On the lefthand side, click OCaml extension icon
  5. Click "Select sandbox"
  6. Select "Custom" from the dropdown
  7. Pass the flag, the input box should contain $prog $args --fallback-read-dot-merlin
  8. Voila, at least typehints/navigation etc seem to work

You can try it with this repo.

This isnt working for rescript yet but I will update you if I figure it out.

Many thank, @zecklar.

reason Article's
30 articles in total
Favicon
Top 6 Reasons to Partner with Experts in Mobile App Design and Backend Development
Favicon
South Delhi Real Estate: Unveiling the Charm of Residential Houses
Favicon
How Reading Can Polish Your Learning skills
Favicon
Reason and React Meta-Frameworks
Favicon
NextJS, the App Router and ReasonReact
Favicon
ReasonReact, Auth0 and 3rd Party React Components
Favicon
Getting started with ReasonReact and Melange
Favicon
Top 9 JavaScript Flavours
Favicon
React Memory Leaks: what, why, and how to clean them up!
Favicon
The 3 Main Reasons Test Automation Projects Fail
Favicon
Comparison of Type Systems in Front-end Languages: Algebraic data types
Favicon
Editor Support for ReasonML in VSCode with Melange
Favicon
Writing Elm Ports in ReScript - 0.3
Favicon
5 Reasons That Make React Native Better Than Flutter
Favicon
Async await like syntax, without ppx in Rescript !!!
Favicon
Why React Needs Keys, Why It Matters
Favicon
Using `let.opt` in Rescript with latest Reason/OCaml
Favicon
From Reason/React to Rescript/React, Guaranteed Uncurrying
Favicon
Awesome list in rescript
Favicon
JavaScript file watching with Reason & Rescript in Dune
Favicon
Hooray!
Favicon
Getting started with ReScript and parcel
Favicon
Reasons Why Digital Healthcare Startups Meet Failures
Favicon
The strongest hearts of Rwandans
Favicon
Setting Up Webpack for ReScript
Favicon
npx resyntax
Favicon
Ethicode Projects: Contributio #1
Favicon
Displaying Notifications in ReScript
Favicon
How does ReScript affect me?
Favicon
Beating the Drom

Featured ones: