[ANN] Editor integration: type checking/feedback without saving (experimental)

It’s our great pleasure to announce experimental support in the editor tooling for type checking without saving! This means you’ll get feedback on your code directly, without needing to save. It also means that features like hover and autocomplete before you’ve saved is going to be working a lot better.

Example:
incremental-typechecking

It’s available in:

Enabling the feature

For now it’s opt in since it’s experimental. In VSCode, you enable it in the settings via the option Rescript > Settings > Incremental Typechecking: Enabled:

For non-VSCode users, you need to enable it via config set in your editor. The config option is:

incrementalTypechecking: {
 enabled: true
} 

cc @aspeddro who I believe knows how to configure vim and friends to enable this.

Test and give feedback

Expect issues. We’re looking for any feedback as we work through this and hopefully land it as a feature that defaults to be on in the not too distant future. You can post your thoughts in this thread, and we’ll move it to the issue tracker when appropriate.

The future

Other than being one of the most requested features for the editor tooling, this lays ground work needed for more advanced features in the editor tooling, that we will be exploring next. This includes reporting more errors in an open file (currently type checking stops at the first error), and preserving more type info in the face of errors (loosing less hovers etc below errors), as well as more advanced autocompletion features. And more.

We hope you’ll like it!

24 Likes

Thanks for this amazing job! This is the best news I’ve heard this year for Rescript.

2 Likes

First touch is INSANE. Feels unbelievably snappy.

Main job has been working on a giant TS monorepo. What a breathe of fresh air

6 Likes

I just dropped a 5 Stars :star: :star: :star: :star: :star:

3 Likes

@zth Could you describe what allowed you to achieve the feature and why it wasn’t possible before?

5 Likes

I feel like my productivity has doubled, that’s too nice!

3 Likes

I just did the same!

Incredible work @zth. This is a huge improvement in the developer experience. :tada:

3 Likes

For Neovim (LSP built-in) users:

require('lspconfig').rescriptls.setup {
  init_options = {
    extensionConfiguration = {
      incrementalTypechecking = {
        enabled = true
      },
    },
  },
}
5 Likes