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:
It’s available in:
-
1.43.4+
in the pre-release channel -
1.44.0+
in the stable channel -
>=1.44.0
of the@rescript/language-server
NPM package
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!