@@ -209,13 +209,13 @@ export class ItemRenderer implements IListRenderer<CompletionItem, ISuggestionTe
209
209
if ( typeof completion . label === 'string' ) {
210
210
data . parametersLabel . textContent = '' ;
211
211
data . qualifierLabel . textContent = '' ;
212
- data . detailsLabel . textContent = ( completion . detail || '' ) . replace ( / \n . * $ / m , '' ) ;
212
+ data . detailsLabel . textContent = stripNewLines ( completion . detail || '' ) ;
213
213
data . root . classList . add ( 'string-label' ) ;
214
214
data . root . title = '' ;
215
215
} else {
216
- data . parametersLabel . textContent = ( completion . label . parameters || '' ) . replace ( / \n . * $ / m , '' ) ;
217
- data . qualifierLabel . textContent = ( completion . label . qualifier || '' ) . replace ( / \n . * $ / m , '' ) ;
218
- data . detailsLabel . textContent = ( completion . label . type || '' ) . replace ( / \n . * $ / m , '' ) ;
216
+ data . parametersLabel . textContent = stripNewLines ( completion . label . parameters || '' ) ;
217
+ data . qualifierLabel . textContent = stripNewLines ( completion . label . qualifier || '' ) ;
218
+ data . detailsLabel . textContent = stripNewLines ( completion . label . type || '' ) ;
219
219
data . root . classList . remove ( 'string-label' ) ;
220
220
data . root . title = `${ element . textLabel } ${ completion . label . parameters ?? '' } ${ completion . label . qualifier ?? '' } ${ completion . label . type ?? '' } ` ;
221
221
}
@@ -250,3 +250,7 @@ export class ItemRenderer implements IListRenderer<CompletionItem, ISuggestionTe
250
250
templateData . disposables . dispose ( ) ;
251
251
}
252
252
}
253
+
254
+ function stripNewLines ( str : string ) : string {
255
+ return str . replace ( / \r \n | \r | \n / g, '' ) ;
256
+ }
0 commit comments