Quick Start¶
This hands-on guide walks you through your first experience with the ReScript IntelliJ Plugin. Follow each step and verify the expected result before moving on.
Prerequisites¶
Plugin installed (Installation Guide)
A ReScript project with
rescript.json(orbsconfig.json)@rescript/language-serverinstalled in the project (npm install -D @rescript/language-server)
Step 1: Open Your Project¶
File → Open → Select your ReScript project folder (the directory containing
rescript.json)Wait a few seconds for the IDE to index the project
Expected Result
The Project tree shows your
src/folder andrescript.jsonA ReScript icon appears next to
.resand.resifiles in the project treeThe status bar at the bottom may show “ReScript” with a build status indicator
Troubleshooting
“Cannot find rescript.json”: Make sure you opened the project root directory, not a subdirectory
No ReScript icons on files: The plugin may not be installed correctly. Check Settings → Plugins → search for “ReScript”
Monorepo setup: If
rescript.jsonis in a subdirectory, open that subdirectory as the project root, or ensure the language server is hoisted to the workspace root
Step 2: Verify Syntax Highlighting¶
Open any .res file from the project tree.
Expected Result
Keywords (
let,type,module,switch) appear in a distinct colorStrings are colored differently from code
Comments (
//and/* */) appear in a muted colorIf the Language Server is running, you may see additional semantic coloring (e.g., module names, variant constructors)
Troubleshooting
All text is plain black/white: The file may not be recognized as ReScript. Check the file extension is
.resor.resiPartial highlighting only: This is normal during the first few seconds. Layer 1 (lexer) highlighting is instant; Layer 2 (semantic) highlighting appears once the Language Server starts
Step 3: Try Code Completion¶
Place your cursor inside a function body and start typing. For example, type Js.log or Console..
Press Ctrl+Space (Cmd+Space on macOS) to trigger completion manually.
Expected Result
A popup appears with context-aware suggestions (functions, modules, variables)
Each suggestion shows its type signature
You can also try postfix completion: type a value followed by
.switchor.logand pressTab
Troubleshooting
No completions appear: The Language Server may not be running. Check the status bar for “ReScript” indicator
“Language server not found” notification: Install the language server with
npm install -D @rescript/language-server, then restart the IDEOnly keywords appear: LSP-based completion requires a running Language Server. Native postfix/live templates work without it
Step 5: See Diagnostics in Action¶
Intentionally introduce a type error — for example, change a string value to an int where a string is expected. Save the file or wait a moment.
Expected Result
Red wavy underlines appear on the erroneous code
Hovering over the underline shows the error message with type details
The Problems panel (
Alt+6) lists all errors and warningsIf Error Lens is enabled, the error message appears inline at the end of the line
Troubleshooting
No underlines appear: The ReScript build watcher may not be running. Start it with Run → Edit Configurations → ReScript → Build Watch
Errors disappear immediately: This is expected after fixing the code. The Language Server updates diagnostics in real time
Step 6: Format Your Code¶
Press Ctrl+Alt+L (Cmd+Option+L on macOS) to format the current file.
Expected Result
The file is reformatted according to ReScript’s standard style using
rescript formatIndentation, spacing, and line breaks are adjusted automatically
Troubleshooting
“Cannot find rescript binary”: The
rescriptCLI must be available in the project’snode_modules/.bin/. Runnpm installto install dependenciesNo visible changes: Your code may already be correctly formatted
Step 7: Run a Build¶
There are several ways to run a ReScript build:
Gutter icon: Click the green ▶ icon in the gutter next to your file
Run Configuration: Run → Edit Configurations → + → ReScript → Select “Build” or “Build Watch”
Run Anything: Press
Ctrltwice (double-tapCtrl) and typerescript build
Expected Result
The Run tool window opens at the bottom showing the build output
The status bar shows the compilation result (success/error/warning count)
Build errors appear as clickable links in the console output
Troubleshooting
No ReScript option in Run Configurations: Make sure
rescript.jsonexists in the project rootBuild fails with “rescript not found”: Run
npm installto install the ReScript compiler
Step 8: Explore Further¶
You’ve covered the core workflow. Here are more features to explore:
Press Cmd+7 / Alt+7 to see an outline of your file’s modules, functions, and types.
Type let + Tab, sw + Tab, or comp + Tab to expand code snippets.
Press Alt+Enter on any expression for quick actions: wrap with Some, add @genType, and more.
Press Alt+F7 on a symbol to see all places it’s used across the project.
What’s Next?¶
Feature Overview — Explore all 90+ features organized by category
Quick Reference Card — A condensed cheat sheet of shortcuts and features
Keyboard Shortcuts — Complete shortcut reference
Configuration — Customize the plugin settings
Recipes — Task-oriented guides for common workflows