mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
more icons
This commit is contained in:
parent
f1f2804c71
commit
238b52358d
2 changed files with 15 additions and 2 deletions
|
@ -30,7 +30,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use crate::{
|
pub use crate::{
|
||||||
completion::{CompletionItem, InsertText},
|
completion::{CompletionItem, CompletionItemKind, InsertText},
|
||||||
};
|
};
|
||||||
pub use ra_editor::{
|
pub use ra_editor::{
|
||||||
FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode,
|
FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode,
|
||||||
|
|
|
@ -2,7 +2,7 @@ use languageserver_types::{
|
||||||
self, Location, Position, Range, SymbolKind, TextDocumentEdit, TextDocumentIdentifier,
|
self, Location, Position, Range, SymbolKind, TextDocumentEdit, TextDocumentIdentifier,
|
||||||
TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, InsertTextFormat,
|
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_editor::{LineCol, LineIndex};
|
||||||
use ra_text_edit::{AtomTextEdit, TextEdit};
|
use ra_text_edit::{AtomTextEdit, TextEdit};
|
||||||
use ra_syntax::{SyntaxKind, TextRange, TextUnit};
|
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 {
|
impl Conv for CompletionItem {
|
||||||
type Output = ::languageserver_types::CompletionItem;
|
type Output = ::languageserver_types::CompletionItem;
|
||||||
|
|
||||||
|
@ -52,6 +64,7 @@ impl Conv for CompletionItem {
|
||||||
let mut res = ::languageserver_types::CompletionItem {
|
let mut res = ::languageserver_types::CompletionItem {
|
||||||
label: self.label().to_string(),
|
label: self.label().to_string(),
|
||||||
filter_text: Some(self.lookup().to_string()),
|
filter_text: Some(self.lookup().to_string()),
|
||||||
|
kind: self.kind().map(|it| it.conv()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
match self.insert_text() {
|
match self.insert_text() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue