File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
playground/knot/src/Editor Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -62,18 +62,25 @@ function Items({
6262 ) ;
6363 }
6464
65+ const uniqueIds : Map < string , number > = new Map ( ) ;
66+
6567 return (
6668 < ul className = "space-y-0.5 grow overflow-y-scroll" >
67- { diagnostics . map ( ( diagnostic , index ) => {
69+ { diagnostics . map ( ( diagnostic ) => {
6870 const position = diagnostic . range ;
6971 const start = position ?. start ;
7072 const id = diagnostic . id ;
7173
7274 const startLine = start ?. line ?? 1 ;
7375 const startColumn = start ?. column ?? 1 ;
7476
77+ const mostlyUniqueId = `${ startLine } :${ startColumn } -${ id } ` ;
78+
79+ const disambiguator = uniqueIds . get ( mostlyUniqueId ) ?? 0 ;
80+ uniqueIds . set ( mostlyUniqueId , disambiguator + 1 ) ;
81+
7582 return (
76- < li key = { `${ startLine } : ${ startColumn } -${ id ?? index } ` } >
83+ < li key = { `${ mostlyUniqueId } -${ disambiguator } ` } >
7784 < button
7885 onClick = { ( ) => onGoTo ( startLine , startColumn ) }
7986 className = "w-full text-start cursor-pointer select-text"
You can’t perform that action at this time.
0 commit comments