Search code examples
visual-studio-codeocamlauto-indent

Disable automatic undindent for `in` keyword for OCaml in VSCode


I am programming in OCaml using VSCode, but each time I begin a line with the in keyword, the editor automatically unindent the line. This is really annoying and I would like to disable this particular feature.

For example, if I want to write a line incr i, the indentation is broken.

I already searched in the VSCode options, using keywords "format" or "OCaml", but to no success.


Solution

  • I found a solution: I edited the file ~/.vscode/extensions/ocamllabs.ocaml-platform-1.26.1/languages/ocaml.json, and deleted the in keyword in the line:

    "decreaseIndentPattern": "^\\s*(end|done|with|in|else)\\b|^\\s*;;",