mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Remove some stale deprecations
This commit is contained in:
parent
1347b7fa4c
commit
c8ace3a295
5 changed files with 5 additions and 12 deletions
|
@ -97,7 +97,6 @@ fn add_vis_to_referenced_record_field(acc: &mut Assists, ctx: &AssistContext) ->
|
||||||
let parent_name = parent.name(ctx.db());
|
let parent_name = parent.name(ctx.db());
|
||||||
let target_module = parent.module(ctx.db());
|
let target_module = parent.module(ctx.db());
|
||||||
|
|
||||||
#[allow(deprecated)]
|
|
||||||
let in_file_source = record_field_def.source(ctx.db())?;
|
let in_file_source = record_field_def.source(ctx.db())?;
|
||||||
let (offset, current_visibility, target) = match in_file_source.value {
|
let (offset, current_visibility, target) = match in_file_source.value {
|
||||||
hir::FieldSource::Named(it) => {
|
hir::FieldSource::Named(it) => {
|
||||||
|
|
|
@ -156,7 +156,6 @@ fn missing_record_expr_field_fix(
|
||||||
let record_fields = match VariantDef::from(def_id) {
|
let record_fields = match VariantDef::from(def_id) {
|
||||||
VariantDef::Struct(s) => {
|
VariantDef::Struct(s) => {
|
||||||
module = s.module(sema.db);
|
module = s.module(sema.db);
|
||||||
#[allow(deprecated)]
|
|
||||||
let source = s.source(sema.db)?;
|
let source = s.source(sema.db)?;
|
||||||
def_file_id = source.file_id;
|
def_file_id = source.file_id;
|
||||||
let fields = source.value.field_list()?;
|
let fields = source.value.field_list()?;
|
||||||
|
@ -164,14 +163,12 @@ fn missing_record_expr_field_fix(
|
||||||
}
|
}
|
||||||
VariantDef::Union(u) => {
|
VariantDef::Union(u) => {
|
||||||
module = u.module(sema.db);
|
module = u.module(sema.db);
|
||||||
#[allow(deprecated)]
|
|
||||||
let source = u.source(sema.db)?;
|
let source = u.source(sema.db)?;
|
||||||
def_file_id = source.file_id;
|
def_file_id = source.file_id;
|
||||||
source.value.record_field_list()?
|
source.value.record_field_list()?
|
||||||
}
|
}
|
||||||
VariantDef::Variant(e) => {
|
VariantDef::Variant(e) => {
|
||||||
module = e.module(sema.db);
|
module = e.module(sema.db);
|
||||||
#[allow(deprecated)]
|
|
||||||
let source = e.source(sema.db)?;
|
let source = e.source(sema.db)?;
|
||||||
def_file_id = source.file_id;
|
def_file_id = source.file_id;
|
||||||
let fields = source.value.field_list()?;
|
let fields = source.value.field_list()?;
|
||||||
|
|
|
@ -320,7 +320,6 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
|
||||||
from_def_source_labeled(db, it, Some(label), mod_path)
|
from_def_source_labeled(db, it, Some(label), mod_path)
|
||||||
}
|
}
|
||||||
Definition::Field(def) => {
|
Definition::Field(def) => {
|
||||||
#[allow(deprecated)]
|
|
||||||
let src = def.source(db)?.value;
|
let src = def.source(db)?.value;
|
||||||
if let FieldSource::Named(it) = src {
|
if let FieldSource::Named(it) = src {
|
||||||
from_def_source_labeled(db, def, it.short_label(), mod_path)
|
from_def_source_labeled(db, def, it.short_label(), mod_path)
|
||||||
|
@ -368,7 +367,6 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
|
||||||
D: HasSource<Ast = A> + HasAttrs + Copy,
|
D: HasSource<Ast = A> + HasAttrs + Copy,
|
||||||
A: ShortLabel,
|
A: ShortLabel,
|
||||||
{
|
{
|
||||||
#[allow(deprecated)]
|
|
||||||
let short_label = def.source(db)?.value.short_label();
|
let short_label = def.source(db)?.value.short_label();
|
||||||
from_def_source_labeled(db, def, short_label, mod_path)
|
from_def_source_labeled(db, def, short_label, mod_path)
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,6 @@ impl Definition {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Definition::LifetimeParam(param) = self {
|
if let Definition::LifetimeParam(param) = self {
|
||||||
#[allow(deprecated)]
|
|
||||||
let range = match param.parent(db) {
|
let range = match param.parent(db) {
|
||||||
hir::GenericDef::Function(it) => {
|
hir::GenericDef::Function(it) => {
|
||||||
it.source(db).and_then(|src| Some(src.value.syntax().text_range()))
|
it.source(db).and_then(|src| Some(src.value.syntax().text_range()))
|
||||||
|
|
|
@ -18,8 +18,8 @@ use lsp_types::{
|
||||||
CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem,
|
CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem,
|
||||||
CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams,
|
CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams,
|
||||||
CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DiagnosticTag,
|
CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DiagnosticTag,
|
||||||
DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams,
|
DocumentFormattingParams, DocumentHighlight, FoldingRange, FoldingRangeParams, HoverContents,
|
||||||
HoverContents, Location, NumberOrString, Position, PrepareRenameResponse, Range, RenameParams,
|
Location, NumberOrString, Position, PrepareRenameResponse, Range, RenameParams,
|
||||||
SemanticTokensDeltaParams, SemanticTokensFullDeltaResult, SemanticTokensParams,
|
SemanticTokensDeltaParams, SemanticTokensFullDeltaResult, SemanticTokensParams,
|
||||||
SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation,
|
SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation,
|
||||||
SymbolTag, TextDocumentIdentifier, TextDocumentPositionParams, Url, WorkspaceEdit,
|
SymbolTag, TextDocumentIdentifier, TextDocumentPositionParams, Url, WorkspaceEdit,
|
||||||
|
@ -280,7 +280,7 @@ pub(crate) fn handle_document_symbol(
|
||||||
let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?;
|
let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?;
|
||||||
let line_index = snap.analysis.file_line_index(file_id)?;
|
let line_index = snap.analysis.file_line_index(file_id)?;
|
||||||
|
|
||||||
let mut parents: Vec<(DocumentSymbol, Option<usize>)> = Vec::new();
|
let mut parents: Vec<(lsp_types::DocumentSymbol, Option<usize>)> = Vec::new();
|
||||||
|
|
||||||
for symbol in snap.analysis.file_structure(file_id)? {
|
for symbol in snap.analysis.file_structure(file_id)? {
|
||||||
let mut tags = Vec::new();
|
let mut tags = Vec::new();
|
||||||
|
@ -289,7 +289,7 @@ pub(crate) fn handle_document_symbol(
|
||||||
};
|
};
|
||||||
|
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
let doc_symbol = DocumentSymbol {
|
let doc_symbol = lsp_types::DocumentSymbol {
|
||||||
name: symbol.label,
|
name: symbol.label,
|
||||||
detail: symbol.detail,
|
detail: symbol.detail,
|
||||||
kind: to_proto::symbol_kind(symbol.kind),
|
kind: to_proto::symbol_kind(symbol.kind),
|
||||||
|
@ -333,7 +333,7 @@ pub(crate) fn handle_document_symbol(
|
||||||
return Ok(Some(res));
|
return Ok(Some(res));
|
||||||
|
|
||||||
fn flatten_document_symbol(
|
fn flatten_document_symbol(
|
||||||
symbol: &DocumentSymbol,
|
symbol: &lsp_types::DocumentSymbol,
|
||||||
container_name: Option<String>,
|
container_name: Option<String>,
|
||||||
url: &Url,
|
url: &Url,
|
||||||
res: &mut Vec<SymbolInformation>,
|
res: &mut Vec<SymbolInformation>,
|
||||||
|
|
Loading…
Reference in a new issue