rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

How to disable type checking for a file and leave only syntax highlighting?

Open seniorkonung opened this issue 11 months ago • 2 comments

Before I start developing the package, I want to create a test file and sketch out a basic script for interacting with the package. Using functions, modules and types that don't exist, because I make them up as I go along. And I can't figure out how to do it without getting tons of type errors but leaving syntax highlighting.

seniorkonung avatar Jan 08 '25 11:01 seniorkonung

I created in settings.json a setting {“files.associations”: {“*.ress”: “rescript"}}.

This works, but every time I save I get the No .res or .resi file. Unable to format it. Is there any way to remove it?

Ideally, I would like to be able to write something like //@noCheck at the top of the file so that the file is ignored by the vscode extension.

seniorkonung avatar Jan 08 '25 11:01 seniorkonung

So at least for the whole project, you can disable incremental compilation in .vscode/settings.json:

{
...
+ "rescript.settings.incrementalTypechecking.enable": false
}

Then it will only be compiled on save, but you would still see parse errors.

Also, it does not solve all your problems, ~~but do you know %todo?~~ Edit: you do.

@zth we already have an editor-specific annotation so can we add a @@editor.incrementalTypechecking(false) (or similar) as well?

fhammerschmidt avatar Jan 08 '25 13:01 fhammerschmidt