mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
more icons
This commit is contained in:
parent
f1f2804c71
commit
238b52358d
@ -30,7 +30,7 @@ use crate::{
|
||||
};
|
||||
|
||||
pub use crate::{
|
||||
completion::{CompletionItem, InsertText},
|
||||
completion::{CompletionItem, CompletionItemKind, InsertText},
|
||||
};
|
||||
pub use ra_editor::{
|
||||
FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode,
|
||||
|
@ -2,7 +2,7 @@ use languageserver_types::{
|
||||
self, Location, Position, Range, SymbolKind, TextDocumentEdit, TextDocumentIdentifier,
|
||||
TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, InsertTextFormat,
|
||||
};
|
||||
use ra_analysis::{FileId, FileSystemEdit, SourceChange, SourceFileEdit, FilePosition, CompletionItem, InsertText};
|
||||
use ra_analysis::{FileId, FileSystemEdit, SourceChange, SourceFileEdit, FilePosition, CompletionItem, CompletionItemKind, InsertText};
|
||||
use ra_editor::{LineCol, LineIndex};
|
||||
use ra_text_edit::{AtomTextEdit, TextEdit};
|
||||
use ra_syntax::{SyntaxKind, TextRange, TextUnit};
|
||||
@ -45,6 +45,18 @@ impl Conv for SyntaxKind {
|
||||
}
|
||||
}
|
||||
|
||||
impl Conv for CompletionItemKind {
|
||||
type Output = ::languageserver_types::CompletionItemKind;
|
||||
|
||||
fn conv(self) -> <Self as Conv>::Output {
|
||||
use ::languageserver_types::CompletionItemKind::*;
|
||||
match self {
|
||||
CompletionItemKind::Keyword => Keyword,
|
||||
CompletionItemKind::Snippet => Snippet,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Conv for CompletionItem {
|
||||
type Output = ::languageserver_types::CompletionItem;
|
||||
|
||||
@ -52,6 +64,7 @@ impl Conv for CompletionItem {
|
||||
let mut res = ::languageserver_types::CompletionItem {
|
||||
label: self.label().to_string(),
|
||||
filter_text: Some(self.lookup().to_string()),
|
||||
kind: self.kind().map(|it| it.conv()),
|
||||
..Default::default()
|
||||
};
|
||||
match self.insert_text() {
|
||||
|
Loading…
Reference in New Issue
Block a user