}
#[test]
- fn test_filter_postfix_completion1() {
+ fn postfix_completion_works_for_trivial_path_expression() {
check_snippet_completion(
- "filter_postfix_completion1",
+ "postfix_completion_works_for_trivial_path_expression",
r#"
fn main() {
let bar = "a";
"#,
);
}
-
- #[test]
- fn test_filter_postfix_completion2() {
- check_snippet_completion(
- "filter_postfix_completion2",
- r#"
- fn main() {
- let bar = "a";
- bar.i<|>
- }
- "#,
- );
- }
-
- #[test]
- fn test_filter_postfix_completion3() {
- check_snippet_completion(
- "filter_postfix_completion3",
- r#"
- fn main() {
- let bar = "a";
- bar.if<|>
- }
- "#,
- );
- }
-
- #[test]
- fn test_filter_postfix_completion4() {
- check_snippet_completion(
- "filter_postfix_completion4",
- r#"
- fn main() {
- let bar = "a";
- bar.dbg<|>
- }
- "#,
- );
- }
}
+++ /dev/null
----
-created: "2019-02-02T15:08:34.016389802+00:00"
-creator: insta@0.5.3
-expression: kind_completions
-source: crates/ra_ide_api/src/completion/completion_item.rs
----
-[
- CompletionItem {
- completion_kind: Postfix,
- label: "dbg",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "dbg!(bar)"
- ),
- insert_text_format: Snippet,
- source_range: [76; 76),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "if",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "if bar {$0}"
- ),
- insert_text_format: Snippet,
- source_range: [76; 76),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "match",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "match bar {\n${1:_} => {$0\\},\n}"
- ),
- insert_text_format: Snippet,
- source_range: [76; 76),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "not",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "!bar"
- ),
- insert_text_format: Snippet,
- source_range: [76; 76),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "while",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "while bar {\n$0\n}"
- ),
- insert_text_format: Snippet,
- source_range: [76; 76),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- }
-]
+++ /dev/null
----
-created: "2019-02-02T15:08:34.016388824+00:00"
-creator: insta@0.5.3
-expression: kind_completions
-source: crates/ra_ide_api/src/completion/completion_item.rs
----
-[
- CompletionItem {
- completion_kind: Postfix,
- label: "dbg",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "dbg!(bar)"
- ),
- insert_text_format: Snippet,
- source_range: [76; 77),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "if",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "if bar {$0}"
- ),
- insert_text_format: Snippet,
- source_range: [76; 77),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "match",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "match bar {\n${1:_} => {$0\\},\n}"
- ),
- insert_text_format: Snippet,
- source_range: [76; 77),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "not",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "!bar"
- ),
- insert_text_format: Snippet,
- source_range: [76; 77),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "while",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "while bar {\n$0\n}"
- ),
- insert_text_format: Snippet,
- source_range: [76; 77),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 76),
- insert: ""
- }
- ]
- }
- )
- }
-]
+++ /dev/null
----
-created: "2019-02-02T15:08:34.060136941+00:00"
-creator: insta@0.5.3
-expression: kind_completions
-source: crates/ra_ide_api/src/completion/completion_item.rs
----
-[
- CompletionItem {
- completion_kind: Postfix,
- label: "dbg",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "dbg!(bar)"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "if",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "if bar {$0}"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "match",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "match bar {\n${1:_} => {$0\\},\n}"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "not",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "!bar"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "while",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "while bar {\n$0\n}"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- }
-]
+++ /dev/null
----
-created: "2019-02-02T15:08:34.069147268+00:00"
-creator: insta@0.5.3
-expression: kind_completions
-source: crates/ra_ide_api/src/completion/completion_item.rs
----
-[
- CompletionItem {
- completion_kind: Postfix,
- label: "dbg",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "dbg!(bar)"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "if",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "if bar {$0}"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "match",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "match bar {\n${1:_} => {$0\\},\n}"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "not",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "!bar"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- },
- CompletionItem {
- completion_kind: Postfix,
- label: "while",
- kind: None,
- detail: None,
- documentation: None,
- lookup: None,
- insert_text: Some(
- "while bar {\n$0\n}"
- ),
- insert_text_format: Snippet,
- source_range: [78; 78),
- text_edit: Some(
- TextEdit {
- atoms: [
- AtomTextEdit {
- delete: [72; 78),
- insert: ""
- }
- ]
- }
- )
- }
-]
--- /dev/null
+---
+created: "2019-02-03T11:38:42.897384636+00:00"
+creator: insta@0.5.3
+expression: kind_completions
+source: crates/ra_ide_api/src/completion/completion_item.rs
+---
+[
+ CompletionItem {
+ completion_kind: Postfix,
+ label: "dbg",
+ kind: None,
+ detail: None,
+ documentation: None,
+ lookup: None,
+ insert_text: Some(
+ "dbg!(bar)"
+ ),
+ insert_text_format: Snippet,
+ source_range: [76; 76),
+ text_edit: Some(
+ TextEdit {
+ atoms: [
+ AtomTextEdit {
+ delete: [72; 76),
+ insert: ""
+ }
+ ]
+ }
+ )
+ },
+ CompletionItem {
+ completion_kind: Postfix,
+ label: "if",
+ kind: None,
+ detail: None,
+ documentation: None,
+ lookup: None,
+ insert_text: Some(
+ "if bar {$0}"
+ ),
+ insert_text_format: Snippet,
+ source_range: [76; 76),
+ text_edit: Some(
+ TextEdit {
+ atoms: [
+ AtomTextEdit {
+ delete: [72; 76),
+ insert: ""
+ }
+ ]
+ }
+ )
+ },
+ CompletionItem {
+ completion_kind: Postfix,
+ label: "match",
+ kind: None,
+ detail: None,
+ documentation: None,
+ lookup: None,
+ insert_text: Some(
+ "match bar {\n${1:_} => {$0\\},\n}"
+ ),
+ insert_text_format: Snippet,
+ source_range: [76; 76),
+ text_edit: Some(
+ TextEdit {
+ atoms: [
+ AtomTextEdit {
+ delete: [72; 76),
+ insert: ""
+ }
+ ]
+ }
+ )
+ },
+ CompletionItem {
+ completion_kind: Postfix,
+ label: "not",
+ kind: None,
+ detail: None,
+ documentation: None,
+ lookup: None,
+ insert_text: Some(
+ "!bar"
+ ),
+ insert_text_format: Snippet,
+ source_range: [76; 76),
+ text_edit: Some(
+ TextEdit {
+ atoms: [
+ AtomTextEdit {
+ delete: [72; 76),
+ insert: ""
+ }
+ ]
+ }
+ )
+ },
+ CompletionItem {
+ completion_kind: Postfix,
+ label: "while",
+ kind: None,
+ detail: None,
+ documentation: None,
+ lookup: None,
+ insert_text: Some(
+ "while bar {\n$0\n}"
+ ),
+ insert_text_format: Snippet,
+ source_range: [76; 76),
+ text_edit: Some(
+ TextEdit {
+ atoms: [
+ AtomTextEdit {
+ delete: [72; 76),
+ insert: ""
+ }
+ ]
+ }
+ )
+ }
+]