@@ -9,10 +9,10 @@ use lsp_types::{
9
9
TextDocumentPositionParams , Url , VersionedTextDocumentIdentifier , WorkspaceEdit ,
10
10
} ;
11
11
use ra_ide:: {
12
- translate_offset_with_edit, CompletionItem , CompletionItemKind , CompletionScore , FileId ,
13
- FilePosition , FileRange , FileSystemEdit , Fold , FoldKind , Highlight , HighlightModifier ,
14
- HighlightTag , InlayHint , InlayKind , InsertTextFormat , LineCol , LineIndex , NavigationTarget ,
15
- RangeInfo , ReferenceAccess , Severity , SourceChange , SourceFileEdit ,
12
+ translate_offset_with_edit, CompletionItem , CompletionItemKind , FileId , FilePosition ,
13
+ FileRange , FileSystemEdit , Fold , FoldKind , Highlight , HighlightModifier , HighlightTag ,
14
+ InlayHint , InlayKind , InsertTextFormat , LineCol , LineIndex , NavigationTarget , RangeInfo ,
15
+ ReferenceAccess , Severity , SourceChange , SourceFileEdit ,
16
16
} ;
17
17
use ra_syntax:: { SyntaxKind , TextRange , TextUnit } ;
18
18
use ra_text_edit:: { AtomTextEdit , TextEdit } ;
@@ -114,10 +114,10 @@ impl Conv for Severity {
114
114
}
115
115
}
116
116
117
- impl ConvWith < ( & LineIndex , LineEndings , & mut usize ) > for CompletionItem {
117
+ impl ConvWith < ( & LineIndex , LineEndings ) > for CompletionItem {
118
118
type Output = :: lsp_types:: CompletionItem ;
119
119
120
- fn conv_with ( self , ctx : ( & LineIndex , LineEndings , & mut usize ) ) -> :: lsp_types:: CompletionItem {
120
+ fn conv_with ( self , ctx : ( & LineIndex , LineEndings ) ) -> :: lsp_types:: CompletionItem {
121
121
let mut additional_text_edits = Vec :: new ( ) ;
122
122
let mut text_edit = None ;
123
123
// LSP does not allow arbitrary edits in completion, so we have to do a
@@ -165,13 +165,8 @@ impl ConvWith<(&LineIndex, LineEndings, &mut usize)> for CompletionItem {
165
165
..Default :: default ( )
166
166
} ;
167
167
168
- if let Some ( score) = self . score ( ) {
169
- match score {
170
- CompletionScore :: TypeAndNameMatch => res. preselect = Some ( true ) ,
171
- CompletionScore :: TypeMatch => { }
172
- }
173
- res. sort_text = Some ( format ! ( "{:02}" , * ctx. 2 ) ) ;
174
- * ctx. 2 += 1 ;
168
+ if self . score ( ) . is_some ( ) {
169
+ res. preselect = Some ( true )
175
170
}
176
171
177
172
if self . deprecated ( ) {
0 commit comments