diff options
author | Aleksey Kladov <[email protected]> | 2018-08-25 09:44:58 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-25 09:44:58 +0100 |
commit | 220d285b4afb250e59a08e9b1ad38c2fc2275782 (patch) | |
tree | ab32fc8d58ee04fc5afae20bc80f02c6b2557a39 /crates/libeditor/src/code_actions.rs | |
parent | cf278ed3bf71d336422f7d7d7d51be92b717b720 (diff) |
rename ParsedFile -> File
Diffstat (limited to 'crates/libeditor/src/code_actions.rs')
-rw-r--r-- | crates/libeditor/src/code_actions.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/libeditor/src/code_actions.rs b/crates/libeditor/src/code_actions.rs index c7c043b39..b3305be2a 100644 --- a/crates/libeditor/src/code_actions.rs +++ b/crates/libeditor/src/code_actions.rs | |||
@@ -3,7 +3,7 @@ use std::{ | |||
3 | }; | 3 | }; |
4 | 4 | ||
5 | use libsyntax2::{ | 5 | use libsyntax2::{ |
6 | ParsedFile, | 6 | File, |
7 | ast::{self, AstNode, AttrsOwner, TypeParamsOwner, NameOwner}, | 7 | ast::{self, AstNode, AttrsOwner, TypeParamsOwner, NameOwner}, |
8 | SyntaxKind::COMMA, | 8 | SyntaxKind::COMMA, |
9 | SyntaxNodeRef, | 9 | SyntaxNodeRef, |
@@ -21,7 +21,7 @@ pub struct ActionResult { | |||
21 | pub cursor_position: Option<TextUnit>, | 21 | pub cursor_position: Option<TextUnit>, |
22 | } | 22 | } |
23 | 23 | ||
24 | pub fn flip_comma<'a>(file: &'a ParsedFile, offset: TextUnit) -> Option<impl FnOnce() -> ActionResult + 'a> { | 24 | pub fn flip_comma<'a>(file: &'a File, offset: TextUnit) -> Option<impl FnOnce() -> ActionResult + 'a> { |
25 | let syntax = file.syntax(); | 25 | let syntax = file.syntax(); |
26 | 26 | ||
27 | let comma = find_leaf_at_offset(syntax, offset).find(|leaf| leaf.kind() == COMMA)?; | 27 | let comma = find_leaf_at_offset(syntax, offset).find(|leaf| leaf.kind() == COMMA)?; |
@@ -38,7 +38,7 @@ pub fn flip_comma<'a>(file: &'a ParsedFile, offset: TextUnit) -> Option<impl FnO | |||
38 | }) | 38 | }) |
39 | } | 39 | } |
40 | 40 | ||
41 | pub fn add_derive<'a>(file: &'a ParsedFile, offset: TextUnit) -> Option<impl FnOnce() -> ActionResult + 'a> { | 41 | pub fn add_derive<'a>(file: &'a File, offset: TextUnit) -> Option<impl FnOnce() -> ActionResult + 'a> { |
42 | let nominal = find_node::<ast::NominalDef>(file.syntax(), offset)?; | 42 | let nominal = find_node::<ast::NominalDef>(file.syntax(), offset)?; |
43 | Some(move || { | 43 | Some(move || { |
44 | let derive_attr = nominal | 44 | let derive_attr = nominal |
@@ -65,7 +65,7 @@ pub fn add_derive<'a>(file: &'a ParsedFile, offset: TextUnit) -> Option<impl FnO | |||
65 | }) | 65 | }) |
66 | } | 66 | } |
67 | 67 | ||
68 | pub fn add_impl<'a>(file: &'a ParsedFile, offset: TextUnit) -> Option<impl FnOnce() -> ActionResult + 'a> { | 68 | pub fn add_impl<'a>(file: &'a File, offset: TextUnit) -> Option<impl FnOnce() -> ActionResult + 'a> { |
69 | let nominal = find_node::<ast::NominalDef>(file.syntax(), offset)?; | 69 | let nominal = find_node::<ast::NominalDef>(file.syntax(), offset)?; |
70 | let name = nominal.name()?; | 70 | let name = nominal.name()?; |
71 | 71 | ||