microsoft / language-server-protocol

Defines a common protocol for language servers.
https://microsoft.github.io/language-server-protocol/
Creative Commons Attribution 4.0 International
10.91k stars 764 forks source link

Recommend relationship between error ranges and selections for quickfixes #1897

Open mheiber opened 5 months ago

mheiber commented 5 months ago

Given an error range and a selection range, when should we show the error? There are some choices:

A: overlap and selection is multi-character

------- error
      ----------- selection

B: error contains selection and selection is multi-character

 --------------error
       ------selection

C

       ------errror
    --------------selection    

D

       ------errror
                 ----------selection       

E: error overlaps with selection (inclusive) and selection is single-character

       ------errror
               ^ selection       

F: error overlaps with selection (inclusive) and selection is single-character

       ------errror
                 ^ selection       

It would be nice if languages were consistent, so at least a recommendation would be most welcome!

mheiber commented 5 months ago

If https://github.com/microsoft/language-server-protocol/issues/1897 is implemented, then ideally the same recommendation should apply there.