Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rescript-lang/rescript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: rescript-lang/rescript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: rescript-typecheck
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 15 files changed
  • 2 contributors

Commits on Nov 8, 2026

  1. Type-check a file for editors with the embedded compiler

    Why:
        Editors run `rescript compiler-args`, rewrite the arguments (include
        paths, -bs-v, package output, PPX and JSX flags from the parser
        arguments, -color never, -ignore-parse-errors) and run a separate
        bsc.exe on a copy of the unsaved buffer. That duplicates build
        knowledge in the extension, and bsc.exe now ships only for this.
        `rescript typecheck` runs the same check in-process.
    
    Command added (rescript typecheck):
    Example:
        // src/B.res, unsaved contents piped on stdin
        let answer = A.value + "x"
        let broken =
    Before (text): an editor's steps
        rescript compiler-args src/B.res
        # rewrite the arguments, write the buffer to a copy
        bsc.exe <rewritten arguments> <copy of B.res>
    After (text): one command
        rescript typecheck --stdin [--across-files] src/B.res
    After (diagnostic): stdout, exit status 1
          Syntax error!
          /…/basic/src/B.res:2:13-3:0
          This let-binding misses an expression
    
          We've found a bug for you!
          /…/basic/src/B.res:1:24-26
          This has type: string
          But it's expected to have type: int
    
    The copy goes to lib/rescript/incremental, where editor analysis reads its
    typed tree since #9245; diagnostics name the source instead of the copy.
    No JavaScript or genType output is written and the build's artifacts stay
    untouched. `--across-files` puts the incremental directory first on the
    include path, as the extension's acrossFiles setting does. `compiler-args`
    stays for older extension versions; both share the project setup in
    Compiler_args_command.context.
    
    Review: Why keep -bs-read-cmi? The build's interface still constrains the implementation, as in the extension's current check.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01Kbf3gKBTxeQyN6hG3urm7k
    Signed-off-by: Christoph Knittel <[email protected]>
    cknitt and claude committed Nov 8, 2026
    Configuration menu
    Copy the full SHA
    c214bf6 View commit details
    Browse the repository at this point in the history
Loading