Open jad-hamza opened 3 years ago
Out of curiosity: Which IDEs expect 1 tab = 8 spaces? With a cursory review, I found that my tested editors all expect 1 tab = 1 column (EditPlus, Visual Studio, IntelliJ)
I tried in VSCode and emacs to enter a tab (of length 8), and the column numbers in the bottom of the screen are shown as 9 (VSCode) and 8 (emacs)
Yes, that happens in VS (non-code) as well. However, the IDEs I tested use characters, not columns, when interpreting the error message. I.e., when I click on the error "file.scala:10:10", the cursor might end up at character 10, column 18 (which is shown in the status bar).
cc: @deiruch
This makes IDEs who count 1 tab = 1 column misreport positions of warnings and errors.
We could adjust positions down by fetching the source code line and counting tabs during code extraction when converting Scala positions to Inox positions. The feature could be put under an option (enabled by default or not), because not all IDEs count 1 tab = 1 column.
Edit: If positions are scaled down to count 1 tab = 1 column, we should replace 1 tab with 1 space when reporting lines and error positions in the console output: https://github.com/epfl-lara/inox/blob/1b17cb4d38dfddf16286e3346929b7a05267c380/src/main/scala/inox/Reporter.scala#L207