use lsp_types::{
CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem,
CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams,
- CodeLens, Command, CompletionItem, Diagnostic, DocumentFormattingParams, DocumentHighlight,
- DocumentSymbol, FoldingRange, FoldingRangeParams, HoverContents, Location, Position,
- PrepareRenameResponse, Range, RenameParams, SemanticTokensParams, SemanticTokensRangeParams,
- SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, TextDocumentIdentifier,
- Url, WorkspaceEdit,
+ CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DocumentFormattingParams,
+ DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams, HoverContents, Location,
+ Position, PrepareRenameResponse, Range, RenameParams, SemanticTokensParams,
+ SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation,
+ TextDocumentIdentifier, Url, WorkspaceEdit,
};
use ra_ide::{
FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query,
title,
id: None,
group: None,
- kind: Some(lsp_types::code_action_kind::QUICKFIX.into()),
+ kind: Some(CodeActionKind::QUICKFIX),
edit: Some(edit),
};
res.push(action);
snap.analysis
.file_structure(file_id)?
.into_iter()
- .filter(|it| match it.kind {
- SyntaxKind::TRAIT_DEF | SyntaxKind::STRUCT_DEF | SyntaxKind::ENUM_DEF => true,
- _ => false,
+ .filter(|it| {
+ matches!(
+ it.kind,
+ SyntaxKind::TRAIT_DEF
+ | SyntaxKind::STRUCT_DEF
+ | SyntaxKind::ENUM_DEF
+ | SyntaxKind::UNION_DEF
+ )
})
.map(|it| {
let range = to_proto::range(&line_index, it.node_range);