File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -202,9 +202,13 @@ class PlaygroundServer
202202 new TyPosition ( position . lineNumber , position . column ) ,
203203 ) ;
204204
205+ // If completions is 100, this gives us "99" which has a length of two
206+ const digitsLength = String ( completions . length - 1 ) . length ;
207+
205208 return {
206- suggestions : completions . map ( ( completion ) => ( {
209+ suggestions : completions . map ( ( completion , i ) => ( {
207210 label : completion . label ,
211+ sortText : String ( i ) . padStart ( digitsLength , "0" ) ,
208212 kind : CompletionItemKind . Variable ,
209213 insertText : completion . label ,
210214 // TODO(micha): It's unclear why this field is required for monaco but not VS Code.
@@ -491,7 +495,7 @@ class PlaygroundServer
491495 this . typeDefinitionProviderDisposable . dispose ( ) ;
492496 this . inlayHintsDisposable . dispose ( ) ;
493497 this . formatDisposable . dispose ( ) ;
494- this . editorOpenerDisposable . dispose ( ) ;
498+ this . completionDisposable . dispose ( ) ;
495499 }
496500}
497501
You can’t perform that action at this time.
0 commit comments