icerpc / slicec

The Slice compiler library
Apache License 2.0
13 stars 5 forks source link

Underlining in Snippets Misses the Last Character #555

Closed InsertCreativityHere closed 1 year ago

InsertCreativityHere commented 1 year ago

There seems to be something wrong with underlining, it stops 1 character short of where it should. For example:

error [E034]: unexpected attribute 'compress'
 --> ../../test.slice:5:11
  |
5 |     myOp([compress] myParam: bool)
  |           -------
  |
    = note: the compress attribute can only be applied to interfaces and operations

Here, the underline highlights all of compress, except the last character. It should extend to that character. Same for other errors, so this seems to be an issue with underlining and not our errors:

error [E027]: tag values must be within the range 0 <= value <= 2147483647
 --> ../../test.slice:5:14
  |
5 |     myOp(tag(-1) myParam: bool)
  |              -
  |

It only underlines the - and not the 1