sarsi icon indicating copy to clipboard operation
sarsi copied to clipboard

Support more structure (start/end) in `Location`.

Open aloiscochard opened this issue 8 years ago • 5 comments

Language like Rust provide not only the start location of the error, but also the end location.

Ideally this should be supported by the sarsi protocol, in order to provide complete highlighting in clients.

aloiscochard avatar Sep 19 '16 07:09 aloiscochard

Actually, it could be simply a Length parameter added in addition to Location.

But I'm not sure how useful it is, I can not think of a single case where this information can not be retrieved just by highlighting the expression at Location.

aloiscochard avatar Sep 19 '16 08:09 aloiscochard

Elm provides the following

{
"region": {
  "start": {
    "line": 61,
    "column": 4
},
  "end": {
    "line": 62,
    "column": 32
  }
},
"subregion": {
  "start": {
    "line": 62,
    "column": 15
  },
  "end": {
    "line": 62,
    "column": 32
  }
}
}

Where region can express a piece of code and subregion to specify exactly where the error is. subregion can be optional

tdroxler avatar Sep 19 '16 13:09 tdroxler

IMHO region is enough, no need for subregion in sarsi

tdroxler avatar Sep 19 '16 13:09 tdroxler

35| update : Msg -> Model -> (Model, Cmd Msg)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tdroxler avatar Sep 20 '16 09:09 tdroxler

For info, in LSP they have a Range https://microsoft.github.io/language-server-protocol/specifications/specification-current/#range

tdroxler avatar Apr 28 '21 09:04 tdroxler