]> git.lizzy.rs Git - rust.git/commitdiff
Merge #5325
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sat, 11 Jul 2020 22:36:53 +0000 (22:36 +0000)
committerGitHub <noreply@github.com>
Sat, 11 Jul 2020 22:36:53 +0000 (22:36 +0000)
5325: Update lsp-types to account for new CodeActionKind structure r=kjeremy a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
1  2 
crates/rust-analyzer/src/handlers.rs

index 85758eed61e60276e0f46a4f4fe43671e2040660,8a06ff4b6c10d8e12659b580108feccefbe67d5e..f2e24178aef159c70ab90f5d16733a48f1ec9030
@@@ -11,11 -11,11 +11,11 @@@ use lsp_server::ErrorCode
  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,
@@@ -760,7 -760,7 +760,7 @@@ fn handle_fixes
              title,
              id: None,
              group: None,
-             kind: Some(lsp_types::code_action_kind::QUICKFIX.into()),
+             kind: Some(CodeActionKind::QUICKFIX),
              edit: Some(edit),
          };
          res.push(action);
@@@ -878,14 -878,9 +878,14 @@@ pub(crate) fn handle_code_lens
              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);