@@ -66,27 +66,28 @@ function Items({
66
66
) ;
67
67
}
68
68
69
+ const uniqueIds : Map < string , number > = new Map ( ) ;
70
+
69
71
return (
70
72
< ul className = "space-y-0.5 grow overflow-y-scroll" >
71
73
{ diagnostics . map ( ( diagnostic , index ) => {
74
+ const row = diagnostic . start_location . row ;
75
+ const column = diagnostic . start_location . column ;
76
+ const mostlyUniqueId = `${ row } :${ column } -${ diagnostic . code } ` ;
77
+
78
+ const disambiguator = uniqueIds . get ( mostlyUniqueId ) ?? 0 ;
79
+ uniqueIds . set ( mostlyUniqueId , disambiguator + 1 ) ;
80
+
72
81
return (
73
- < li
74
- key = { `${ diagnostic . start_location . row } :${ diagnostic . start_location . column } -${ diagnostic . code ?? index } ` }
75
- >
82
+ < li key = { `${ mostlyUniqueId } -${ disambiguator } ` } >
76
83
< button
77
- onClick = { ( ) =>
78
- onGoTo (
79
- diagnostic . start_location . row ,
80
- diagnostic . start_location . column ,
81
- )
82
- }
84
+ onClick = { ( ) => onGoTo ( row , diagnostic . start_location . column ) }
83
85
className = "w-full text-start cursor-pointer select-text"
84
86
>
85
87
{ diagnostic . message } { " " }
86
88
< span className = "text-gray-500" >
87
- { diagnostic . code != null && `(${ diagnostic . code } )` } [Ln{ " " }
88
- { diagnostic . start_location . row } , Col{ " " }
89
- { diagnostic . start_location . column } ]
89
+ { diagnostic . code != null && `(${ diagnostic . code } )` } [Ln { row } ,
90
+ Col { column } ]
90
91
</ span >
91
92
</ button >
92
93
</ li >
0 commit comments