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

PoC: emit code actions from the compiler that the editor tooling can use

Open zth opened this issue 1 year ago • 1 comments

Very messy PoC, but this is intended to show that we could fairly easily add a specific mode to bsc that the editor tooling and/or build system can enable to get the compiler to emit code action data.

The main advantage here is that we can co-locate the code that produces code actions with the actual type checker and what produces the error messages. Currently, we parse the error log to extract these things. This would make it more robust and easier to maintain, and automatically tied to the current ReScript version.

Example: image

To start we could port all actions in https://github.com/rescript-lang/rescript-vscode/blob/fd911045515edd1c82e981e407281ee9f311a8ed/server/src/codeActions.ts and then add more as needed.

zth avatar Sep 16 '24 20:09 zth

Maybe this should incorporate https://github.com/rescript-lang/rescript-compiler/issues/6203 at the same time. This type of functionality opens up for a JSON format anyway.

zth avatar Sep 17 '24 17:09 zth

Superseded by the new work on actions overall.

zth avatar Sep 10 '25 13:09 zth