diff options
45 files changed, 4959 insertions, 462 deletions
diff --git a/Cargo.lock b/Cargo.lock index 29e70d8fc..10bd94f7b 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -624,7 +624,7 @@ dependencies = [ | |||
624 | 624 | ||
625 | [[package]] | 625 | [[package]] |
626 | name = "lsp-types" | 626 | name = "lsp-types" |
627 | version = "0.68.1" | 627 | version = "0.69.0" |
628 | source = "registry+https://github.com/rust-lang/crates.io-index" | 628 | source = "registry+https://github.com/rust-lang/crates.io-index" |
629 | dependencies = [ | 629 | dependencies = [ |
630 | "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", | 630 | "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -739,7 +739,7 @@ dependencies = [ | |||
739 | 739 | ||
740 | [[package]] | 740 | [[package]] |
741 | name = "once_cell" | 741 | name = "once_cell" |
742 | version = "1.2.0" | 742 | version = "1.3.0" |
743 | source = "registry+https://github.com/rust-lang/crates.io-index" | 743 | source = "registry+https://github.com/rust-lang/crates.io-index" |
744 | 744 | ||
745 | [[package]] | 745 | [[package]] |
@@ -869,8 +869,8 @@ version = "0.1.0" | |||
869 | name = "ra_assists" | 869 | name = "ra_assists" |
870 | version = "0.1.0" | 870 | version = "0.1.0" |
871 | dependencies = [ | 871 | dependencies = [ |
872 | "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||
872 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | 873 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", |
873 | "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||
874 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | 874 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", |
875 | "ra_db 0.1.0", | 875 | "ra_db 0.1.0", |
876 | "ra_fmt 0.1.0", | 876 | "ra_fmt 0.1.0", |
@@ -905,7 +905,7 @@ dependencies = [ | |||
905 | "insta 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", | 905 | "insta 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", |
906 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 906 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
907 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 907 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
908 | "lsp-types 0.68.1 (registry+https://github.com/rust-lang/crates.io-index)", | 908 | "lsp-types 0.69.0 (registry+https://github.com/rust-lang/crates.io-index)", |
909 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | 909 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", |
910 | "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", | 910 | "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", |
911 | ] | 911 | ] |
@@ -981,7 +981,7 @@ dependencies = [ | |||
981 | "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", | 981 | "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", |
982 | "insta 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", | 982 | "insta 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", |
983 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 983 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
984 | "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 984 | "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
985 | "ra_arena 0.1.0", | 985 | "ra_arena 0.1.0", |
986 | "ra_cfg 0.1.0", | 986 | "ra_cfg 0.1.0", |
987 | "ra_db 0.1.0", | 987 | "ra_db 0.1.0", |
@@ -1043,7 +1043,7 @@ dependencies = [ | |||
1043 | "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1043 | "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1044 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | 1044 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", |
1045 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1045 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
1046 | "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1046 | "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1047 | "proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", | 1047 | "proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", |
1048 | "ra_assists 0.1.0", | 1048 | "ra_assists 0.1.0", |
1049 | "ra_cfg 0.1.0", | 1049 | "ra_cfg 0.1.0", |
@@ -1066,11 +1066,12 @@ name = "ra_lsp_server" | |||
1066 | version = "0.1.0" | 1066 | version = "0.1.0" |
1067 | dependencies = [ | 1067 | dependencies = [ |
1068 | "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1068 | "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1069 | "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1069 | "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1070 | "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1070 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1071 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1071 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1072 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
1072 | "lsp-server 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1073 | "lsp-server 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1073 | "lsp-types 0.68.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1074 | "lsp-types 0.69.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1074 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1075 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1075 | "ra_cargo_watch 0.1.0", | 1076 | "ra_cargo_watch 0.1.0", |
1076 | "ra_ide 0.1.0", | 1077 | "ra_ide 0.1.0", |
@@ -1117,7 +1118,7 @@ dependencies = [ | |||
1117 | "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1118 | "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1118 | "jemalloc-ctl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | 1119 | "jemalloc-ctl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
1119 | "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1120 | "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1120 | "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1121 | "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1121 | ] | 1122 | ] |
1122 | 1123 | ||
1123 | [[package]] | 1124 | [[package]] |
@@ -1140,7 +1141,7 @@ version = "0.1.0" | |||
1140 | dependencies = [ | 1141 | dependencies = [ |
1141 | "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1142 | "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1142 | "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1143 | "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1143 | "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1144 | "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1144 | "ra_parser 0.1.0", | 1145 | "ra_parser 0.1.0", |
1145 | "ra_text_edit 0.1.0", | 1146 | "ra_text_edit 0.1.0", |
1146 | "rowan 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1147 | "rowan 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1852,7 +1853,7 @@ dependencies = [ | |||
1852 | "checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" | 1853 | "checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" |
1853 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" | 1854 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" |
1854 | "checksum lsp-server 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5383e043329615624bbf45e1ba27bd75c176762b2592855c659bc28ac580a06b" | 1855 | "checksum lsp-server 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5383e043329615624bbf45e1ba27bd75c176762b2592855c659bc28ac580a06b" |
1855 | "checksum lsp-types 0.68.1 (registry+https://github.com/rust-lang/crates.io-index)" = "19b79f72914b929daa263483134b8974962cdebc731593b11508afb7f9acec80" | 1856 | "checksum lsp-types 0.69.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd78b254376c0734bb75c200616e256adbf2c3685497fcc1124db9daf5958630" |
1856 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" | 1857 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" |
1857 | "checksum memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" | 1858 | "checksum memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" |
1858 | "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" | 1859 | "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" |
@@ -1863,7 +1864,7 @@ dependencies = [ | |||
1863 | "checksum notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" | 1864 | "checksum notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" |
1864 | "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" | 1865 | "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" |
1865 | "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" | 1866 | "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" |
1866 | "checksum once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "891f486f630e5c5a4916c7e16c4b24a53e78c860b646e9f8e005e4f16847bfed" | 1867 | "checksum once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5941ec2d5ee5916c709580d71553b81a633df245bcc73c04dcbd62152ceefc4" |
1867 | "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" | 1868 | "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" |
1868 | "checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" | 1869 | "checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" |
1869 | "checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" | 1870 | "checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" |
@@ -1,4 +1,6 @@ | |||
1 | # Rust Analyzer | 1 | <p align="center"> |
2 | <img src="https://user-images.githubusercontent.com/1711539/72443316-5a79f280-37ae-11ea-858f-035209ece2dd.png" alt="rust-analyzer logo"> | ||
3 | </p> | ||
2 | 4 | ||
3 | Rust Analyzer is an **experimental** modular compiler frontend for the Rust | 5 | Rust Analyzer is an **experimental** modular compiler frontend for the Rust |
4 | language. It is a part of a larger rls-2.0 effort to create excellent IDE | 6 | language. It is a part of a larger rls-2.0 effort to create excellent IDE |
diff --git a/crates/ra_assists/Cargo.toml b/crates/ra_assists/Cargo.toml index 50be8d9bc..0d2109e4e 100644 --- a/crates/ra_assists/Cargo.toml +++ b/crates/ra_assists/Cargo.toml | |||
@@ -11,7 +11,7 @@ doctest = false | |||
11 | format-buf = "1.0.0" | 11 | format-buf = "1.0.0" |
12 | join_to_string = "0.1.3" | 12 | join_to_string = "0.1.3" |
13 | rustc-hash = "1.0" | 13 | rustc-hash = "1.0" |
14 | itertools = "0.8.0" | 14 | either = "1.5" |
15 | 15 | ||
16 | ra_syntax = { path = "../ra_syntax" } | 16 | ra_syntax = { path = "../ra_syntax" } |
17 | ra_text_edit = { path = "../ra_text_edit" } | 17 | ra_text_edit = { path = "../ra_text_edit" } |
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index 1b626faaa..9d533fa0c 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs | |||
@@ -1,4 +1,5 @@ | |||
1 | //! This module defines `AssistCtx` -- the API surface that is exposed to assists. | 1 | //! This module defines `AssistCtx` -- the API surface that is exposed to assists. |
2 | use either::Either; | ||
2 | use hir::{db::HirDatabase, InFile, SourceAnalyzer}; | 3 | use hir::{db::HirDatabase, InFile, SourceAnalyzer}; |
3 | use ra_db::FileRange; | 4 | use ra_db::FileRange; |
4 | use ra_fmt::{leading_indent, reindent}; | 5 | use ra_fmt::{leading_indent, reindent}; |
@@ -9,12 +10,12 @@ use ra_syntax::{ | |||
9 | }; | 10 | }; |
10 | use ra_text_edit::TextEditBuilder; | 11 | use ra_text_edit::TextEditBuilder; |
11 | 12 | ||
12 | use crate::{AssistAction, AssistId, AssistLabel}; | 13 | use crate::{AssistAction, AssistId, AssistLabel, ResolvedAssist}; |
13 | 14 | ||
14 | #[derive(Clone, Debug)] | 15 | #[derive(Clone, Debug)] |
15 | pub(crate) enum Assist { | 16 | pub(crate) enum Assist { |
16 | Unresolved { label: AssistLabel }, | 17 | Unresolved { label: AssistLabel }, |
17 | Resolved { label: AssistLabel, action: AssistAction }, | 18 | Resolved { assist: ResolvedAssist }, |
18 | } | 19 | } |
19 | 20 | ||
20 | /// `AssistCtx` allows to apply an assist or check if it could be applied. | 21 | /// `AssistCtx` allows to apply an assist or check if it could be applied. |
@@ -81,22 +82,45 @@ impl<'a, DB: HirDatabase> AssistCtx<'a, DB> { | |||
81 | self, | 82 | self, |
82 | id: AssistId, | 83 | id: AssistId, |
83 | label: impl Into<String>, | 84 | label: impl Into<String>, |
84 | f: impl FnOnce(&mut AssistBuilder), | 85 | f: impl FnOnce(&mut ActionBuilder), |
85 | ) -> Option<Assist> { | 86 | ) -> Option<Assist> { |
86 | let label = AssistLabel { label: label.into(), id }; | 87 | let label = AssistLabel { label: label.into(), id }; |
87 | assert_eq!( | 88 | assert!(label.label.chars().nth(0).unwrap().is_uppercase()); |
88 | label.label.chars().nth(0).and_then(|c| Some(c.is_uppercase())).unwrap(), | ||
89 | true, | ||
90 | "First character should be uppercase" | ||
91 | ); | ||
92 | 89 | ||
93 | let assist = if self.should_compute_edit { | 90 | let assist = if self.should_compute_edit { |
94 | let action = { | 91 | let action = { |
95 | let mut edit = AssistBuilder::default(); | 92 | let mut edit = ActionBuilder::default(); |
96 | f(&mut edit); | 93 | f(&mut edit); |
97 | edit.build() | 94 | edit.build() |
98 | }; | 95 | }; |
99 | Assist::Resolved { label, action } | 96 | Assist::Resolved { assist: ResolvedAssist { label, action_data: Either::Left(action) } } |
97 | } else { | ||
98 | Assist::Unresolved { label } | ||
99 | }; | ||
100 | |||
101 | Some(assist) | ||
102 | } | ||
103 | |||
104 | #[allow(dead_code)] // will be used for auto import assist with multiple actions | ||
105 | pub(crate) fn add_assist_group( | ||
106 | self, | ||
107 | id: AssistId, | ||
108 | label: impl Into<String>, | ||
109 | f: impl FnOnce() -> Vec<ActionBuilder>, | ||
110 | ) -> Option<Assist> { | ||
111 | let label = AssistLabel { label: label.into(), id }; | ||
112 | let assist = if self.should_compute_edit { | ||
113 | let actions = f(); | ||
114 | assert!(!actions.is_empty(), "Assist cannot have no"); | ||
115 | |||
116 | Assist::Resolved { | ||
117 | assist: ResolvedAssist { | ||
118 | label, | ||
119 | action_data: Either::Right( | ||
120 | actions.into_iter().map(ActionBuilder::build).collect(), | ||
121 | ), | ||
122 | }, | ||
123 | } | ||
100 | } else { | 124 | } else { |
101 | Assist::Unresolved { label } | 125 | Assist::Unresolved { label } |
102 | }; | 126 | }; |
@@ -132,13 +156,20 @@ impl<'a, DB: HirDatabase> AssistCtx<'a, DB> { | |||
132 | } | 156 | } |
133 | 157 | ||
134 | #[derive(Default)] | 158 | #[derive(Default)] |
135 | pub(crate) struct AssistBuilder { | 159 | pub(crate) struct ActionBuilder { |
136 | edit: TextEditBuilder, | 160 | edit: TextEditBuilder, |
137 | cursor_position: Option<TextUnit>, | 161 | cursor_position: Option<TextUnit>, |
138 | target: Option<TextRange>, | 162 | target: Option<TextRange>, |
163 | label: Option<String>, | ||
139 | } | 164 | } |
140 | 165 | ||
141 | impl AssistBuilder { | 166 | impl ActionBuilder { |
167 | #[allow(dead_code)] | ||
168 | /// Adds a custom label to the action, if it needs to be different from the assist label | ||
169 | pub(crate) fn label(&mut self, label: impl Into<String>) { | ||
170 | self.label = Some(label.into()) | ||
171 | } | ||
172 | |||
142 | /// Replaces specified `range` of text with a given string. | 173 | /// Replaces specified `range` of text with a given string. |
143 | pub(crate) fn replace(&mut self, range: TextRange, replace_with: impl Into<String>) { | 174 | pub(crate) fn replace(&mut self, range: TextRange, replace_with: impl Into<String>) { |
144 | self.edit.replace(range, replace_with.into()) | 175 | self.edit.replace(range, replace_with.into()) |
@@ -197,6 +228,7 @@ impl AssistBuilder { | |||
197 | edit: self.edit.finish(), | 228 | edit: self.edit.finish(), |
198 | cursor_position: self.cursor_position, | 229 | cursor_position: self.cursor_position, |
199 | target: self.target, | 230 | target: self.target, |
231 | label: self.label, | ||
200 | } | 232 | } |
201 | } | 233 | } |
202 | } | 234 | } |
diff --git a/crates/ra_assists/src/assists/inline_local_variable.rs b/crates/ra_assists/src/assists/inline_local_variable.rs index 164aee90c..45e0f983f 100644 --- a/crates/ra_assists/src/assists/inline_local_variable.rs +++ b/crates/ra_assists/src/assists/inline_local_variable.rs | |||
@@ -4,7 +4,7 @@ use ra_syntax::{ | |||
4 | TextRange, | 4 | TextRange, |
5 | }; | 5 | }; |
6 | 6 | ||
7 | use crate::assist_ctx::AssistBuilder; | 7 | use crate::assist_ctx::ActionBuilder; |
8 | use crate::{Assist, AssistCtx, AssistId}; | 8 | use crate::{Assist, AssistCtx, AssistId}; |
9 | 9 | ||
10 | // Assist: inline_local_variable | 10 | // Assist: inline_local_variable |
@@ -94,7 +94,7 @@ pub(crate) fn inline_local_varialbe(ctx: AssistCtx<impl HirDatabase>) -> Option< | |||
94 | ctx.add_assist( | 94 | ctx.add_assist( |
95 | AssistId("inline_local_variable"), | 95 | AssistId("inline_local_variable"), |
96 | "Inline variable", | 96 | "Inline variable", |
97 | move |edit: &mut AssistBuilder| { | 97 | move |edit: &mut ActionBuilder| { |
98 | edit.delete(delete_range); | 98 | edit.delete(delete_range); |
99 | for (desc, should_wrap) in refs.iter().zip(wrap_in_parens) { | 99 | for (desc, should_wrap) in refs.iter().zip(wrap_in_parens) { |
100 | if should_wrap { | 100 | if should_wrap { |
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs index eac2903d1..56b7588ef 100644 --- a/crates/ra_assists/src/ast_transform.rs +++ b/crates/ra_assists/src/ast_transform.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | use rustc_hash::FxHashMap; | 2 | use rustc_hash::FxHashMap; |
3 | 3 | ||
4 | use hir::{db::HirDatabase, InFile, PathResolution}; | 4 | use hir::{db::HirDatabase, InFile, PathResolution}; |
5 | use ra_syntax::ast::{self, make, AstNode}; | 5 | use ra_syntax::ast::{self, AstNode}; |
6 | 6 | ||
7 | pub trait AstTransform<'a> { | 7 | pub trait AstTransform<'a> { |
8 | fn get_substitution( | 8 | fn get_substitution( |
@@ -134,11 +134,18 @@ impl<'a, DB: HirDatabase> QualifyPaths<'a, DB> { | |||
134 | match resolution { | 134 | match resolution { |
135 | PathResolution::Def(def) => { | 135 | PathResolution::Def(def) => { |
136 | let found_path = from.find_use_path(self.db, def)?; | 136 | let found_path = from.find_use_path(self.db, def)?; |
137 | let args = p | 137 | let mut path = path_to_ast(found_path); |
138 | |||
139 | let type_args = p | ||
138 | .segment() | 140 | .segment() |
139 | .and_then(|s| s.type_arg_list()) | 141 | .and_then(|s| s.type_arg_list()) |
140 | .map(|arg_list| apply(self, node.with_value(arg_list))); | 142 | .map(|arg_list| apply(self, node.with_value(arg_list))); |
141 | Some(make::path_with_type_arg_list(path_to_ast(found_path), args).syntax().clone()) | 143 | if let Some(type_args) = type_args { |
144 | let last_segment = path.segment().unwrap(); | ||
145 | path = path.with_segment(last_segment.with_type_args(type_args)) | ||
146 | } | ||
147 | |||
148 | Some(path.syntax().clone()) | ||
142 | } | 149 | } |
143 | PathResolution::Local(_) | 150 | PathResolution::Local(_) |
144 | | PathResolution::TypeParam(_) | 151 | | PathResolution::TypeParam(_) |
diff --git a/crates/ra_assists/src/doc_tests.rs b/crates/ra_assists/src/doc_tests.rs index a8f8446cb..5dc1ee233 100644 --- a/crates/ra_assists/src/doc_tests.rs +++ b/crates/ra_assists/src/doc_tests.rs | |||
@@ -15,21 +15,21 @@ fn check(assist_id: &str, before: &str, after: &str) { | |||
15 | let (db, file_id) = TestDB::with_single_file(&before); | 15 | let (db, file_id) = TestDB::with_single_file(&before); |
16 | let frange = FileRange { file_id, range: selection.into() }; | 16 | let frange = FileRange { file_id, range: selection.into() }; |
17 | 17 | ||
18 | let (_assist_id, action) = crate::assists(&db, frange) | 18 | let assist = crate::assists(&db, frange) |
19 | .into_iter() | 19 | .into_iter() |
20 | .find(|(id, _)| id.id.0 == assist_id) | 20 | .find(|assist| assist.label.id.0 == assist_id) |
21 | .unwrap_or_else(|| { | 21 | .unwrap_or_else(|| { |
22 | panic!( | 22 | panic!( |
23 | "\n\nAssist is not applicable: {}\nAvailable assists: {}", | 23 | "\n\nAssist is not applicable: {}\nAvailable assists: {}", |
24 | assist_id, | 24 | assist_id, |
25 | crate::assists(&db, frange) | 25 | crate::assists(&db, frange) |
26 | .into_iter() | 26 | .into_iter() |
27 | .map(|(id, _)| id.id.0) | 27 | .map(|assist| assist.label.id.0) |
28 | .collect::<Vec<_>>() | 28 | .collect::<Vec<_>>() |
29 | .join(", ") | 29 | .join(", ") |
30 | ) | 30 | ) |
31 | }); | 31 | }); |
32 | 32 | ||
33 | let actual = action.edit.apply(&before); | 33 | let actual = assist.get_first_action().edit.apply(&before); |
34 | assert_eq_text!(after, &actual); | 34 | assert_eq_text!(after, &actual); |
35 | } | 35 | } |
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 150b34ac7..d45b58966 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -13,6 +13,7 @@ mod doc_tests; | |||
13 | mod test_db; | 13 | mod test_db; |
14 | pub mod ast_transform; | 14 | pub mod ast_transform; |
15 | 15 | ||
16 | use either::Either; | ||
16 | use hir::db::HirDatabase; | 17 | use hir::db::HirDatabase; |
17 | use ra_db::FileRange; | 18 | use ra_db::FileRange; |
18 | use ra_syntax::{TextRange, TextUnit}; | 19 | use ra_syntax::{TextRange, TextUnit}; |
@@ -35,11 +36,27 @@ pub struct AssistLabel { | |||
35 | 36 | ||
36 | #[derive(Debug, Clone)] | 37 | #[derive(Debug, Clone)] |
37 | pub struct AssistAction { | 38 | pub struct AssistAction { |
39 | pub label: Option<String>, | ||
38 | pub edit: TextEdit, | 40 | pub edit: TextEdit, |
39 | pub cursor_position: Option<TextUnit>, | 41 | pub cursor_position: Option<TextUnit>, |
40 | pub target: Option<TextRange>, | 42 | pub target: Option<TextRange>, |
41 | } | 43 | } |
42 | 44 | ||
45 | #[derive(Debug, Clone)] | ||
46 | pub struct ResolvedAssist { | ||
47 | pub label: AssistLabel, | ||
48 | pub action_data: Either<AssistAction, Vec<AssistAction>>, | ||
49 | } | ||
50 | |||
51 | impl ResolvedAssist { | ||
52 | pub fn get_first_action(&self) -> AssistAction { | ||
53 | match &self.action_data { | ||
54 | Either::Left(action) => action.clone(), | ||
55 | Either::Right(actions) => actions[0].clone(), | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | |||
43 | /// Return all the assists applicable at the given position. | 60 | /// Return all the assists applicable at the given position. |
44 | /// | 61 | /// |
45 | /// Assists are returned in the "unresolved" state, that is only labels are | 62 | /// Assists are returned in the "unresolved" state, that is only labels are |
@@ -64,7 +81,7 @@ where | |||
64 | /// | 81 | /// |
65 | /// Assists are returned in the "resolved" state, that is with edit fully | 82 | /// Assists are returned in the "resolved" state, that is with edit fully |
66 | /// computed. | 83 | /// computed. |
67 | pub fn assists<H>(db: &H, range: FileRange) -> Vec<(AssistLabel, AssistAction)> | 84 | pub fn assists<H>(db: &H, range: FileRange) -> Vec<ResolvedAssist> |
68 | where | 85 | where |
69 | H: HirDatabase + 'static, | 86 | H: HirDatabase + 'static, |
70 | { | 87 | { |
@@ -75,11 +92,11 @@ where | |||
75 | .iter() | 92 | .iter() |
76 | .filter_map(|f| f(ctx.clone())) | 93 | .filter_map(|f| f(ctx.clone())) |
77 | .map(|a| match a { | 94 | .map(|a| match a { |
78 | Assist::Resolved { label, action } => (label, action), | 95 | Assist::Resolved { assist } => assist, |
79 | Assist::Unresolved { .. } => unreachable!(), | 96 | Assist::Unresolved { .. } => unreachable!(), |
80 | }) | 97 | }) |
81 | .collect::<Vec<_>>(); | 98 | .collect::<Vec<_>>(); |
82 | a.sort_by(|a, b| match (a.1.target, b.1.target) { | 99 | a.sort_by(|a, b| match (a.get_first_action().target, b.get_first_action().target) { |
83 | (Some(a), Some(b)) => a.len().cmp(&b.len()), | 100 | (Some(a), Some(b)) => a.len().cmp(&b.len()), |
84 | (Some(_), None) => Ordering::Less, | 101 | (Some(_), None) => Ordering::Less, |
85 | (None, Some(_)) => Ordering::Greater, | 102 | (None, Some(_)) => Ordering::Greater, |
@@ -174,7 +191,7 @@ mod helpers { | |||
174 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); | 191 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); |
175 | let action = match assist { | 192 | let action = match assist { |
176 | Assist::Unresolved { .. } => unreachable!(), | 193 | Assist::Unresolved { .. } => unreachable!(), |
177 | Assist::Resolved { action, .. } => action, | 194 | Assist::Resolved { assist } => assist.get_first_action(), |
178 | }; | 195 | }; |
179 | 196 | ||
180 | let actual = action.edit.apply(&before); | 197 | let actual = action.edit.apply(&before); |
@@ -201,7 +218,7 @@ mod helpers { | |||
201 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); | 218 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); |
202 | let action = match assist { | 219 | let action = match assist { |
203 | Assist::Unresolved { .. } => unreachable!(), | 220 | Assist::Unresolved { .. } => unreachable!(), |
204 | Assist::Resolved { action, .. } => action, | 221 | Assist::Resolved { assist } => assist.get_first_action(), |
205 | }; | 222 | }; |
206 | 223 | ||
207 | let mut actual = action.edit.apply(&before); | 224 | let mut actual = action.edit.apply(&before); |
@@ -224,7 +241,7 @@ mod helpers { | |||
224 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); | 241 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); |
225 | let action = match assist { | 242 | let action = match assist { |
226 | Assist::Unresolved { .. } => unreachable!(), | 243 | Assist::Unresolved { .. } => unreachable!(), |
227 | Assist::Resolved { action, .. } => action, | 244 | Assist::Resolved { assist } => assist.get_first_action(), |
228 | }; | 245 | }; |
229 | 246 | ||
230 | let range = action.target.expect("expected target on action"); | 247 | let range = action.target.expect("expected target on action"); |
@@ -243,7 +260,7 @@ mod helpers { | |||
243 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); | 260 | AssistCtx::with_ctx(&db, frange, true, assist).expect("code action is not applicable"); |
244 | let action = match assist { | 261 | let action = match assist { |
245 | Assist::Unresolved { .. } => unreachable!(), | 262 | Assist::Unresolved { .. } => unreachable!(), |
246 | Assist::Resolved { action, .. } => action, | 263 | Assist::Resolved { assist } => assist.get_first_action(), |
247 | }; | 264 | }; |
248 | 265 | ||
249 | let range = action.target.expect("expected target on action"); | 266 | let range = action.target.expect("expected target on action"); |
@@ -293,10 +310,10 @@ mod tests { | |||
293 | let mut assists = assists.iter(); | 310 | let mut assists = assists.iter(); |
294 | 311 | ||
295 | assert_eq!( | 312 | assert_eq!( |
296 | assists.next().expect("expected assist").0.label, | 313 | assists.next().expect("expected assist").label.label, |
297 | "Change visibility to pub(crate)" | 314 | "Change visibility to pub(crate)" |
298 | ); | 315 | ); |
299 | assert_eq!(assists.next().expect("expected assist").0.label, "Add `#[derive]`"); | 316 | assert_eq!(assists.next().expect("expected assist").label.label, "Add `#[derive]`"); |
300 | } | 317 | } |
301 | 318 | ||
302 | #[test] | 319 | #[test] |
@@ -315,7 +332,7 @@ mod tests { | |||
315 | let assists = super::assists(&db, frange); | 332 | let assists = super::assists(&db, frange); |
316 | let mut assists = assists.iter(); | 333 | let mut assists = assists.iter(); |
317 | 334 | ||
318 | assert_eq!(assists.next().expect("expected assist").0.label, "Extract into variable"); | 335 | assert_eq!(assists.next().expect("expected assist").label.label, "Extract into variable"); |
319 | assert_eq!(assists.next().expect("expected assist").0.label, "Replace with match"); | 336 | assert_eq!(assists.next().expect("expected assist").label.label, "Replace with match"); |
320 | } | 337 | } |
321 | } | 338 | } |
diff --git a/crates/ra_cargo_watch/Cargo.toml b/crates/ra_cargo_watch/Cargo.toml index 2e411d23b..9ead48abf 100644 --- a/crates/ra_cargo_watch/Cargo.toml +++ b/crates/ra_cargo_watch/Cargo.toml | |||
@@ -6,7 +6,7 @@ authors = ["rust-analyzer developers"] | |||
6 | 6 | ||
7 | [dependencies] | 7 | [dependencies] |
8 | crossbeam-channel = "0.4" | 8 | crossbeam-channel = "0.4" |
9 | lsp-types = { version = "0.68.0", features = ["proposed"] } | 9 | lsp-types = { version = "0.69.0", features = ["proposed"] } |
10 | log = "0.4.3" | 10 | log = "0.4.3" |
11 | cargo_metadata = "0.9.1" | 11 | cargo_metadata = "0.9.1" |
12 | jod-thread = "0.1.0" | 12 | jod-thread = "0.1.0" |
diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs index 20fa5a924..7f4c9280c 100644 --- a/crates/ra_cargo_watch/src/lib.rs +++ b/crates/ra_cargo_watch/src/lib.rs | |||
@@ -38,7 +38,7 @@ pub struct CheckOptions { | |||
38 | #[derive(Debug)] | 38 | #[derive(Debug)] |
39 | pub struct CheckWatcher { | 39 | pub struct CheckWatcher { |
40 | pub task_recv: Receiver<CheckTask>, | 40 | pub task_recv: Receiver<CheckTask>, |
41 | pub shared: Arc<RwLock<CheckWatcherSharedState>>, | 41 | pub state: Arc<RwLock<CheckState>>, |
42 | cmd_send: Option<Sender<CheckCommand>>, | 42 | cmd_send: Option<Sender<CheckCommand>>, |
43 | handle: Option<JoinHandle<()>>, | 43 | handle: Option<JoinHandle<()>>, |
44 | } | 44 | } |
@@ -46,22 +46,21 @@ pub struct CheckWatcher { | |||
46 | impl CheckWatcher { | 46 | impl CheckWatcher { |
47 | pub fn new(options: &CheckOptions, workspace_root: PathBuf) -> CheckWatcher { | 47 | pub fn new(options: &CheckOptions, workspace_root: PathBuf) -> CheckWatcher { |
48 | let options = options.clone(); | 48 | let options = options.clone(); |
49 | let shared = Arc::new(RwLock::new(CheckWatcherSharedState::new())); | 49 | let state = Arc::new(RwLock::new(CheckState::new())); |
50 | 50 | ||
51 | let (task_send, task_recv) = unbounded::<CheckTask>(); | 51 | let (task_send, task_recv) = unbounded::<CheckTask>(); |
52 | let (cmd_send, cmd_recv) = unbounded::<CheckCommand>(); | 52 | let (cmd_send, cmd_recv) = unbounded::<CheckCommand>(); |
53 | let shared_ = shared.clone(); | ||
54 | let handle = std::thread::spawn(move || { | 53 | let handle = std::thread::spawn(move || { |
55 | let mut check = CheckWatcherState::new(options, workspace_root, shared_); | 54 | let mut check = CheckWatcherThread::new(options, workspace_root); |
56 | check.run(&task_send, &cmd_recv); | 55 | check.run(&task_send, &cmd_recv); |
57 | }); | 56 | }); |
58 | CheckWatcher { task_recv, cmd_send: Some(cmd_send), handle: Some(handle), shared } | 57 | CheckWatcher { task_recv, cmd_send: Some(cmd_send), handle: Some(handle), state } |
59 | } | 58 | } |
60 | 59 | ||
61 | /// Returns a CheckWatcher that doesn't actually do anything | 60 | /// Returns a CheckWatcher that doesn't actually do anything |
62 | pub fn dummy() -> CheckWatcher { | 61 | pub fn dummy() -> CheckWatcher { |
63 | let shared = Arc::new(RwLock::new(CheckWatcherSharedState::new())); | 62 | let state = Arc::new(RwLock::new(CheckState::new())); |
64 | CheckWatcher { task_recv: never(), cmd_send: None, handle: None, shared } | 63 | CheckWatcher { task_recv: never(), cmd_send: None, handle: None, state } |
65 | } | 64 | } |
66 | 65 | ||
67 | /// Schedule a re-start of the cargo check worker. | 66 | /// Schedule a re-start of the cargo check worker. |
@@ -89,14 +88,14 @@ impl std::ops::Drop for CheckWatcher { | |||
89 | } | 88 | } |
90 | 89 | ||
91 | #[derive(Debug)] | 90 | #[derive(Debug)] |
92 | pub struct CheckWatcherSharedState { | 91 | pub struct CheckState { |
93 | diagnostic_collection: HashMap<Url, Vec<Diagnostic>>, | 92 | diagnostic_collection: HashMap<Url, Vec<Diagnostic>>, |
94 | suggested_fix_collection: HashMap<Url, Vec<SuggestedFix>>, | 93 | suggested_fix_collection: HashMap<Url, Vec<SuggestedFix>>, |
95 | } | 94 | } |
96 | 95 | ||
97 | impl CheckWatcherSharedState { | 96 | impl CheckState { |
98 | fn new() -> CheckWatcherSharedState { | 97 | fn new() -> CheckState { |
99 | CheckWatcherSharedState { | 98 | CheckState { |
100 | diagnostic_collection: HashMap::new(), | 99 | diagnostic_collection: HashMap::new(), |
101 | suggested_fix_collection: HashMap::new(), | 100 | suggested_fix_collection: HashMap::new(), |
102 | } | 101 | } |
@@ -104,15 +103,11 @@ impl CheckWatcherSharedState { | |||
104 | 103 | ||
105 | /// Clear the cached diagnostics, and schedule updating diagnostics by the | 104 | /// Clear the cached diagnostics, and schedule updating diagnostics by the |
106 | /// server, to clear stale results. | 105 | /// server, to clear stale results. |
107 | pub fn clear(&mut self, task_send: &Sender<CheckTask>) { | 106 | pub fn clear(&mut self) -> Vec<Url> { |
108 | let cleared_files: Vec<Url> = self.diagnostic_collection.keys().cloned().collect(); | 107 | let cleared_files: Vec<Url> = self.diagnostic_collection.keys().cloned().collect(); |
109 | |||
110 | self.diagnostic_collection.clear(); | 108 | self.diagnostic_collection.clear(); |
111 | self.suggested_fix_collection.clear(); | 109 | self.suggested_fix_collection.clear(); |
112 | 110 | cleared_files | |
113 | for uri in cleared_files { | ||
114 | task_send.send(CheckTask::Update(uri.clone())).unwrap(); | ||
115 | } | ||
116 | } | 111 | } |
117 | 112 | ||
118 | pub fn diagnostics_for(&self, uri: &Url) -> Option<&[Diagnostic]> { | 113 | pub fn diagnostics_for(&self, uri: &Url) -> Option<&[Diagnostic]> { |
@@ -123,6 +118,13 @@ impl CheckWatcherSharedState { | |||
123 | self.suggested_fix_collection.get(uri).map(|d| d.as_slice()) | 118 | self.suggested_fix_collection.get(uri).map(|d| d.as_slice()) |
124 | } | 119 | } |
125 | 120 | ||
121 | pub fn add_diagnostic_with_fixes(&mut self, file_uri: Url, diagnostic: DiagnosticWithFixes) { | ||
122 | for fix in diagnostic.suggested_fixes { | ||
123 | self.add_suggested_fix_for_diagnostic(fix, &diagnostic.diagnostic); | ||
124 | } | ||
125 | self.add_diagnostic(file_uri, diagnostic.diagnostic); | ||
126 | } | ||
127 | |||
126 | fn add_diagnostic(&mut self, file_uri: Url, diagnostic: Diagnostic) { | 128 | fn add_diagnostic(&mut self, file_uri: Url, diagnostic: Diagnostic) { |
127 | let diagnostics = self.diagnostic_collection.entry(file_uri).or_default(); | 129 | let diagnostics = self.diagnostic_collection.entry(file_uri).or_default(); |
128 | 130 | ||
@@ -158,8 +160,11 @@ impl CheckWatcherSharedState { | |||
158 | 160 | ||
159 | #[derive(Debug)] | 161 | #[derive(Debug)] |
160 | pub enum CheckTask { | 162 | pub enum CheckTask { |
161 | /// Request a update of the given files diagnostics | 163 | /// Request a clearing of all cached diagnostics from the check watcher |
162 | Update(Url), | 164 | ClearDiagnostics, |
165 | |||
166 | /// Request adding a diagnostic with fixes included to a file | ||
167 | AddDiagnostic(Url, DiagnosticWithFixes), | ||
163 | 168 | ||
164 | /// Request check progress notification to client | 169 | /// Request check progress notification to client |
165 | Status(WorkDoneProgress), | 170 | Status(WorkDoneProgress), |
@@ -170,26 +175,20 @@ pub enum CheckCommand { | |||
170 | Update, | 175 | Update, |
171 | } | 176 | } |
172 | 177 | ||
173 | struct CheckWatcherState { | 178 | struct CheckWatcherThread { |
174 | options: CheckOptions, | 179 | options: CheckOptions, |
175 | workspace_root: PathBuf, | 180 | workspace_root: PathBuf, |
176 | watcher: WatchThread, | 181 | watcher: WatchThread, |
177 | last_update_req: Option<Instant>, | 182 | last_update_req: Option<Instant>, |
178 | shared: Arc<RwLock<CheckWatcherSharedState>>, | ||
179 | } | 183 | } |
180 | 184 | ||
181 | impl CheckWatcherState { | 185 | impl CheckWatcherThread { |
182 | fn new( | 186 | fn new(options: CheckOptions, workspace_root: PathBuf) -> CheckWatcherThread { |
183 | options: CheckOptions, | 187 | CheckWatcherThread { |
184 | workspace_root: PathBuf, | ||
185 | shared: Arc<RwLock<CheckWatcherSharedState>>, | ||
186 | ) -> CheckWatcherState { | ||
187 | CheckWatcherState { | ||
188 | options, | 188 | options, |
189 | workspace_root, | 189 | workspace_root, |
190 | watcher: WatchThread::dummy(), | 190 | watcher: WatchThread::dummy(), |
191 | last_update_req: None, | 191 | last_update_req: None, |
192 | shared, | ||
193 | } | 192 | } |
194 | } | 193 | } |
195 | 194 | ||
@@ -215,7 +214,7 @@ impl CheckWatcherState { | |||
215 | 214 | ||
216 | if self.should_recheck() { | 215 | if self.should_recheck() { |
217 | self.last_update_req.take(); | 216 | self.last_update_req.take(); |
218 | self.shared.write().clear(task_send); | 217 | task_send.send(CheckTask::ClearDiagnostics).unwrap(); |
219 | 218 | ||
220 | // By replacing the watcher, we drop the previous one which | 219 | // By replacing the watcher, we drop the previous one which |
221 | // causes it to shut down automatically. | 220 | // causes it to shut down automatically. |
@@ -240,7 +239,7 @@ impl CheckWatcherState { | |||
240 | } | 239 | } |
241 | } | 240 | } |
242 | 241 | ||
243 | fn handle_message(&mut self, msg: CheckEvent, task_send: &Sender<CheckTask>) { | 242 | fn handle_message(&self, msg: CheckEvent, task_send: &Sender<CheckTask>) { |
244 | match msg { | 243 | match msg { |
245 | CheckEvent::Begin => { | 244 | CheckEvent::Begin => { |
246 | task_send | 245 | task_send |
@@ -279,18 +278,9 @@ impl CheckWatcherState { | |||
279 | }; | 278 | }; |
280 | 279 | ||
281 | let MappedRustDiagnostic { location, diagnostic, suggested_fixes } = map_result; | 280 | let MappedRustDiagnostic { location, diagnostic, suggested_fixes } = map_result; |
282 | let file_uri = location.uri.clone(); | ||
283 | 281 | ||
284 | if !suggested_fixes.is_empty() { | 282 | let diagnostic = DiagnosticWithFixes { diagnostic, suggested_fixes }; |
285 | for suggested_fix in suggested_fixes { | 283 | task_send.send(CheckTask::AddDiagnostic(location.uri, diagnostic)).unwrap(); |
286 | self.shared | ||
287 | .write() | ||
288 | .add_suggested_fix_for_diagnostic(suggested_fix, &diagnostic); | ||
289 | } | ||
290 | } | ||
291 | self.shared.write().add_diagnostic(file_uri, diagnostic); | ||
292 | |||
293 | task_send.send(CheckTask::Update(location.uri)).unwrap(); | ||
294 | } | 284 | } |
295 | 285 | ||
296 | CheckEvent::Msg(Message::BuildScriptExecuted(_msg)) => {} | 286 | CheckEvent::Msg(Message::BuildScriptExecuted(_msg)) => {} |
@@ -299,6 +289,12 @@ impl CheckWatcherState { | |||
299 | } | 289 | } |
300 | } | 290 | } |
301 | 291 | ||
292 | #[derive(Debug)] | ||
293 | pub struct DiagnosticWithFixes { | ||
294 | diagnostic: Diagnostic, | ||
295 | suggested_fixes: Vec<SuggestedFix>, | ||
296 | } | ||
297 | |||
302 | /// WatchThread exists to wrap around the communication needed to be able to | 298 | /// WatchThread exists to wrap around the communication needed to be able to |
303 | /// run `cargo check` without blocking. Currently the Rust standard library | 299 | /// run `cargo check` without blocking. Currently the Rust standard library |
304 | /// doesn't provide a way to read sub-process output without blocking, so we | 300 | /// doesn't provide a way to read sub-process output without blocking, so we |
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 3b479356f..500b34c17 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -7,7 +7,6 @@ use hir_def::{ | |||
7 | builtin_type::BuiltinType, | 7 | builtin_type::BuiltinType, |
8 | docs::Documentation, | 8 | docs::Documentation, |
9 | expr::{BindingAnnotation, Pat, PatId}, | 9 | expr::{BindingAnnotation, Pat, PatId}, |
10 | nameres::ModuleSource, | ||
11 | per_ns::PerNs, | 10 | per_ns::PerNs, |
12 | resolver::HasResolver, | 11 | resolver::HasResolver, |
13 | type_ref::{Mutability, TypeRef}, | 12 | type_ref::{Mutability, TypeRef}, |
@@ -193,13 +192,14 @@ impl Module { | |||
193 | 192 | ||
194 | pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) { | 193 | pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) { |
195 | let _p = profile("Module::diagnostics"); | 194 | let _p = profile("Module::diagnostics"); |
196 | db.crate_def_map(self.id.krate).add_diagnostics(db, self.id.local_id, sink); | 195 | let crate_def_map = db.crate_def_map(self.id.krate); |
196 | crate_def_map.add_diagnostics(db, self.id.local_id, sink); | ||
197 | for decl in self.declarations(db) { | 197 | for decl in self.declarations(db) { |
198 | match decl { | 198 | match decl { |
199 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), | 199 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), |
200 | crate::ModuleDef::Module(m) => { | 200 | crate::ModuleDef::Module(m) => { |
201 | // Only add diagnostics from inline modules | 201 | // Only add diagnostics from inline modules |
202 | if let ModuleSource::Module(_) = m.definition_source(db).value { | 202 | if crate_def_map[m.id.local_id].origin.is_inline() { |
203 | m.diagnostics(db, sink) | 203 | m.diagnostics(db, sink) |
204 | } | 204 | } |
205 | } | 205 | } |
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index a1cf89010..a2350573c 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -8,7 +8,7 @@ | |||
8 | #![recursion_limit = "512"] | 8 | #![recursion_limit = "512"] |
9 | 9 | ||
10 | macro_rules! impl_froms { | 10 | macro_rules! impl_froms { |
11 | ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => { | 11 | ($e:ident: $($v:ident $(($($sv:ident),*))?),*$(,)?) => { |
12 | $( | 12 | $( |
13 | impl From<$v> for $e { | 13 | impl From<$v> for $e { |
14 | fn from(it: $v) -> $e { | 14 | fn from(it: $v) -> $e { |
@@ -28,6 +28,7 @@ macro_rules! impl_froms { | |||
28 | 28 | ||
29 | pub mod db; | 29 | pub mod db; |
30 | pub mod source_analyzer; | 30 | pub mod source_analyzer; |
31 | pub mod source_binder; | ||
31 | 32 | ||
32 | pub mod diagnostics; | 33 | pub mod diagnostics; |
33 | 34 | ||
@@ -47,6 +48,7 @@ pub use crate::{ | |||
47 | from_source::FromSource, | 48 | from_source::FromSource, |
48 | has_source::HasSource, | 49 | has_source::HasSource, |
49 | source_analyzer::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer}, | 50 | source_analyzer::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer}, |
51 | source_binder::SourceBinder, | ||
50 | }; | 52 | }; |
51 | 53 | ||
52 | pub use hir_def::{ | 54 | pub use hir_def::{ |
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index 76e0bff34..4f8fc9602 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs | |||
@@ -14,26 +14,22 @@ use hir_def::{ | |||
14 | BodySourceMap, | 14 | BodySourceMap, |
15 | }, | 15 | }, |
16 | expr::{ExprId, PatId}, | 16 | expr::{ExprId, PatId}, |
17 | nameres::ModuleSource, | 17 | resolver::{self, resolver_for_scope, Resolver, TypeNs, ValueNs}, |
18 | resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs}, | ||
19 | DefWithBodyId, TraitId, | 18 | DefWithBodyId, TraitId, |
20 | }; | 19 | }; |
21 | use hir_expand::{ | 20 | use hir_expand::{ |
22 | hygiene::Hygiene, name::AsName, AstId, HirFileId, InFile, MacroCallId, MacroCallKind, | 21 | hygiene::Hygiene, name::AsName, AstId, HirFileId, InFile, MacroCallId, MacroCallKind, |
23 | }; | 22 | }; |
24 | use hir_ty::{InEnvironment, InferenceResult, TraitEnvironment}; | 23 | use hir_ty::{InEnvironment, InferenceResult, TraitEnvironment}; |
25 | use ra_prof::profile; | ||
26 | use ra_syntax::{ | 24 | use ra_syntax::{ |
27 | ast::{self, AstNode}, | 25 | ast::{self, AstNode}, |
28 | match_ast, AstPtr, | 26 | AstPtr, SyntaxNode, SyntaxNodePtr, SyntaxToken, TextRange, TextUnit, |
29 | SyntaxKind::*, | ||
30 | SyntaxNode, SyntaxNodePtr, SyntaxToken, TextRange, TextUnit, | ||
31 | }; | 27 | }; |
32 | use rustc_hash::FxHashSet; | 28 | use rustc_hash::FxHashSet; |
33 | 29 | ||
34 | use crate::{ | 30 | use crate::{ |
35 | db::HirDatabase, Adt, Const, DefWithBody, Enum, EnumVariant, FromSource, Function, ImplBlock, | 31 | db::HirDatabase, Adt, Const, DefWithBody, EnumVariant, Function, Local, MacroDef, Name, Path, |
36 | Local, MacroDef, Name, Path, ScopeDef, Static, Struct, Trait, Type, TypeAlias, TypeParam, | 32 | ScopeDef, Static, Struct, Trait, Type, TypeAlias, TypeParam, |
37 | }; | 33 | }; |
38 | 34 | ||
39 | /// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of | 35 | /// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of |
@@ -109,37 +105,43 @@ impl SourceAnalyzer { | |||
109 | node: InFile<&SyntaxNode>, | 105 | node: InFile<&SyntaxNode>, |
110 | offset: Option<TextUnit>, | 106 | offset: Option<TextUnit>, |
111 | ) -> SourceAnalyzer { | 107 | ) -> SourceAnalyzer { |
112 | let _p = profile("SourceAnalyzer::new"); | 108 | crate::source_binder::SourceBinder::new(db).analyze(node, offset) |
113 | let def_with_body = def_with_body_from_child_node(db, node); | 109 | } |
114 | if let Some(def) = def_with_body { | 110 | |
115 | let (_body, source_map) = db.body_with_source_map(def.into()); | 111 | pub(crate) fn new_for_body( |
116 | let scopes = db.expr_scopes(def.into()); | 112 | db: &impl HirDatabase, |
117 | let scope = match offset { | 113 | def: DefWithBodyId, |
118 | None => scope_for(&scopes, &source_map, node), | 114 | node: InFile<&SyntaxNode>, |
119 | Some(offset) => scope_for_offset(&scopes, &source_map, node.with_value(offset)), | 115 | offset: Option<TextUnit>, |
120 | }; | 116 | ) -> SourceAnalyzer { |
121 | let resolver = resolver_for_scope(db, def.into(), scope); | 117 | let (_body, source_map) = db.body_with_source_map(def); |
122 | SourceAnalyzer { | 118 | let scopes = db.expr_scopes(def); |
123 | resolver, | 119 | let scope = match offset { |
124 | body_owner: Some(def), | 120 | None => scope_for(&scopes, &source_map, node), |
125 | body_source_map: Some(source_map), | 121 | Some(offset) => scope_for_offset(&scopes, &source_map, node.with_value(offset)), |
126 | infer: Some(db.infer(def.into())), | 122 | }; |
127 | scopes: Some(scopes), | 123 | let resolver = resolver_for_scope(db, def, scope); |
128 | file_id: node.file_id, | 124 | SourceAnalyzer { |
129 | } | 125 | resolver, |
130 | } else { | 126 | body_owner: Some(def.into()), |
131 | SourceAnalyzer { | 127 | body_source_map: Some(source_map), |
132 | resolver: node | 128 | infer: Some(db.infer(def)), |
133 | .value | 129 | scopes: Some(scopes), |
134 | .ancestors() | 130 | file_id: node.file_id, |
135 | .find_map(|it| try_get_resolver_for_node(db, node.with_value(&it))) | 131 | } |
136 | .unwrap_or_default(), | 132 | } |
137 | body_owner: None, | 133 | |
138 | body_source_map: None, | 134 | pub(crate) fn new_for_resolver( |
139 | infer: None, | 135 | resolver: Resolver, |
140 | scopes: None, | 136 | node: InFile<&SyntaxNode>, |
141 | file_id: node.file_id, | 137 | ) -> SourceAnalyzer { |
142 | } | 138 | SourceAnalyzer { |
139 | resolver, | ||
140 | body_owner: None, | ||
141 | body_source_map: None, | ||
142 | infer: None, | ||
143 | scopes: None, | ||
144 | file_id: node.file_id, | ||
143 | } | 145 | } |
144 | } | 146 | } |
145 | 147 | ||
@@ -366,64 +368,6 @@ impl SourceAnalyzer { | |||
366 | } | 368 | } |
367 | } | 369 | } |
368 | 370 | ||
369 | fn try_get_resolver_for_node(db: &impl HirDatabase, node: InFile<&SyntaxNode>) -> Option<Resolver> { | ||
370 | match_ast! { | ||
371 | match (node.value) { | ||
372 | ast::Module(it) => { | ||
373 | let src = node.with_value(it); | ||
374 | Some(crate::Module::from_declaration(db, src)?.id.resolver(db)) | ||
375 | }, | ||
376 | ast::SourceFile(it) => { | ||
377 | let src = node.with_value(ModuleSource::SourceFile(it)); | ||
378 | Some(crate::Module::from_definition(db, src)?.id.resolver(db)) | ||
379 | }, | ||
380 | ast::StructDef(it) => { | ||
381 | let src = node.with_value(it); | ||
382 | Some(Struct::from_source(db, src)?.id.resolver(db)) | ||
383 | }, | ||
384 | ast::EnumDef(it) => { | ||
385 | let src = node.with_value(it); | ||
386 | Some(Enum::from_source(db, src)?.id.resolver(db)) | ||
387 | }, | ||
388 | ast::ImplBlock(it) => { | ||
389 | let src = node.with_value(it); | ||
390 | Some(ImplBlock::from_source(db, src)?.id.resolver(db)) | ||
391 | }, | ||
392 | ast::TraitDef(it) => { | ||
393 | let src = node.with_value(it); | ||
394 | Some(Trait::from_source(db, src)?.id.resolver(db)) | ||
395 | }, | ||
396 | _ => match node.value.kind() { | ||
397 | FN_DEF | CONST_DEF | STATIC_DEF => { | ||
398 | let def = def_with_body_from_child_node(db, node)?; | ||
399 | let def = DefWithBodyId::from(def); | ||
400 | Some(def.resolver(db)) | ||
401 | } | ||
402 | // FIXME add missing cases | ||
403 | _ => None | ||
404 | } | ||
405 | } | ||
406 | } | ||
407 | } | ||
408 | |||
409 | fn def_with_body_from_child_node( | ||
410 | db: &impl HirDatabase, | ||
411 | child: InFile<&SyntaxNode>, | ||
412 | ) -> Option<DefWithBody> { | ||
413 | let _p = profile("def_with_body_from_child_node"); | ||
414 | child.cloned().ancestors_with_macros(db).find_map(|node| { | ||
415 | let n = &node.value; | ||
416 | match_ast! { | ||
417 | match n { | ||
418 | ast::FnDef(def) => { return Function::from_source(db, node.with_value(def)).map(DefWithBody::from); }, | ||
419 | ast::ConstDef(def) => { return Const::from_source(db, node.with_value(def)).map(DefWithBody::from); }, | ||
420 | ast::StaticDef(def) => { return Static::from_source(db, node.with_value(def)).map(DefWithBody::from); }, | ||
421 | _ => { None }, | ||
422 | } | ||
423 | } | ||
424 | }) | ||
425 | } | ||
426 | |||
427 | fn scope_for( | 371 | fn scope_for( |
428 | scopes: &ExprScopes, | 372 | scopes: &ExprScopes, |
429 | source_map: &BodySourceMap, | 373 | source_map: &BodySourceMap, |
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs new file mode 100644 index 000000000..00541dbe1 --- /dev/null +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -0,0 +1,173 @@ | |||
1 | //! `SourceBinder` should be the main entry point for getting info about source code. | ||
2 | //! It's main task is to map source syntax trees to hir-level IDs. | ||
3 | //! | ||
4 | //! It is intended to subsume `FromSource` and `SourceAnalyzer`. | ||
5 | |||
6 | use hir_def::{ | ||
7 | child_by_source::ChildBySource, | ||
8 | dyn_map::DynMap, | ||
9 | keys::{self, Key}, | ||
10 | resolver::{HasResolver, Resolver}, | ||
11 | ConstId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, ImplId, ModuleId, StaticId, | ||
12 | StructFieldId, StructId, TraitId, TypeAliasId, UnionId, VariantId, | ||
13 | }; | ||
14 | use hir_expand::InFile; | ||
15 | use ra_prof::profile; | ||
16 | use ra_syntax::{ast, match_ast, AstNode, SyntaxNode, TextUnit}; | ||
17 | use rustc_hash::FxHashMap; | ||
18 | |||
19 | use crate::{db::HirDatabase, ModuleSource, SourceAnalyzer}; | ||
20 | |||
21 | pub struct SourceBinder<'a, DB> { | ||
22 | pub db: &'a DB, | ||
23 | child_by_source_cache: FxHashMap<ChildContainer, DynMap>, | ||
24 | } | ||
25 | |||
26 | impl<DB: HirDatabase> SourceBinder<'_, DB> { | ||
27 | pub fn new(db: &DB) -> SourceBinder<DB> { | ||
28 | SourceBinder { db, child_by_source_cache: FxHashMap::default() } | ||
29 | } | ||
30 | |||
31 | pub fn analyze( | ||
32 | &mut self, | ||
33 | src: InFile<&SyntaxNode>, | ||
34 | offset: Option<TextUnit>, | ||
35 | ) -> SourceAnalyzer { | ||
36 | let _p = profile("SourceBinder::analyzer"); | ||
37 | let container = match self.find_container(src) { | ||
38 | Some(it) => it, | ||
39 | None => return SourceAnalyzer::new_for_resolver(Resolver::default(), src), | ||
40 | }; | ||
41 | |||
42 | let resolver = match container { | ||
43 | ChildContainer::DefWithBodyId(def) => { | ||
44 | return SourceAnalyzer::new_for_body(self.db, def, src, offset) | ||
45 | } | ||
46 | ChildContainer::TraitId(it) => it.resolver(self.db), | ||
47 | ChildContainer::ImplId(it) => it.resolver(self.db), | ||
48 | ChildContainer::ModuleId(it) => it.resolver(self.db), | ||
49 | ChildContainer::EnumId(it) => it.resolver(self.db), | ||
50 | ChildContainer::VariantId(it) => it.resolver(self.db), | ||
51 | }; | ||
52 | SourceAnalyzer::new_for_resolver(resolver, src) | ||
53 | } | ||
54 | |||
55 | pub fn to_def<D, T>(&mut self, src: InFile<T>) -> Option<D> | ||
56 | where | ||
57 | D: From<T::ID>, | ||
58 | T: ToId, | ||
59 | { | ||
60 | let id: T::ID = self.to_id(src)?; | ||
61 | Some(id.into()) | ||
62 | } | ||
63 | |||
64 | fn to_id<T: ToId>(&mut self, src: InFile<T>) -> Option<T::ID> { | ||
65 | let container = self.find_container(src.as_ref().map(|it| it.syntax()))?; | ||
66 | let db = self.db; | ||
67 | let dyn_map = | ||
68 | &*self.child_by_source_cache.entry(container).or_insert_with(|| match container { | ||
69 | ChildContainer::DefWithBodyId(it) => it.child_by_source(db), | ||
70 | ChildContainer::ModuleId(it) => it.child_by_source(db), | ||
71 | ChildContainer::TraitId(it) => it.child_by_source(db), | ||
72 | ChildContainer::ImplId(it) => it.child_by_source(db), | ||
73 | ChildContainer::EnumId(it) => it.child_by_source(db), | ||
74 | ChildContainer::VariantId(it) => it.child_by_source(db), | ||
75 | }); | ||
76 | dyn_map[T::KEY].get(&src).copied() | ||
77 | } | ||
78 | |||
79 | fn find_container(&mut self, src: InFile<&SyntaxNode>) -> Option<ChildContainer> { | ||
80 | for container in src.cloned().ancestors_with_macros(self.db).skip(1) { | ||
81 | let res: ChildContainer = match_ast! { | ||
82 | match (container.value) { | ||
83 | ast::TraitDef(it) => { | ||
84 | let def: TraitId = self.to_id(container.with_value(it))?; | ||
85 | def.into() | ||
86 | }, | ||
87 | ast::ImplBlock(it) => { | ||
88 | let def: ImplId = self.to_id(container.with_value(it))?; | ||
89 | def.into() | ||
90 | }, | ||
91 | ast::FnDef(it) => { | ||
92 | let def: FunctionId = self.to_id(container.with_value(it))?; | ||
93 | DefWithBodyId::from(def).into() | ||
94 | }, | ||
95 | ast::StaticDef(it) => { | ||
96 | let def: StaticId = self.to_id(container.with_value(it))?; | ||
97 | DefWithBodyId::from(def).into() | ||
98 | }, | ||
99 | ast::ConstDef(it) => { | ||
100 | let def: ConstId = self.to_id(container.with_value(it))?; | ||
101 | DefWithBodyId::from(def).into() | ||
102 | }, | ||
103 | ast::EnumDef(it) => { | ||
104 | let def: EnumId = self.to_id(container.with_value(it))?; | ||
105 | def.into() | ||
106 | }, | ||
107 | ast::StructDef(it) => { | ||
108 | let def: StructId = self.to_id(container.with_value(it))?; | ||
109 | VariantId::from(def).into() | ||
110 | }, | ||
111 | ast::UnionDef(it) => { | ||
112 | let def: UnionId = self.to_id(container.with_value(it))?; | ||
113 | VariantId::from(def).into() | ||
114 | }, | ||
115 | // FIXME: handle out-of-line modules here | ||
116 | _ => { continue }, | ||
117 | } | ||
118 | }; | ||
119 | return Some(res); | ||
120 | } | ||
121 | |||
122 | let module_source = ModuleSource::from_child_node(self.db, src); | ||
123 | let c = crate::Module::from_definition(self.db, src.with_value(module_source))?; | ||
124 | Some(c.id.into()) | ||
125 | } | ||
126 | } | ||
127 | |||
128 | #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] | ||
129 | enum ChildContainer { | ||
130 | DefWithBodyId(DefWithBodyId), | ||
131 | ModuleId(ModuleId), | ||
132 | TraitId(TraitId), | ||
133 | ImplId(ImplId), | ||
134 | EnumId(EnumId), | ||
135 | VariantId(VariantId), | ||
136 | } | ||
137 | impl_froms! { | ||
138 | ChildContainer: | ||
139 | DefWithBodyId, | ||
140 | ModuleId, | ||
141 | TraitId, | ||
142 | ImplId, | ||
143 | EnumId, | ||
144 | VariantId, | ||
145 | } | ||
146 | |||
147 | pub trait ToId: Sized + AstNode + 'static { | ||
148 | type ID: Sized + Copy + 'static; | ||
149 | const KEY: Key<Self, Self::ID>; | ||
150 | } | ||
151 | |||
152 | macro_rules! to_id_impls { | ||
153 | ($(($id:ident, $ast:path, $key:path)),* ,) => {$( | ||
154 | impl ToId for $ast { | ||
155 | type ID = $id; | ||
156 | const KEY: Key<Self, Self::ID> = $key; | ||
157 | } | ||
158 | )*} | ||
159 | } | ||
160 | |||
161 | to_id_impls![ | ||
162 | (StructId, ast::StructDef, keys::STRUCT), | ||
163 | (UnionId, ast::UnionDef, keys::UNION), | ||
164 | (EnumId, ast::EnumDef, keys::ENUM), | ||
165 | (TraitId, ast::TraitDef, keys::TRAIT), | ||
166 | (FunctionId, ast::FnDef, keys::FUNCTION), | ||
167 | (StaticId, ast::StaticDef, keys::STATIC), | ||
168 | (ConstId, ast::ConstDef, keys::CONST), | ||
169 | (TypeAliasId, ast::TypeAliasDef, keys::TYPE_ALIAS), | ||
170 | (ImplId, ast::ImplBlock, keys::IMPL), | ||
171 | (StructFieldId, ast::RecordFieldDef, keys::RECORD_FIELD), | ||
172 | (EnumVariantId, ast::EnumVariant, keys::ENUM_VARIANT), | ||
173 | ]; | ||
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs index f7dc8acb7..8cc2fb160 100644 --- a/crates/ra_hir_def/src/find_path.rs +++ b/crates/ra_hir_def/src/find_path.rs | |||
@@ -35,7 +35,7 @@ fn find_path_inner( | |||
35 | let def_map = db.crate_def_map(from.krate); | 35 | let def_map = db.crate_def_map(from.krate); |
36 | let from_scope: &crate::item_scope::ItemScope = &def_map.modules[from.local_id].scope; | 36 | let from_scope: &crate::item_scope::ItemScope = &def_map.modules[from.local_id].scope; |
37 | if let Some((name, _)) = from_scope.name_of(item) { | 37 | if let Some((name, _)) = from_scope.name_of(item) { |
38 | return Some(ModPath::from_simple_segments(PathKind::Plain, vec![name.clone()])); | 38 | return Some(ModPath::from_segments(PathKind::Plain, vec![name.clone()])); |
39 | } | 39 | } |
40 | 40 | ||
41 | // - if the item is the crate root, return `crate` | 41 | // - if the item is the crate root, return `crate` |
@@ -45,12 +45,12 @@ fn find_path_inner( | |||
45 | local_id: def_map.root, | 45 | local_id: def_map.root, |
46 | })) | 46 | })) |
47 | { | 47 | { |
48 | return Some(ModPath::from_simple_segments(PathKind::Crate, Vec::new())); | 48 | return Some(ModPath::from_segments(PathKind::Crate, Vec::new())); |
49 | } | 49 | } |
50 | 50 | ||
51 | // - if the item is the module we're in, use `self` | 51 | // - if the item is the module we're in, use `self` |
52 | if item == ItemInNs::Types(from.into()) { | 52 | if item == ItemInNs::Types(from.into()) { |
53 | return Some(ModPath::from_simple_segments(PathKind::Super(0), Vec::new())); | 53 | return Some(ModPath::from_segments(PathKind::Super(0), Vec::new())); |
54 | } | 54 | } |
55 | 55 | ||
56 | // - if the item is the parent module, use `super` (this is not used recursively, since `super::super` is ugly) | 56 | // - if the item is the parent module, use `super` (this is not used recursively, since `super::super` is ugly) |
@@ -61,14 +61,14 @@ fn find_path_inner( | |||
61 | local_id: parent_id, | 61 | local_id: parent_id, |
62 | })) | 62 | })) |
63 | { | 63 | { |
64 | return Some(ModPath::from_simple_segments(PathKind::Super(1), Vec::new())); | 64 | return Some(ModPath::from_segments(PathKind::Super(1), Vec::new())); |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | // - if the item is the crate root of a dependency crate, return the name from the extern prelude | 68 | // - if the item is the crate root of a dependency crate, return the name from the extern prelude |
69 | for (name, def_id) in &def_map.extern_prelude { | 69 | for (name, def_id) in &def_map.extern_prelude { |
70 | if item == ItemInNs::Types(*def_id) { | 70 | if item == ItemInNs::Types(*def_id) { |
71 | return Some(ModPath::from_simple_segments(PathKind::Plain, vec![name.clone()])); | 71 | return Some(ModPath::from_segments(PathKind::Plain, vec![name.clone()])); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
@@ -79,7 +79,7 @@ fn find_path_inner( | |||
79 | &prelude_def_map.modules[prelude_module.local_id].scope; | 79 | &prelude_def_map.modules[prelude_module.local_id].scope; |
80 | if let Some((name, vis)) = prelude_scope.name_of(item) { | 80 | if let Some((name, vis)) = prelude_scope.name_of(item) { |
81 | if vis.is_visible_from(db, from) { | 81 | if vis.is_visible_from(db, from) { |
82 | return Some(ModPath::from_simple_segments(PathKind::Plain, vec![name.clone()])); | 82 | return Some(ModPath::from_segments(PathKind::Plain, vec![name.clone()])); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | 85 | } |
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index ebc12e891..feb3a300d 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -332,7 +332,7 @@ pub enum VariantId { | |||
332 | StructId(StructId), | 332 | StructId(StructId), |
333 | UnionId(UnionId), | 333 | UnionId(UnionId), |
334 | } | 334 | } |
335 | impl_froms!(VariantId: EnumVariantId, StructId); | 335 | impl_froms!(VariantId: EnumVariantId, StructId, UnionId); |
336 | 336 | ||
337 | trait Intern { | 337 | trait Intern { |
338 | type ID; | 338 | type ID; |
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index 4d210eab1..e1a6a46df 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs | |||
@@ -145,6 +145,13 @@ impl ModuleOrigin { | |||
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | pub fn is_inline(&self) -> bool { | ||
149 | match self { | ||
150 | ModuleOrigin::Inline { .. } => true, | ||
151 | ModuleOrigin::CrateRoot { .. } | ModuleOrigin::File { .. } => false, | ||
152 | } | ||
153 | } | ||
154 | |||
148 | /// Returns a node which defines this module. | 155 | /// Returns a node which defines this module. |
149 | /// That is, a file or a `mod foo {}` with items. | 156 | /// That is, a file or a `mod foo {}` with items. |
150 | fn definition_source(&self, db: &impl DefDatabase) -> InFile<ModuleSource> { | 157 | fn definition_source(&self, db: &impl DefDatabase) -> InFile<ModuleSource> { |
diff --git a/crates/ra_hir_def/src/path.rs b/crates/ra_hir_def/src/path.rs index 9f93a5424..ab290e2c9 100644 --- a/crates/ra_hir_def/src/path.rs +++ b/crates/ra_hir_def/src/path.rs | |||
@@ -39,10 +39,7 @@ impl ModPath { | |||
39 | lower::lower_path(path, hygiene).map(|it| it.mod_path) | 39 | lower::lower_path(path, hygiene).map(|it| it.mod_path) |
40 | } | 40 | } |
41 | 41 | ||
42 | pub fn from_simple_segments( | 42 | pub fn from_segments(kind: PathKind, segments: impl IntoIterator<Item = Name>) -> ModPath { |
43 | kind: PathKind, | ||
44 | segments: impl IntoIterator<Item = Name>, | ||
45 | ) -> ModPath { | ||
46 | let segments = segments.into_iter().collect::<Vec<_>>(); | 43 | let segments = segments.into_iter().collect::<Vec<_>>(); |
47 | ModPath { kind, segments } | 44 | ModPath { kind, segments } |
48 | } | 45 | } |
@@ -240,7 +237,7 @@ impl From<Name> for Path { | |||
240 | fn from(name: Name) -> Path { | 237 | fn from(name: Name) -> Path { |
241 | Path { | 238 | Path { |
242 | type_anchor: None, | 239 | type_anchor: None, |
243 | mod_path: ModPath::from_simple_segments(PathKind::Plain, iter::once(name)), | 240 | mod_path: ModPath::from_segments(PathKind::Plain, iter::once(name)), |
244 | generic_args: vec![None], | 241 | generic_args: vec![None], |
245 | } | 242 | } |
246 | } | 243 | } |
@@ -248,7 +245,7 @@ impl From<Name> for Path { | |||
248 | 245 | ||
249 | impl From<Name> for ModPath { | 246 | impl From<Name> for ModPath { |
250 | fn from(name: Name) -> ModPath { | 247 | fn from(name: Name) -> ModPath { |
251 | ModPath::from_simple_segments(PathKind::Plain, iter::once(name)) | 248 | ModPath::from_segments(PathKind::Plain, iter::once(name)) |
252 | } | 249 | } |
253 | } | 250 | } |
254 | 251 | ||
@@ -311,7 +308,7 @@ macro_rules! __known_path { | |||
311 | macro_rules! __path { | 308 | macro_rules! __path { |
312 | ($start:ident $(:: $seg:ident)*) => ({ | 309 | ($start:ident $(:: $seg:ident)*) => ({ |
313 | $crate::__known_path!($start $(:: $seg)*); | 310 | $crate::__known_path!($start $(:: $seg)*); |
314 | $crate::path::ModPath::from_simple_segments($crate::path::PathKind::Abs, vec![ | 311 | $crate::path::ModPath::from_segments($crate::path::PathKind::Abs, vec![ |
315 | $crate::path::__name![$start], $($crate::path::__name![$seg],)* | 312 | $crate::path::__name![$start], $($crate::path::__name![$seg],)* |
316 | ]) | 313 | ]) |
317 | }); | 314 | }); |
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs index 3218eaf0a..531878174 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/ra_hir_def/src/path/lower/lower_use.rs | |||
@@ -84,7 +84,7 @@ fn convert_path(prefix: Option<ModPath>, path: ast::Path, hygiene: &Hygiene) -> | |||
84 | res | 84 | res |
85 | } | 85 | } |
86 | Either::Right(crate_id) => { | 86 | Either::Right(crate_id) => { |
87 | return Some(ModPath::from_simple_segments( | 87 | return Some(ModPath::from_segments( |
88 | PathKind::DollarCrate(crate_id), | 88 | PathKind::DollarCrate(crate_id), |
89 | iter::empty(), | 89 | iter::empty(), |
90 | )) | 90 | )) |
@@ -95,19 +95,19 @@ fn convert_path(prefix: Option<ModPath>, path: ast::Path, hygiene: &Hygiene) -> | |||
95 | if prefix.is_some() { | 95 | if prefix.is_some() { |
96 | return None; | 96 | return None; |
97 | } | 97 | } |
98 | ModPath::from_simple_segments(PathKind::Crate, iter::empty()) | 98 | ModPath::from_segments(PathKind::Crate, iter::empty()) |
99 | } | 99 | } |
100 | ast::PathSegmentKind::SelfKw => { | 100 | ast::PathSegmentKind::SelfKw => { |
101 | if prefix.is_some() { | 101 | if prefix.is_some() { |
102 | return None; | 102 | return None; |
103 | } | 103 | } |
104 | ModPath::from_simple_segments(PathKind::Super(0), iter::empty()) | 104 | ModPath::from_segments(PathKind::Super(0), iter::empty()) |
105 | } | 105 | } |
106 | ast::PathSegmentKind::SuperKw => { | 106 | ast::PathSegmentKind::SuperKw => { |
107 | if prefix.is_some() { | 107 | if prefix.is_some() { |
108 | return None; | 108 | return None; |
109 | } | 109 | } |
110 | ModPath::from_simple_segments(PathKind::Super(1), iter::empty()) | 110 | ModPath::from_segments(PathKind::Super(1), iter::empty()) |
111 | } | 111 | } |
112 | ast::PathSegmentKind::Type { .. } => { | 112 | ast::PathSegmentKind::Type { .. } => { |
113 | // not allowed in imports | 113 | // not allowed in imports |
diff --git a/crates/ra_ide/src/assists.rs b/crates/ra_ide/src/assists.rs index e00589733..a936900da 100644 --- a/crates/ra_ide/src/assists.rs +++ b/crates/ra_ide/src/assists.rs | |||
@@ -2,27 +2,53 @@ | |||
2 | 2 | ||
3 | use ra_db::{FilePosition, FileRange}; | 3 | use ra_db::{FilePosition, FileRange}; |
4 | 4 | ||
5 | use crate::{db::RootDatabase, SourceChange, SourceFileEdit}; | 5 | use crate::{db::RootDatabase, FileId, SourceChange, SourceFileEdit}; |
6 | 6 | ||
7 | use either::Either; | ||
7 | pub use ra_assists::AssistId; | 8 | pub use ra_assists::AssistId; |
9 | use ra_assists::{AssistAction, AssistLabel}; | ||
8 | 10 | ||
9 | #[derive(Debug)] | 11 | #[derive(Debug)] |
10 | pub struct Assist { | 12 | pub struct Assist { |
11 | pub id: AssistId, | 13 | pub id: AssistId, |
12 | pub change: SourceChange, | 14 | pub label: String, |
15 | pub change_data: Either<SourceChange, Vec<SourceChange>>, | ||
13 | } | 16 | } |
14 | 17 | ||
15 | pub(crate) fn assists(db: &RootDatabase, frange: FileRange) -> Vec<Assist> { | 18 | pub(crate) fn assists(db: &RootDatabase, frange: FileRange) -> Vec<Assist> { |
16 | ra_assists::assists(db, frange) | 19 | ra_assists::assists(db, frange) |
17 | .into_iter() | 20 | .into_iter() |
18 | .map(|(label, action)| { | 21 | .map(|assist| { |
19 | let file_id = frange.file_id; | 22 | let file_id = frange.file_id; |
20 | let file_edit = SourceFileEdit { file_id, edit: action.edit }; | 23 | let assist_label = &assist.label; |
21 | let id = label.id; | 24 | Assist { |
22 | let change = SourceChange::source_file_edit(label.label, file_edit).with_cursor_opt( | 25 | id: assist_label.id, |
23 | action.cursor_position.map(|offset| FilePosition { offset, file_id }), | 26 | label: assist_label.label.clone(), |
24 | ); | 27 | change_data: match assist.action_data { |
25 | Assist { id, change } | 28 | Either::Left(action) => { |
29 | Either::Left(action_to_edit(action, file_id, assist_label)) | ||
30 | } | ||
31 | Either::Right(actions) => Either::Right( | ||
32 | actions | ||
33 | .into_iter() | ||
34 | .map(|action| action_to_edit(action, file_id, assist_label)) | ||
35 | .collect(), | ||
36 | ), | ||
37 | }, | ||
38 | } | ||
26 | }) | 39 | }) |
27 | .collect() | 40 | .collect() |
28 | } | 41 | } |
42 | |||
43 | fn action_to_edit( | ||
44 | action: AssistAction, | ||
45 | file_id: FileId, | ||
46 | assist_label: &AssistLabel, | ||
47 | ) -> SourceChange { | ||
48 | let file_edit = SourceFileEdit { file_id, edit: action.edit }; | ||
49 | SourceChange::source_file_edit( | ||
50 | action.label.unwrap_or_else(|| assist_label.label.clone()), | ||
51 | file_edit, | ||
52 | ) | ||
53 | .with_cursor_opt(action.cursor_position.map(|offset| FilePosition { offset, file_id })) | ||
54 | } | ||
diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index 324ad9552..ddc53a52b 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs | |||
@@ -34,6 +34,8 @@ pub struct FunctionSignature { | |||
34 | pub generic_parameters: Vec<String>, | 34 | pub generic_parameters: Vec<String>, |
35 | /// Parameters of the function | 35 | /// Parameters of the function |
36 | pub parameters: Vec<String>, | 36 | pub parameters: Vec<String>, |
37 | /// Parameter names of the function | ||
38 | pub parameter_names: Vec<String>, | ||
37 | /// Optional return type | 39 | /// Optional return type |
38 | pub ret_type: Option<String>, | 40 | pub ret_type: Option<String>, |
39 | /// Where predicates | 41 | /// Where predicates |
@@ -75,6 +77,7 @@ impl FunctionSignature { | |||
75 | name: node.name().map(|n| n.text().to_string()), | 77 | name: node.name().map(|n| n.text().to_string()), |
76 | ret_type: node.name().map(|n| n.text().to_string()), | 78 | ret_type: node.name().map(|n| n.text().to_string()), |
77 | parameters: params, | 79 | parameters: params, |
80 | parameter_names: vec![], | ||
78 | generic_parameters: generic_parameters(&node), | 81 | generic_parameters: generic_parameters(&node), |
79 | where_predicates: where_predicates(&node), | 82 | where_predicates: where_predicates(&node), |
80 | doc: None, | 83 | doc: None, |
@@ -114,6 +117,7 @@ impl FunctionSignature { | |||
114 | name: Some(name), | 117 | name: Some(name), |
115 | ret_type: None, | 118 | ret_type: None, |
116 | parameters: params, | 119 | parameters: params, |
120 | parameter_names: vec![], | ||
117 | generic_parameters: vec![], | 121 | generic_parameters: vec![], |
118 | where_predicates: vec![], | 122 | where_predicates: vec![], |
119 | doc: None, | 123 | doc: None, |
@@ -134,6 +138,7 @@ impl FunctionSignature { | |||
134 | name: node.name().map(|n| n.text().to_string()), | 138 | name: node.name().map(|n| n.text().to_string()), |
135 | ret_type: None, | 139 | ret_type: None, |
136 | parameters: params, | 140 | parameters: params, |
141 | parameter_names: vec![], | ||
137 | generic_parameters: vec![], | 142 | generic_parameters: vec![], |
138 | where_predicates: vec![], | 143 | where_predicates: vec![], |
139 | doc: None, | 144 | doc: None, |
@@ -157,6 +162,20 @@ impl From<&'_ ast::FnDef> for FunctionSignature { | |||
157 | res | 162 | res |
158 | } | 163 | } |
159 | 164 | ||
165 | fn param_name_list(node: &ast::FnDef) -> Vec<String> { | ||
166 | let mut res = vec![]; | ||
167 | if let Some(param_list) = node.param_list() { | ||
168 | if let Some(self_param) = param_list.self_param() { | ||
169 | res.push(self_param.syntax().text().to_string()) | ||
170 | } | ||
171 | |||
172 | res.extend(param_list.params().map(|param| { | ||
173 | param.pat().map(|pat| pat.syntax().text().to_string()).unwrap_or_default() | ||
174 | })); | ||
175 | } | ||
176 | res | ||
177 | } | ||
178 | |||
160 | FunctionSignature { | 179 | FunctionSignature { |
161 | kind: CallableKind::Function, | 180 | kind: CallableKind::Function, |
162 | visibility: node.visibility().map(|n| n.syntax().text().to_string()), | 181 | visibility: node.visibility().map(|n| n.syntax().text().to_string()), |
@@ -166,6 +185,7 @@ impl From<&'_ ast::FnDef> for FunctionSignature { | |||
166 | .and_then(|r| r.type_ref()) | 185 | .and_then(|r| r.type_ref()) |
167 | .map(|n| n.syntax().text().to_string()), | 186 | .map(|n| n.syntax().text().to_string()), |
168 | parameters: param_list(node), | 187 | parameters: param_list(node), |
188 | parameter_names: param_name_list(node), | ||
169 | generic_parameters: generic_parameters(node), | 189 | generic_parameters: generic_parameters(node), |
170 | where_predicates: where_predicates(node), | 190 | where_predicates: where_predicates(node), |
171 | // docs are processed separately | 191 | // docs are processed separately |
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs index 79d332e8c..f2b5af321 100644 --- a/crates/ra_ide/src/goto_definition.rs +++ b/crates/ra_ide/src/goto_definition.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use hir::{db::AstDatabase, InFile}; | 3 | use hir::{db::AstDatabase, InFile, SourceBinder}; |
4 | use ra_syntax::{ | 4 | use ra_syntax::{ |
5 | ast::{self, DocCommentsOwner}, | 5 | ast::{self, DocCommentsOwner}, |
6 | match_ast, AstNode, | 6 | match_ast, AstNode, |
@@ -72,7 +72,8 @@ pub(crate) fn reference_definition( | |||
72 | ) -> ReferenceResult { | 72 | ) -> ReferenceResult { |
73 | use self::ReferenceResult::*; | 73 | use self::ReferenceResult::*; |
74 | 74 | ||
75 | let name_kind = classify_name_ref(db, name_ref).map(|d| d.kind); | 75 | let mut sb = SourceBinder::new(db); |
76 | let name_kind = classify_name_ref(&mut sb, name_ref).map(|d| d.kind); | ||
76 | match name_kind { | 77 | match name_kind { |
77 | Some(Macro(it)) => return Exact(it.to_nav(db)), | 78 | Some(Macro(it)) => return Exact(it.to_nav(db)), |
78 | Some(Field(it)) => return Exact(it.to_nav(db)), | 79 | Some(Field(it)) => return Exact(it.to_nav(db)), |
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 5548681f1..6661e5cb2 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use hir::{db::AstDatabase, Adt, HasSource, HirDisplay}; | 3 | use hir::{db::AstDatabase, Adt, HasSource, HirDisplay, SourceBinder}; |
4 | use ra_db::SourceDatabase; | 4 | use ra_db::SourceDatabase; |
5 | use ra_syntax::{ | 5 | use ra_syntax::{ |
6 | algo::find_covering_element, | 6 | algo::find_covering_element, |
@@ -152,13 +152,14 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
152 | 152 | ||
153 | let mut res = HoverResult::new(); | 153 | let mut res = HoverResult::new(); |
154 | 154 | ||
155 | let mut sb = SourceBinder::new(db); | ||
155 | if let Some((range, name_kind)) = match_ast! { | 156 | if let Some((range, name_kind)) = match_ast! { |
156 | match (token.value.parent()) { | 157 | match (token.value.parent()) { |
157 | ast::NameRef(name_ref) => { | 158 | ast::NameRef(name_ref) => { |
158 | classify_name_ref(db, token.with_value(&name_ref)).map(|d| (name_ref.syntax().text_range(), d.kind)) | 159 | classify_name_ref(&mut sb, token.with_value(&name_ref)).map(|d| (name_ref.syntax().text_range(), d.kind)) |
159 | }, | 160 | }, |
160 | ast::Name(name) => { | 161 | ast::Name(name) => { |
161 | classify_name(db, token.with_value(&name)).map(|d| (name.syntax().text_range(), d.kind)) | 162 | classify_name(&mut sb, token.with_value(&name)).map(|d| (name.syntax().text_range(), d.kind)) |
162 | }, | 163 | }, |
163 | _ => None, | 164 | _ => None, |
164 | } | 165 | } |
@@ -742,7 +743,7 @@ fn func(foo: i32) { if true { <|>foo; }; } | |||
742 | } | 743 | } |
743 | fn foo(bar:u32) { | 744 | fn foo(bar:u32) { |
744 | let a = id!(ba<|>r); | 745 | let a = id!(ba<|>r); |
745 | } | 746 | } |
746 | ", | 747 | ", |
747 | &["u32"], | 748 | &["u32"], |
748 | ); | 749 | ); |
diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 977aafc51..1b631c7cd 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs | |||
@@ -1,18 +1,19 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use hir::{HirDisplay, SourceAnalyzer}; | 3 | use hir::{HirDisplay, SourceAnalyzer, SourceBinder}; |
4 | use once_cell::unsync::Lazy; | 4 | use once_cell::unsync::Lazy; |
5 | use ra_prof::profile; | 5 | use ra_prof::profile; |
6 | use ra_syntax::{ | 6 | use ra_syntax::{ |
7 | ast::{self, AstNode, TypeAscriptionOwner}, | 7 | ast::{self, ArgListOwner, AstNode, TypeAscriptionOwner}, |
8 | match_ast, SmolStr, SourceFile, SyntaxKind, SyntaxNode, TextRange, | 8 | match_ast, SmolStr, SourceFile, SyntaxKind, SyntaxNode, TextRange, |
9 | }; | 9 | }; |
10 | 10 | ||
11 | use crate::{db::RootDatabase, FileId}; | 11 | use crate::{db::RootDatabase, FileId, FunctionSignature}; |
12 | 12 | ||
13 | #[derive(Debug, PartialEq, Eq)] | 13 | #[derive(Debug, PartialEq, Eq)] |
14 | pub enum InlayKind { | 14 | pub enum InlayKind { |
15 | TypeHint, | 15 | TypeHint, |
16 | ParameterHint, | ||
16 | } | 17 | } |
17 | 18 | ||
18 | #[derive(Debug)] | 19 | #[derive(Debug)] |
@@ -28,22 +29,24 @@ pub(crate) fn inlay_hints( | |||
28 | file: &SourceFile, | 29 | file: &SourceFile, |
29 | max_inlay_hint_length: Option<usize>, | 30 | max_inlay_hint_length: Option<usize>, |
30 | ) -> Vec<InlayHint> { | 31 | ) -> Vec<InlayHint> { |
31 | file.syntax() | 32 | let mut sb = SourceBinder::new(db); |
32 | .descendants() | 33 | let mut res = Vec::new(); |
33 | .flat_map(|node| get_inlay_hints(db, file_id, &node, max_inlay_hint_length)) | 34 | for node in file.syntax().descendants() { |
34 | .flatten() | 35 | get_inlay_hints(&mut res, &mut sb, file_id, &node, max_inlay_hint_length); |
35 | .collect() | 36 | } |
37 | res | ||
36 | } | 38 | } |
37 | 39 | ||
38 | fn get_inlay_hints( | 40 | fn get_inlay_hints( |
39 | db: &RootDatabase, | 41 | acc: &mut Vec<InlayHint>, |
42 | sb: &mut SourceBinder<RootDatabase>, | ||
40 | file_id: FileId, | 43 | file_id: FileId, |
41 | node: &SyntaxNode, | 44 | node: &SyntaxNode, |
42 | max_inlay_hint_length: Option<usize>, | 45 | max_inlay_hint_length: Option<usize>, |
43 | ) -> Option<Vec<InlayHint>> { | 46 | ) -> Option<()> { |
44 | let _p = profile("get_inlay_hints"); | 47 | let _p = profile("get_inlay_hints"); |
45 | let analyzer = | 48 | let db = sb.db; |
46 | Lazy::new(|| SourceAnalyzer::new(db, hir::InFile::new(file_id.into(), node), None)); | 49 | let analyzer = Lazy::new(move || sb.analyze(hir::InFile::new(file_id.into(), node), None)); |
47 | match_ast! { | 50 | match_ast! { |
48 | match node { | 51 | match node { |
49 | ast::LetStmt(it) => { | 52 | ast::LetStmt(it) => { |
@@ -51,7 +54,7 @@ fn get_inlay_hints( | |||
51 | return None; | 54 | return None; |
52 | } | 55 | } |
53 | let pat = it.pat()?; | 56 | let pat = it.pat()?; |
54 | Some(get_pat_type_hints(db, &analyzer, pat, false, max_inlay_hint_length)) | 57 | get_pat_type_hints(acc, db, &analyzer, pat, false, max_inlay_hint_length); |
55 | }, | 58 | }, |
56 | ast::LambdaExpr(it) => { | 59 | ast::LambdaExpr(it) => { |
57 | it.param_list().map(|param_list| { | 60 | it.param_list().map(|param_list| { |
@@ -59,49 +62,115 @@ fn get_inlay_hints( | |||
59 | .params() | 62 | .params() |
60 | .filter(|closure_param| closure_param.ascribed_type().is_none()) | 63 | .filter(|closure_param| closure_param.ascribed_type().is_none()) |
61 | .filter_map(|closure_param| closure_param.pat()) | 64 | .filter_map(|closure_param| closure_param.pat()) |
62 | .map(|root_pat| get_pat_type_hints(db, &analyzer, root_pat, false, max_inlay_hint_length)) | 65 | .for_each(|root_pat| get_pat_type_hints(acc, db, &analyzer, root_pat, false, max_inlay_hint_length)) |
63 | .flatten() | 66 | }); |
64 | .collect() | ||
65 | }) | ||
66 | }, | 67 | }, |
67 | ast::ForExpr(it) => { | 68 | ast::ForExpr(it) => { |
68 | let pat = it.pat()?; | 69 | let pat = it.pat()?; |
69 | Some(get_pat_type_hints(db, &analyzer, pat, false, max_inlay_hint_length)) | 70 | get_pat_type_hints(acc, db, &analyzer, pat, false, max_inlay_hint_length); |
70 | }, | 71 | }, |
71 | ast::IfExpr(it) => { | 72 | ast::IfExpr(it) => { |
72 | let pat = it.condition()?.pat()?; | 73 | let pat = it.condition()?.pat()?; |
73 | Some(get_pat_type_hints(db, &analyzer, pat, true, max_inlay_hint_length)) | 74 | get_pat_type_hints(acc, db, &analyzer, pat, true, max_inlay_hint_length); |
74 | }, | 75 | }, |
75 | ast::WhileExpr(it) => { | 76 | ast::WhileExpr(it) => { |
76 | let pat = it.condition()?.pat()?; | 77 | let pat = it.condition()?.pat()?; |
77 | Some(get_pat_type_hints(db, &analyzer, pat, true, max_inlay_hint_length)) | 78 | get_pat_type_hints(acc, db, &analyzer, pat, true, max_inlay_hint_length); |
78 | }, | 79 | }, |
79 | ast::MatchArmList(it) => { | 80 | ast::MatchArmList(it) => { |
80 | Some( | 81 | it.arms() |
81 | it | 82 | .map(|match_arm| match_arm.pats()) |
82 | .arms() | 83 | .flatten() |
83 | .map(|match_arm| match_arm.pats()) | 84 | .for_each(|root_pat| get_pat_type_hints(acc, db, &analyzer, root_pat, true, max_inlay_hint_length)); |
84 | .flatten() | 85 | }, |
85 | .map(|root_pat| get_pat_type_hints(db, &analyzer, root_pat, true, max_inlay_hint_length)) | 86 | ast::CallExpr(it) => { |
86 | .flatten() | 87 | get_param_name_hints(acc, db, &analyzer, ast::Expr::from(it)); |
87 | .collect(), | 88 | }, |
88 | ) | 89 | ast::MethodCallExpr(it) => { |
89 | }, | 90 | get_param_name_hints(acc, db, &analyzer, ast::Expr::from(it)); |
90 | _ => None, | 91 | }, |
92 | _ => (), | ||
91 | } | 93 | } |
94 | }; | ||
95 | Some(()) | ||
96 | } | ||
97 | |||
98 | fn get_param_name_hints( | ||
99 | acc: &mut Vec<InlayHint>, | ||
100 | db: &RootDatabase, | ||
101 | analyzer: &SourceAnalyzer, | ||
102 | expr: ast::Expr, | ||
103 | ) -> Option<()> { | ||
104 | let args = match &expr { | ||
105 | ast::Expr::CallExpr(expr) => expr.arg_list()?.args(), | ||
106 | ast::Expr::MethodCallExpr(expr) => expr.arg_list()?.args(), | ||
107 | _ => return None, | ||
108 | }; | ||
109 | |||
110 | let mut parameters = get_fn_signature(db, analyzer, &expr)?.parameter_names.into_iter(); | ||
111 | |||
112 | if let ast::Expr::MethodCallExpr(_) = &expr { | ||
113 | parameters.next(); | ||
114 | }; | ||
115 | |||
116 | let hints = parameters | ||
117 | .zip(args) | ||
118 | .filter_map(|(param, arg)| { | ||
119 | if arg.syntax().kind() == SyntaxKind::LITERAL { | ||
120 | Some((arg.syntax().text_range(), param)) | ||
121 | } else { | ||
122 | None | ||
123 | } | ||
124 | }) | ||
125 | .map(|(range, param_name)| InlayHint { | ||
126 | range, | ||
127 | kind: InlayKind::ParameterHint, | ||
128 | label: param_name.into(), | ||
129 | }); | ||
130 | |||
131 | acc.extend(hints); | ||
132 | Some(()) | ||
133 | } | ||
134 | |||
135 | fn get_fn_signature( | ||
136 | db: &RootDatabase, | ||
137 | analyzer: &SourceAnalyzer, | ||
138 | expr: &ast::Expr, | ||
139 | ) -> Option<FunctionSignature> { | ||
140 | match expr { | ||
141 | ast::Expr::CallExpr(expr) => { | ||
142 | // FIXME: Type::as_callable is broken for closures | ||
143 | let callable_def = analyzer.type_of(db, &expr.expr()?)?.as_callable()?; | ||
144 | match callable_def { | ||
145 | hir::CallableDef::FunctionId(it) => { | ||
146 | let fn_def = it.into(); | ||
147 | Some(FunctionSignature::from_hir(db, fn_def)) | ||
148 | } | ||
149 | hir::CallableDef::StructId(it) => FunctionSignature::from_struct(db, it.into()), | ||
150 | hir::CallableDef::EnumVariantId(it) => { | ||
151 | FunctionSignature::from_enum_variant(db, it.into()) | ||
152 | } | ||
153 | } | ||
154 | } | ||
155 | ast::Expr::MethodCallExpr(expr) => { | ||
156 | let fn_def = analyzer.resolve_method_call(&expr)?; | ||
157 | Some(FunctionSignature::from_hir(db, fn_def)) | ||
158 | } | ||
159 | _ => None, | ||
92 | } | 160 | } |
93 | } | 161 | } |
94 | 162 | ||
95 | fn get_pat_type_hints( | 163 | fn get_pat_type_hints( |
164 | acc: &mut Vec<InlayHint>, | ||
96 | db: &RootDatabase, | 165 | db: &RootDatabase, |
97 | analyzer: &SourceAnalyzer, | 166 | analyzer: &SourceAnalyzer, |
98 | root_pat: ast::Pat, | 167 | root_pat: ast::Pat, |
99 | skip_root_pat_hint: bool, | 168 | skip_root_pat_hint: bool, |
100 | max_inlay_hint_length: Option<usize>, | 169 | max_inlay_hint_length: Option<usize>, |
101 | ) -> Vec<InlayHint> { | 170 | ) { |
102 | let original_pat = &root_pat.clone(); | 171 | let original_pat = &root_pat.clone(); |
103 | 172 | ||
104 | get_leaf_pats(root_pat) | 173 | let hints = get_leaf_pats(root_pat) |
105 | .into_iter() | 174 | .into_iter() |
106 | .filter(|pat| !skip_root_pat_hint || pat != original_pat) | 175 | .filter(|pat| !skip_root_pat_hint || pat != original_pat) |
107 | .filter_map(|pat| { | 176 | .filter_map(|pat| { |
@@ -115,8 +184,9 @@ fn get_pat_type_hints( | |||
115 | range, | 184 | range, |
116 | kind: InlayKind::TypeHint, | 185 | kind: InlayKind::TypeHint, |
117 | label: pat_type.display_truncated(db, max_inlay_hint_length).to_string().into(), | 186 | label: pat_type.display_truncated(db, max_inlay_hint_length).to_string().into(), |
118 | }) | 187 | }); |
119 | .collect() | 188 | |
189 | acc.extend(hints); | ||
120 | } | 190 | } |
121 | 191 | ||
122 | fn get_leaf_pats(root_pat: ast::Pat) -> Vec<ast::Pat> { | 192 | fn get_leaf_pats(root_pat: ast::Pat) -> Vec<ast::Pat> { |
@@ -605,4 +675,71 @@ fn main() { | |||
605 | "### | 675 | "### |
606 | ); | 676 | ); |
607 | } | 677 | } |
678 | |||
679 | #[test] | ||
680 | fn function_call_parameter_hint() { | ||
681 | let (analysis, file_id) = single_file( | ||
682 | r#" | ||
683 | struct Test {} | ||
684 | |||
685 | impl Test { | ||
686 | fn method(&self, param: i32) -> i32 { | ||
687 | param * 2 | ||
688 | } | ||
689 | } | ||
690 | |||
691 | fn test_func(foo: i32, bar: i32, msg: &str, _: i32, last: i32) -> i32 { | ||
692 | foo + bar | ||
693 | } | ||
694 | |||
695 | fn main() { | ||
696 | let not_literal = 1; | ||
697 | let _: i32 = test_func(1, 2, "hello", 3, not_literal); | ||
698 | let t: Test = Test {}; | ||
699 | t.method(123); | ||
700 | Test::method(&t, 3456); | ||
701 | }"#, | ||
702 | ); | ||
703 | |||
704 | assert_debug_snapshot!(analysis.inlay_hints(file_id, None).unwrap(), @r###" | ||
705 | [ | ||
706 | InlayHint { | ||
707 | range: [207; 218), | ||
708 | kind: TypeHint, | ||
709 | label: "i32", | ||
710 | }, | ||
711 | InlayHint { | ||
712 | range: [251; 252), | ||
713 | kind: ParameterHint, | ||
714 | label: "foo", | ||
715 | }, | ||
716 | InlayHint { | ||
717 | range: [254; 255), | ||
718 | kind: ParameterHint, | ||
719 | label: "bar", | ||
720 | }, | ||
721 | InlayHint { | ||
722 | range: [257; 264), | ||
723 | kind: ParameterHint, | ||
724 | label: "msg", | ||
725 | }, | ||
726 | InlayHint { | ||
727 | range: [266; 267), | ||
728 | kind: ParameterHint, | ||
729 | label: "_", | ||
730 | }, | ||
731 | InlayHint { | ||
732 | range: [323; 326), | ||
733 | kind: ParameterHint, | ||
734 | label: "param", | ||
735 | }, | ||
736 | InlayHint { | ||
737 | range: [350; 354), | ||
738 | kind: ParameterHint, | ||
739 | label: "param", | ||
740 | }, | ||
741 | ] | ||
742 | "### | ||
743 | ); | ||
744 | } | ||
608 | } | 745 | } |
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 2c753dade..5e2fe1905 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
@@ -14,7 +14,7 @@ mod name_definition; | |||
14 | mod rename; | 14 | mod rename; |
15 | mod search_scope; | 15 | mod search_scope; |
16 | 16 | ||
17 | use hir::InFile; | 17 | use hir::{InFile, SourceBinder}; |
18 | use once_cell::unsync::Lazy; | 18 | use once_cell::unsync::Lazy; |
19 | use ra_db::{SourceDatabase, SourceDatabaseExt}; | 19 | use ra_db::{SourceDatabase, SourceDatabaseExt}; |
20 | use ra_prof::profile; | 20 | use ra_prof::profile; |
@@ -171,13 +171,14 @@ fn find_name( | |||
171 | syntax: &SyntaxNode, | 171 | syntax: &SyntaxNode, |
172 | position: FilePosition, | 172 | position: FilePosition, |
173 | ) -> Option<RangeInfo<(String, NameDefinition)>> { | 173 | ) -> Option<RangeInfo<(String, NameDefinition)>> { |
174 | let mut sb = SourceBinder::new(db); | ||
174 | if let Some(name) = find_node_at_offset::<ast::Name>(&syntax, position.offset) { | 175 | if let Some(name) = find_node_at_offset::<ast::Name>(&syntax, position.offset) { |
175 | let def = classify_name(db, InFile::new(position.file_id.into(), &name))?; | 176 | let def = classify_name(&mut sb, InFile::new(position.file_id.into(), &name))?; |
176 | let range = name.syntax().text_range(); | 177 | let range = name.syntax().text_range(); |
177 | return Some(RangeInfo::new(range, (name.text().to_string(), def))); | 178 | return Some(RangeInfo::new(range, (name.text().to_string(), def))); |
178 | } | 179 | } |
179 | let name_ref = find_node_at_offset::<ast::NameRef>(&syntax, position.offset)?; | 180 | let name_ref = find_node_at_offset::<ast::NameRef>(&syntax, position.offset)?; |
180 | let def = classify_name_ref(db, InFile::new(position.file_id.into(), &name_ref))?; | 181 | let def = classify_name_ref(&mut sb, InFile::new(position.file_id.into(), &name_ref))?; |
181 | let range = name_ref.syntax().text_range(); | 182 | let range = name_ref.syntax().text_range(); |
182 | Some(RangeInfo::new(range, (name_ref.text().to_string(), def))) | 183 | Some(RangeInfo::new(range, (name_ref.text().to_string(), def))) |
183 | } | 184 | } |
@@ -195,7 +196,9 @@ fn process_definition( | |||
195 | 196 | ||
196 | for (file_id, search_range) in scope { | 197 | for (file_id, search_range) in scope { |
197 | let text = db.file_text(file_id); | 198 | let text = db.file_text(file_id); |
199 | |||
198 | let parse = Lazy::new(|| SourceFile::parse(&text)); | 200 | let parse = Lazy::new(|| SourceFile::parse(&text)); |
201 | let mut sb = Lazy::new(|| SourceBinder::new(db)); | ||
199 | 202 | ||
200 | for (idx, _) in text.match_indices(pat) { | 203 | for (idx, _) in text.match_indices(pat) { |
201 | let offset = TextUnit::from_usize(idx); | 204 | let offset = TextUnit::from_usize(idx); |
@@ -209,7 +212,11 @@ fn process_definition( | |||
209 | continue; | 212 | continue; |
210 | } | 213 | } |
211 | } | 214 | } |
212 | if let Some(d) = classify_name_ref(db, InFile::new(file_id.into(), &name_ref)) { | 215 | // FIXME: reuse sb |
216 | // See https://github.com/rust-lang/rust/pull/68198#issuecomment-574269098 | ||
217 | |||
218 | if let Some(d) = classify_name_ref(&mut sb, InFile::new(file_id.into(), &name_ref)) | ||
219 | { | ||
213 | if d == def { | 220 | if d == def { |
214 | let kind = if name_ref | 221 | let kind = if name_ref |
215 | .syntax() | 222 | .syntax() |
@@ -309,7 +316,7 @@ mod tests { | |||
309 | } | 316 | } |
310 | impl Foo { | 317 | impl Foo { |
311 | fn f() -> i32 { 42 } | 318 | fn f() -> i32 { 42 } |
312 | } | 319 | } |
313 | fn main() { | 320 | fn main() { |
314 | let f: Foo; | 321 | let f: Foo; |
315 | f = Foo {a: Foo::f()}; | 322 | f = Foo {a: Foo::f()}; |
@@ -319,7 +326,7 @@ mod tests { | |||
319 | check_result( | 326 | check_result( |
320 | refs, | 327 | refs, |
321 | "Foo STRUCT_DEF FileId(1) [5; 39) [12; 15) Other", | 328 | "Foo STRUCT_DEF FileId(1) [5; 39) [12; 15) Other", |
322 | &["FileId(1) [142; 145) StructLiteral"], | 329 | &["FileId(1) [138; 141) StructLiteral"], |
323 | ); | 330 | ); |
324 | } | 331 | } |
325 | 332 | ||
diff --git a/crates/ra_ide/src/references/classify.rs b/crates/ra_ide/src/references/classify.rs index 3483a7176..4a6e11e27 100644 --- a/crates/ra_ide/src/references/classify.rs +++ b/crates/ra_ide/src/references/classify.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! Functions that are used to classify an element from its definition or reference. | 1 | //! Functions that are used to classify an element from its definition or reference. |
2 | 2 | ||
3 | use hir::{FromSource, InFile, Module, ModuleSource, PathResolution, SourceAnalyzer}; | 3 | use hir::{FromSource, InFile, Module, ModuleSource, PathResolution, SourceBinder}; |
4 | use ra_prof::profile; | 4 | use ra_prof::profile; |
5 | use ra_syntax::{ast, match_ast, AstNode}; | 5 | use ra_syntax::{ast, match_ast, AstNode}; |
6 | use test_utils::tested_by; | 6 | use test_utils::tested_by; |
@@ -11,7 +11,10 @@ use super::{ | |||
11 | }; | 11 | }; |
12 | use crate::db::RootDatabase; | 12 | use crate::db::RootDatabase; |
13 | 13 | ||
14 | pub(crate) fn classify_name(db: &RootDatabase, name: InFile<&ast::Name>) -> Option<NameDefinition> { | 14 | pub(crate) fn classify_name( |
15 | sb: &mut SourceBinder<RootDatabase>, | ||
16 | name: InFile<&ast::Name>, | ||
17 | ) -> Option<NameDefinition> { | ||
15 | let _p = profile("classify_name"); | 18 | let _p = profile("classify_name"); |
16 | let parent = name.value.syntax().parent()?; | 19 | let parent = name.value.syntax().parent()?; |
17 | 20 | ||
@@ -19,90 +22,89 @@ pub(crate) fn classify_name(db: &RootDatabase, name: InFile<&ast::Name>) -> Opti | |||
19 | match parent { | 22 | match parent { |
20 | ast::BindPat(it) => { | 23 | ast::BindPat(it) => { |
21 | let src = name.with_value(it); | 24 | let src = name.with_value(it); |
22 | let local = hir::Local::from_source(db, src)?; | 25 | let local = hir::Local::from_source(sb.db, src)?; |
23 | Some(NameDefinition { | 26 | Some(NameDefinition { |
24 | visibility: None, | 27 | visibility: None, |
25 | container: local.module(db), | 28 | container: local.module(sb.db), |
26 | kind: NameKind::Local(local), | 29 | kind: NameKind::Local(local), |
27 | }) | 30 | }) |
28 | }, | 31 | }, |
29 | ast::RecordFieldDef(it) => { | 32 | ast::RecordFieldDef(it) => { |
30 | let ast = hir::FieldSource::Named(it); | 33 | let src = name.with_value(it); |
31 | let src = name.with_value(ast); | 34 | let field: hir::StructField = sb.to_def(src)?; |
32 | let field = hir::StructField::from_source(db, src)?; | 35 | Some(from_struct_field(sb.db, field)) |
33 | Some(from_struct_field(db, field)) | ||
34 | }, | 36 | }, |
35 | ast::Module(it) => { | 37 | ast::Module(it) => { |
36 | let def = { | 38 | let def = { |
37 | if !it.has_semi() { | 39 | if !it.has_semi() { |
38 | let ast = hir::ModuleSource::Module(it); | 40 | let ast = hir::ModuleSource::Module(it); |
39 | let src = name.with_value(ast); | 41 | let src = name.with_value(ast); |
40 | hir::Module::from_definition(db, src) | 42 | hir::Module::from_definition(sb.db, src) |
41 | } else { | 43 | } else { |
42 | let src = name.with_value(it); | 44 | let src = name.with_value(it); |
43 | hir::Module::from_declaration(db, src) | 45 | hir::Module::from_declaration(sb.db, src) |
44 | } | 46 | } |
45 | }?; | 47 | }?; |
46 | Some(from_module_def(db, def.into(), None)) | 48 | Some(from_module_def(sb.db, def.into(), None)) |
47 | }, | 49 | }, |
48 | ast::StructDef(it) => { | 50 | ast::StructDef(it) => { |
49 | let src = name.with_value(it); | 51 | let src = name.with_value(it); |
50 | let def = hir::Struct::from_source(db, src)?; | 52 | let def: hir::Struct = sb.to_def(src)?; |
51 | Some(from_module_def(db, def.into(), None)) | 53 | Some(from_module_def(sb.db, def.into(), None)) |
52 | }, | 54 | }, |
53 | ast::EnumDef(it) => { | 55 | ast::EnumDef(it) => { |
54 | let src = name.with_value(it); | 56 | let src = name.with_value(it); |
55 | let def = hir::Enum::from_source(db, src)?; | 57 | let def: hir::Enum = sb.to_def(src)?; |
56 | Some(from_module_def(db, def.into(), None)) | 58 | Some(from_module_def(sb.db, def.into(), None)) |
57 | }, | 59 | }, |
58 | ast::TraitDef(it) => { | 60 | ast::TraitDef(it) => { |
59 | let src = name.with_value(it); | 61 | let src = name.with_value(it); |
60 | let def = hir::Trait::from_source(db, src)?; | 62 | let def: hir::Trait = sb.to_def(src)?; |
61 | Some(from_module_def(db, def.into(), None)) | 63 | Some(from_module_def(sb.db, def.into(), None)) |
62 | }, | 64 | }, |
63 | ast::StaticDef(it) => { | 65 | ast::StaticDef(it) => { |
64 | let src = name.with_value(it); | 66 | let src = name.with_value(it); |
65 | let def = hir::Static::from_source(db, src)?; | 67 | let def: hir::Static = sb.to_def(src)?; |
66 | Some(from_module_def(db, def.into(), None)) | 68 | Some(from_module_def(sb.db, def.into(), None)) |
67 | }, | 69 | }, |
68 | ast::EnumVariant(it) => { | 70 | ast::EnumVariant(it) => { |
69 | let src = name.with_value(it); | 71 | let src = name.with_value(it); |
70 | let def = hir::EnumVariant::from_source(db, src)?; | 72 | let def: hir::EnumVariant = sb.to_def(src)?; |
71 | Some(from_module_def(db, def.into(), None)) | 73 | Some(from_module_def(sb.db, def.into(), None)) |
72 | }, | 74 | }, |
73 | ast::FnDef(it) => { | 75 | ast::FnDef(it) => { |
74 | let src = name.with_value(it); | 76 | let src = name.with_value(it); |
75 | let def = hir::Function::from_source(db, src)?; | 77 | let def: hir::Function = sb.to_def(src)?; |
76 | if parent.parent().and_then(ast::ItemList::cast).is_some() { | 78 | if parent.parent().and_then(ast::ItemList::cast).is_some() { |
77 | Some(from_assoc_item(db, def.into())) | 79 | Some(from_assoc_item(sb.db, def.into())) |
78 | } else { | 80 | } else { |
79 | Some(from_module_def(db, def.into(), None)) | 81 | Some(from_module_def(sb.db, def.into(), None)) |
80 | } | 82 | } |
81 | }, | 83 | }, |
82 | ast::ConstDef(it) => { | 84 | ast::ConstDef(it) => { |
83 | let src = name.with_value(it); | 85 | let src = name.with_value(it); |
84 | let def = hir::Const::from_source(db, src)?; | 86 | let def: hir::Const = sb.to_def(src)?; |
85 | if parent.parent().and_then(ast::ItemList::cast).is_some() { | 87 | if parent.parent().and_then(ast::ItemList::cast).is_some() { |
86 | Some(from_assoc_item(db, def.into())) | 88 | Some(from_assoc_item(sb.db, def.into())) |
87 | } else { | 89 | } else { |
88 | Some(from_module_def(db, def.into(), None)) | 90 | Some(from_module_def(sb.db, def.into(), None)) |
89 | } | 91 | } |
90 | }, | 92 | }, |
91 | ast::TypeAliasDef(it) => { | 93 | ast::TypeAliasDef(it) => { |
92 | let src = name.with_value(it); | 94 | let src = name.with_value(it); |
93 | let def = hir::TypeAlias::from_source(db, src)?; | 95 | let def: hir::TypeAlias = sb.to_def(src)?; |
94 | if parent.parent().and_then(ast::ItemList::cast).is_some() { | 96 | if parent.parent().and_then(ast::ItemList::cast).is_some() { |
95 | Some(from_assoc_item(db, def.into())) | 97 | Some(from_assoc_item(sb.db, def.into())) |
96 | } else { | 98 | } else { |
97 | Some(from_module_def(db, def.into(), None)) | 99 | Some(from_module_def(sb.db, def.into(), None)) |
98 | } | 100 | } |
99 | }, | 101 | }, |
100 | ast::MacroCall(it) => { | 102 | ast::MacroCall(it) => { |
101 | let src = name.with_value(it); | 103 | let src = name.with_value(it); |
102 | let def = hir::MacroDef::from_source(db, src.clone())?; | 104 | let def = hir::MacroDef::from_source(sb.db, src.clone())?; |
103 | 105 | ||
104 | let module_src = ModuleSource::from_child_node(db, src.as_ref().map(|it| it.syntax())); | 106 | let module_src = ModuleSource::from_child_node(sb.db, src.as_ref().map(|it| it.syntax())); |
105 | let module = Module::from_definition(db, src.with_value(module_src))?; | 107 | let module = Module::from_definition(sb.db, src.with_value(module_src))?; |
106 | 108 | ||
107 | Some(NameDefinition { | 109 | Some(NameDefinition { |
108 | visibility: None, | 110 | visibility: None, |
@@ -112,10 +114,10 @@ pub(crate) fn classify_name(db: &RootDatabase, name: InFile<&ast::Name>) -> Opti | |||
112 | }, | 114 | }, |
113 | ast::TypeParam(it) => { | 115 | ast::TypeParam(it) => { |
114 | let src = name.with_value(it); | 116 | let src = name.with_value(it); |
115 | let def = hir::TypeParam::from_source(db, src)?; | 117 | let def = hir::TypeParam::from_source(sb.db, src)?; |
116 | Some(NameDefinition { | 118 | Some(NameDefinition { |
117 | visibility: None, | 119 | visibility: None, |
118 | container: def.module(db), | 120 | container: def.module(sb.db), |
119 | kind: NameKind::TypeParam(def), | 121 | kind: NameKind::TypeParam(def), |
120 | }) | 122 | }) |
121 | }, | 123 | }, |
@@ -125,25 +127,25 @@ pub(crate) fn classify_name(db: &RootDatabase, name: InFile<&ast::Name>) -> Opti | |||
125 | } | 127 | } |
126 | 128 | ||
127 | pub(crate) fn classify_name_ref( | 129 | pub(crate) fn classify_name_ref( |
128 | db: &RootDatabase, | 130 | sb: &mut SourceBinder<RootDatabase>, |
129 | name_ref: InFile<&ast::NameRef>, | 131 | name_ref: InFile<&ast::NameRef>, |
130 | ) -> Option<NameDefinition> { | 132 | ) -> Option<NameDefinition> { |
131 | let _p = profile("classify_name_ref"); | 133 | let _p = profile("classify_name_ref"); |
132 | 134 | ||
133 | let parent = name_ref.value.syntax().parent()?; | 135 | let parent = name_ref.value.syntax().parent()?; |
134 | let analyzer = SourceAnalyzer::new(db, name_ref.map(|it| it.syntax()), None); | 136 | let analyzer = sb.analyze(name_ref.map(|it| it.syntax()), None); |
135 | 137 | ||
136 | if let Some(method_call) = ast::MethodCallExpr::cast(parent.clone()) { | 138 | if let Some(method_call) = ast::MethodCallExpr::cast(parent.clone()) { |
137 | tested_by!(goto_def_for_methods); | 139 | tested_by!(goto_def_for_methods); |
138 | if let Some(func) = analyzer.resolve_method_call(&method_call) { | 140 | if let Some(func) = analyzer.resolve_method_call(&method_call) { |
139 | return Some(from_assoc_item(db, func.into())); | 141 | return Some(from_assoc_item(sb.db, func.into())); |
140 | } | 142 | } |
141 | } | 143 | } |
142 | 144 | ||
143 | if let Some(field_expr) = ast::FieldExpr::cast(parent.clone()) { | 145 | if let Some(field_expr) = ast::FieldExpr::cast(parent.clone()) { |
144 | tested_by!(goto_def_for_fields); | 146 | tested_by!(goto_def_for_fields); |
145 | if let Some(field) = analyzer.resolve_field(&field_expr) { | 147 | if let Some(field) = analyzer.resolve_field(&field_expr) { |
146 | return Some(from_struct_field(db, field)); | 148 | return Some(from_struct_field(sb.db, field)); |
147 | } | 149 | } |
148 | } | 150 | } |
149 | 151 | ||
@@ -151,30 +153,32 @@ pub(crate) fn classify_name_ref( | |||
151 | tested_by!(goto_def_for_record_fields); | 153 | tested_by!(goto_def_for_record_fields); |
152 | tested_by!(goto_def_for_field_init_shorthand); | 154 | tested_by!(goto_def_for_field_init_shorthand); |
153 | if let Some(field_def) = analyzer.resolve_record_field(&record_field) { | 155 | if let Some(field_def) = analyzer.resolve_record_field(&record_field) { |
154 | return Some(from_struct_field(db, field_def)); | 156 | return Some(from_struct_field(sb.db, field_def)); |
155 | } | 157 | } |
156 | } | 158 | } |
157 | 159 | ||
158 | let ast = ModuleSource::from_child_node(db, name_ref.with_value(&parent)); | 160 | let ast = ModuleSource::from_child_node(sb.db, name_ref.with_value(&parent)); |
159 | // FIXME: find correct container and visibility for each case | 161 | // FIXME: find correct container and visibility for each case |
160 | let container = Module::from_definition(db, name_ref.with_value(ast))?; | 162 | let container = Module::from_definition(sb.db, name_ref.with_value(ast))?; |
161 | let visibility = None; | 163 | let visibility = None; |
162 | 164 | ||
163 | if let Some(macro_call) = parent.ancestors().find_map(ast::MacroCall::cast) { | 165 | if let Some(macro_call) = parent.ancestors().find_map(ast::MacroCall::cast) { |
164 | tested_by!(goto_def_for_macros); | 166 | tested_by!(goto_def_for_macros); |
165 | if let Some(macro_def) = analyzer.resolve_macro_call(db, name_ref.with_value(¯o_call)) { | 167 | if let Some(macro_def) = |
168 | analyzer.resolve_macro_call(sb.db, name_ref.with_value(¯o_call)) | ||
169 | { | ||
166 | let kind = NameKind::Macro(macro_def); | 170 | let kind = NameKind::Macro(macro_def); |
167 | return Some(NameDefinition { kind, container, visibility }); | 171 | return Some(NameDefinition { kind, container, visibility }); |
168 | } | 172 | } |
169 | } | 173 | } |
170 | 174 | ||
171 | let path = name_ref.value.syntax().ancestors().find_map(ast::Path::cast)?; | 175 | let path = name_ref.value.syntax().ancestors().find_map(ast::Path::cast)?; |
172 | let resolved = analyzer.resolve_path(db, &path)?; | 176 | let resolved = analyzer.resolve_path(sb.db, &path)?; |
173 | match resolved { | 177 | match resolved { |
174 | PathResolution::Def(def) => Some(from_module_def(db, def, Some(container))), | 178 | PathResolution::Def(def) => Some(from_module_def(sb.db, def, Some(container))), |
175 | PathResolution::AssocItem(item) => Some(from_assoc_item(db, item)), | 179 | PathResolution::AssocItem(item) => Some(from_assoc_item(sb.db, item)), |
176 | PathResolution::Local(local) => { | 180 | PathResolution::Local(local) => { |
177 | let container = local.module(db); | 181 | let container = local.module(sb.db); |
178 | let kind = NameKind::Local(local); | 182 | let kind = NameKind::Local(local); |
179 | Some(NameDefinition { kind, container, visibility: None }) | 183 | Some(NameDefinition { kind, container, visibility: None }) |
180 | } | 184 | } |
@@ -188,7 +192,7 @@ pub(crate) fn classify_name_ref( | |||
188 | } | 192 | } |
189 | PathResolution::SelfType(impl_block) => { | 193 | PathResolution::SelfType(impl_block) => { |
190 | let kind = NameKind::SelfType(impl_block); | 194 | let kind = NameKind::SelfType(impl_block); |
191 | let container = impl_block.module(db); | 195 | let container = impl_block.module(sb.db); |
192 | Some(NameDefinition { kind, container, visibility }) | 196 | Some(NameDefinition { kind, container, visibility }) |
193 | } | 197 | } |
194 | } | 198 | } |
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 56a36f587..0411977b9 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use rustc_hash::{FxHashMap, FxHashSet}; | 3 | use rustc_hash::{FxHashMap, FxHashSet}; |
4 | 4 | ||
5 | use hir::{InFile, Name}; | 5 | use hir::{InFile, Name, SourceBinder}; |
6 | use ra_db::SourceDatabase; | 6 | use ra_db::SourceDatabase; |
7 | use ra_prof::profile; | 7 | use ra_prof::profile; |
8 | use ra_syntax::{ast, AstNode, Direction, SyntaxElement, SyntaxKind, SyntaxKind::*, TextRange, T}; | 8 | use ra_syntax::{ast, AstNode, Direction, SyntaxElement, SyntaxKind, SyntaxKind::*, TextRange, T}; |
@@ -84,6 +84,8 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa | |||
84 | hash((file_id, name, shadow_count)) | 84 | hash((file_id, name, shadow_count)) |
85 | } | 85 | } |
86 | 86 | ||
87 | let mut sb = SourceBinder::new(db); | ||
88 | |||
87 | // Visited nodes to handle highlighting priorities | 89 | // Visited nodes to handle highlighting priorities |
88 | // FIXME: retain only ranges here | 90 | // FIXME: retain only ranges here |
89 | let mut highlighted: FxHashSet<SyntaxElement> = FxHashSet::default(); | 91 | let mut highlighted: FxHashSet<SyntaxElement> = FxHashSet::default(); |
@@ -108,8 +110,8 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa | |||
108 | NAME_REF if node.ancestors().any(|it| it.kind() == ATTR) => continue, | 110 | NAME_REF if node.ancestors().any(|it| it.kind() == ATTR) => continue, |
109 | NAME_REF => { | 111 | NAME_REF => { |
110 | let name_ref = node.as_node().cloned().and_then(ast::NameRef::cast).unwrap(); | 112 | let name_ref = node.as_node().cloned().and_then(ast::NameRef::cast).unwrap(); |
111 | let name_kind = | 113 | let name_kind = classify_name_ref(&mut sb, InFile::new(file_id.into(), &name_ref)) |
112 | classify_name_ref(db, InFile::new(file_id.into(), &name_ref)).map(|d| d.kind); | 114 | .map(|d| d.kind); |
113 | match name_kind { | 115 | match name_kind { |
114 | Some(name_kind) => { | 116 | Some(name_kind) => { |
115 | if let Local(local) = &name_kind { | 117 | if let Local(local) = &name_kind { |
@@ -129,7 +131,7 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa | |||
129 | NAME => { | 131 | NAME => { |
130 | let name = node.as_node().cloned().and_then(ast::Name::cast).unwrap(); | 132 | let name = node.as_node().cloned().and_then(ast::Name::cast).unwrap(); |
131 | let name_kind = | 133 | let name_kind = |
132 | classify_name(db, InFile::new(file_id.into(), &name)).map(|d| d.kind); | 134 | classify_name(&mut sb, InFile::new(file_id.into(), &name)).map(|d| d.kind); |
133 | 135 | ||
134 | if let Some(Local(local)) = &name_kind { | 136 | if let Some(Local(local)) = &name_kind { |
135 | if let Some(name) = local.name(db) { | 137 | if let Some(name) = local.name(db) { |
@@ -308,9 +310,12 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
308 | 310 | ||
309 | #[cfg(test)] | 311 | #[cfg(test)] |
310 | mod tests { | 312 | mod tests { |
311 | use crate::mock_analysis::single_file; | 313 | use std::fs; |
314 | |||
312 | use test_utils::{assert_eq_text, project_dir, read_text}; | 315 | use test_utils::{assert_eq_text, project_dir, read_text}; |
313 | 316 | ||
317 | use crate::mock_analysis::{single_file, MockAnalysis}; | ||
318 | |||
314 | #[test] | 319 | #[test] |
315 | fn test_highlighting() { | 320 | fn test_highlighting() { |
316 | let (analysis, file_id) = single_file( | 321 | let (analysis, file_id) = single_file( |
@@ -357,7 +362,7 @@ impl<X> E<X> { | |||
357 | let dst_file = project_dir().join("crates/ra_ide/src/snapshots/highlighting.html"); | 362 | let dst_file = project_dir().join("crates/ra_ide/src/snapshots/highlighting.html"); |
358 | let actual_html = &analysis.highlight_as_html(file_id, false).unwrap(); | 363 | let actual_html = &analysis.highlight_as_html(file_id, false).unwrap(); |
359 | let expected_html = &read_text(&dst_file); | 364 | let expected_html = &read_text(&dst_file); |
360 | std::fs::write(dst_file, &actual_html).unwrap(); | 365 | fs::write(dst_file, &actual_html).unwrap(); |
361 | assert_eq_text!(expected_html, actual_html); | 366 | assert_eq_text!(expected_html, actual_html); |
362 | } | 367 | } |
363 | 368 | ||
@@ -383,7 +388,21 @@ fn bar() { | |||
383 | let dst_file = project_dir().join("crates/ra_ide/src/snapshots/rainbow_highlighting.html"); | 388 | let dst_file = project_dir().join("crates/ra_ide/src/snapshots/rainbow_highlighting.html"); |
384 | let actual_html = &analysis.highlight_as_html(file_id, true).unwrap(); | 389 | let actual_html = &analysis.highlight_as_html(file_id, true).unwrap(); |
385 | let expected_html = &read_text(&dst_file); | 390 | let expected_html = &read_text(&dst_file); |
386 | std::fs::write(dst_file, &actual_html).unwrap(); | 391 | fs::write(dst_file, &actual_html).unwrap(); |
387 | assert_eq_text!(expected_html, actual_html); | 392 | assert_eq_text!(expected_html, actual_html); |
388 | } | 393 | } |
394 | |||
395 | #[test] | ||
396 | fn accidentally_quadratic() { | ||
397 | let file = project_dir().join("crates/ra_syntax/test_data/accidentally_quadratic"); | ||
398 | let src = fs::read_to_string(file).unwrap(); | ||
399 | |||
400 | let mut mock = MockAnalysis::new(); | ||
401 | let file_id = mock.add_file("/main.rs", &src); | ||
402 | let host = mock.analysis_host(); | ||
403 | |||
404 | // let t = std::time::Instant::now(); | ||
405 | let _ = host.analysis().highlight(file_id).unwrap(); | ||
406 | // eprintln!("elapsed: {:?}", t.elapsed()); | ||
407 | } | ||
389 | } | 408 | } |
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index cdde5122e..579158780 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml | |||
@@ -14,7 +14,7 @@ serde_json = "1.0.34" | |||
14 | serde = { version = "1.0.83", features = ["derive"] } | 14 | serde = { version = "1.0.83", features = ["derive"] } |
15 | crossbeam-channel = "0.4" | 15 | crossbeam-channel = "0.4" |
16 | log = "0.4.3" | 16 | log = "0.4.3" |
17 | lsp-types = { version = "0.68.0", features = ["proposed"] } | 17 | lsp-types = { version = "0.69.0", features = ["proposed"] } |
18 | rustc-hash = "1.0" | 18 | rustc-hash = "1.0" |
19 | parking_lot = "0.10.0" | 19 | parking_lot = "0.10.0" |
20 | jod-thread = "0.1.0" | 20 | jod-thread = "0.1.0" |
@@ -28,6 +28,7 @@ ra_prof = { path = "../ra_prof" } | |||
28 | ra_vfs_glob = { path = "../ra_vfs_glob" } | 28 | ra_vfs_glob = { path = "../ra_vfs_glob" } |
29 | env_logger = { version = "0.7.1", default-features = false, features = ["humantime"] } | 29 | env_logger = { version = "0.7.1", default-features = false, features = ["humantime"] } |
30 | ra_cargo_watch = { path = "../ra_cargo_watch" } | 30 | ra_cargo_watch = { path = "../ra_cargo_watch" } |
31 | either = "1.5" | ||
31 | 32 | ||
32 | [dev-dependencies] | 33 | [dev-dependencies] |
33 | tempfile = "3" | 34 | tempfile = "3" |
diff --git a/crates/ra_lsp_server/src/cargo_target_spec.rs b/crates/ra_lsp_server/src/cargo_target_spec.rs index c4a9e7101..594caffe2 100644 --- a/crates/ra_lsp_server/src/cargo_target_spec.rs +++ b/crates/ra_lsp_server/src/cargo_target_spec.rs | |||
@@ -63,7 +63,7 @@ impl CargoTargetSpec { | |||
63 | None => return Ok(None), | 63 | None => return Ok(None), |
64 | }; | 64 | }; |
65 | let file_id = world.analysis().crate_root(crate_id)?; | 65 | let file_id = world.analysis().crate_root(crate_id)?; |
66 | let path = world.vfs.read().file2path(ra_vfs::VfsFile(file_id.0)); | 66 | let path = world.file_id_to_path(file_id); |
67 | let res = world.workspaces.iter().find_map(|ws| match ws { | 67 | let res = world.workspaces.iter().find_map(|ws| match ws { |
68 | ProjectWorkspace::Cargo { cargo, .. } => { | 68 | ProjectWorkspace::Cargo { cargo, .. } => { |
69 | let tgt = cargo.target_by_root(&path)?; | 69 | let tgt = cargo.target_by_root(&path)?; |
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 84012b99d..7822be2e2 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs | |||
@@ -9,7 +9,7 @@ use std::{error::Error, fmt, panic, path::PathBuf, sync::Arc, time::Instant}; | |||
9 | 9 | ||
10 | use crossbeam_channel::{select, unbounded, RecvError, Sender}; | 10 | use crossbeam_channel::{select, unbounded, RecvError, Sender}; |
11 | use lsp_server::{Connection, ErrorCode, Message, Notification, Request, RequestId, Response}; | 11 | use lsp_server::{Connection, ErrorCode, Message, Notification, Request, RequestId, Response}; |
12 | use lsp_types::{ClientCapabilities, NumberOrString}; | 12 | use lsp_types::{ClientCapabilities, NumberOrString, Url}; |
13 | use ra_cargo_watch::{CheckOptions, CheckTask}; | 13 | use ra_cargo_watch::{CheckOptions, CheckTask}; |
14 | use ra_ide::{Canceled, FeatureFlags, FileId, LibraryData, SourceRootId}; | 14 | use ra_ide::{Canceled, FeatureFlags, FileId, LibraryData, SourceRootId}; |
15 | use ra_prof::profile; | 15 | use ra_prof::profile; |
@@ -336,28 +336,7 @@ fn loop_turn( | |||
336 | world_state.maybe_collect_garbage(); | 336 | world_state.maybe_collect_garbage(); |
337 | loop_state.in_flight_libraries -= 1; | 337 | loop_state.in_flight_libraries -= 1; |
338 | } | 338 | } |
339 | Event::CheckWatcher(task) => match task { | 339 | Event::CheckWatcher(task) => on_check_task(task, world_state, task_sender)?, |
340 | CheckTask::Update(uri) => { | ||
341 | // We manually send a diagnostic update when the watcher asks | ||
342 | // us to, to avoid the issue of having to change the file to | ||
343 | // receive updated diagnostics. | ||
344 | let path = uri.to_file_path().map_err(|()| format!("invalid uri: {}", uri))?; | ||
345 | if let Some(file_id) = world_state.vfs.read().path2file(&path) { | ||
346 | let params = | ||
347 | handlers::publish_diagnostics(&world_state.snapshot(), FileId(file_id.0))?; | ||
348 | let not = notification_new::<req::PublishDiagnostics>(params); | ||
349 | task_sender.send(Task::Notify(not)).unwrap(); | ||
350 | } | ||
351 | } | ||
352 | CheckTask::Status(progress) => { | ||
353 | let params = req::ProgressParams { | ||
354 | token: req::ProgressToken::String("rustAnalyzer/cargoWatcher".to_string()), | ||
355 | value: req::ProgressParamsValue::WorkDone(progress), | ||
356 | }; | ||
357 | let not = notification_new::<req::Progress>(params); | ||
358 | task_sender.send(Task::Notify(not)).unwrap(); | ||
359 | } | ||
360 | }, | ||
361 | Event::Msg(msg) => match msg { | 340 | Event::Msg(msg) => match msg { |
362 | Message::Request(req) => on_request( | 341 | Message::Request(req) => on_request( |
363 | world_state, | 342 | world_state, |
@@ -605,6 +584,60 @@ fn on_notification( | |||
605 | Ok(()) | 584 | Ok(()) |
606 | } | 585 | } |
607 | 586 | ||
587 | fn on_check_task( | ||
588 | task: CheckTask, | ||
589 | world_state: &WorldState, | ||
590 | task_sender: &Sender<Task>, | ||
591 | ) -> Result<()> { | ||
592 | match task { | ||
593 | CheckTask::ClearDiagnostics => { | ||
594 | let cleared_files = world_state.check_watcher.state.write().clear(); | ||
595 | |||
596 | // Send updated diagnostics for each cleared file | ||
597 | for url in cleared_files { | ||
598 | publish_diagnostics_for_url(&url, world_state, task_sender)?; | ||
599 | } | ||
600 | } | ||
601 | |||
602 | CheckTask::AddDiagnostic(url, diagnostic) => { | ||
603 | world_state | ||
604 | .check_watcher | ||
605 | .state | ||
606 | .write() | ||
607 | .add_diagnostic_with_fixes(url.clone(), diagnostic); | ||
608 | |||
609 | // We manually send a diagnostic update when the watcher asks | ||
610 | // us to, to avoid the issue of having to change the file to | ||
611 | // receive updated diagnostics. | ||
612 | publish_diagnostics_for_url(&url, world_state, task_sender)?; | ||
613 | } | ||
614 | |||
615 | CheckTask::Status(progress) => { | ||
616 | let params = req::ProgressParams { | ||
617 | token: req::ProgressToken::String("rustAnalyzer/cargoWatcher".to_string()), | ||
618 | value: req::ProgressParamsValue::WorkDone(progress), | ||
619 | }; | ||
620 | let not = notification_new::<req::Progress>(params); | ||
621 | task_sender.send(Task::Notify(not)).unwrap(); | ||
622 | } | ||
623 | } | ||
624 | Ok(()) | ||
625 | } | ||
626 | |||
627 | fn publish_diagnostics_for_url( | ||
628 | url: &Url, | ||
629 | world_state: &WorldState, | ||
630 | task_sender: &Sender<Task>, | ||
631 | ) -> Result<()> { | ||
632 | let path = url.to_file_path().map_err(|()| format!("invalid uri: {}", url))?; | ||
633 | if let Some(file_id) = world_state.vfs.read().path2file(&path) { | ||
634 | let params = handlers::publish_diagnostics(&world_state.snapshot(), FileId(file_id.0))?; | ||
635 | let not = notification_new::<req::PublishDiagnostics>(params); | ||
636 | task_sender.send(Task::Notify(not)).unwrap(); | ||
637 | } | ||
638 | Ok(()) | ||
639 | } | ||
640 | |||
608 | struct PoolDispatcher<'a> { | 641 | struct PoolDispatcher<'a> { |
609 | req: Option<Request>, | 642 | req: Option<Request>, |
610 | pool: &'a ThreadPool, | 643 | pool: &'a ThreadPool, |
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index d5a8bbe4d..8e43f0575 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | use std::{fmt::Write as _, io::Write as _}; | 4 | use std::{fmt::Write as _, io::Write as _}; |
5 | 5 | ||
6 | use either::Either; | ||
6 | use lsp_server::ErrorCode; | 7 | use lsp_server::ErrorCode; |
7 | use lsp_types::{ | 8 | use lsp_types::{ |
8 | CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, | 9 | CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, |
@@ -644,7 +645,6 @@ pub fn handle_code_action( | |||
644 | let line_index = world.analysis().file_line_index(file_id)?; | 645 | let line_index = world.analysis().file_line_index(file_id)?; |
645 | let range = params.range.conv_with(&line_index); | 646 | let range = params.range.conv_with(&line_index); |
646 | 647 | ||
647 | let assists = world.analysis().assists(FileRange { file_id, range })?.into_iter(); | ||
648 | let diagnostics = world.analysis().diagnostics(file_id)?; | 648 | let diagnostics = world.analysis().diagnostics(file_id)?; |
649 | let mut res = CodeActionResponse::default(); | 649 | let mut res = CodeActionResponse::default(); |
650 | 650 | ||
@@ -681,10 +681,12 @@ pub fn handle_code_action( | |||
681 | continue; | 681 | continue; |
682 | } | 682 | } |
683 | 683 | ||
684 | let edits = vec![TextEdit::new(fix.location.range, fix.replacement.clone())]; | 684 | let edit = { |
685 | let mut edit_map = std::collections::HashMap::new(); | 685 | let edits = vec![TextEdit::new(fix.location.range, fix.replacement.clone())]; |
686 | edit_map.insert(fix.location.uri.clone(), edits); | 686 | let mut edit_map = std::collections::HashMap::new(); |
687 | let edit = WorkspaceEdit::new(edit_map); | 687 | edit_map.insert(fix.location.uri.clone(), edits); |
688 | WorkspaceEdit::new(edit_map) | ||
689 | }; | ||
688 | 690 | ||
689 | let action = CodeAction { | 691 | let action = CodeAction { |
690 | title: fix.title.clone(), | 692 | title: fix.title.clone(), |
@@ -697,15 +699,27 @@ pub fn handle_code_action( | |||
697 | res.push(action.into()); | 699 | res.push(action.into()); |
698 | } | 700 | } |
699 | 701 | ||
700 | for assist in assists { | 702 | for assist in world.analysis().assists(FileRange { file_id, range })?.into_iter() { |
701 | let title = assist.change.label.clone(); | 703 | let title = assist.label.clone(); |
702 | let edit = assist.change.try_conv_with(&world)?; | ||
703 | 704 | ||
704 | let command = Command { | 705 | let command = match assist.change_data { |
705 | title, | 706 | Either::Left(change) => Command { |
706 | command: "rust-analyzer.applySourceChange".to_string(), | 707 | title, |
707 | arguments: Some(vec![to_value(edit).unwrap()]), | 708 | command: "rust-analyzer.applySourceChange".to_string(), |
709 | arguments: Some(vec![to_value(change.try_conv_with(&world)?)?]), | ||
710 | }, | ||
711 | Either::Right(changes) => Command { | ||
712 | title, | ||
713 | command: "rust-analyzer.selectAndApplySourceChange".to_string(), | ||
714 | arguments: Some(vec![to_value( | ||
715 | changes | ||
716 | .into_iter() | ||
717 | .map(|change| change.try_conv_with(&world)) | ||
718 | .collect::<Result<Vec<_>>>()?, | ||
719 | )?]), | ||
720 | }, | ||
708 | }; | 721 | }; |
722 | |||
709 | let action = CodeAction { | 723 | let action = CodeAction { |
710 | title: command.title.clone(), | 724 | title: command.title.clone(), |
711 | kind: match assist.id { | 725 | kind: match assist.id { |
@@ -953,6 +967,7 @@ pub fn handle_inlay_hints( | |||
953 | range: api_type.range.conv_with(&line_index), | 967 | range: api_type.range.conv_with(&line_index), |
954 | kind: match api_type.kind { | 968 | kind: match api_type.kind { |
955 | ra_ide::InlayKind::TypeHint => InlayKind::TypeHint, | 969 | ra_ide::InlayKind::TypeHint => InlayKind::TypeHint, |
970 | ra_ide::InlayKind::ParameterHint => InlayKind::ParameterHint, | ||
956 | }, | 971 | }, |
957 | }) | 972 | }) |
958 | .collect()) | 973 | .collect()) |
diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs index 8098ff31d..dc327f53d 100644 --- a/crates/ra_lsp_server/src/req.rs +++ b/crates/ra_lsp_server/src/req.rs | |||
@@ -197,6 +197,7 @@ pub struct InlayHintsParams { | |||
197 | #[derive(Debug, PartialEq, Eq, Deserialize, Serialize)] | 197 | #[derive(Debug, PartialEq, Eq, Deserialize, Serialize)] |
198 | pub enum InlayKind { | 198 | pub enum InlayKind { |
199 | TypeHint, | 199 | TypeHint, |
200 | ParameterHint, | ||
200 | } | 201 | } |
201 | 202 | ||
202 | #[derive(Debug, Deserialize, Serialize)] | 203 | #[derive(Debug, Deserialize, Serialize)] |
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index c0175c726..e7a0acfc7 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs | |||
@@ -13,7 +13,7 @@ use lsp_server::ErrorCode; | |||
13 | use lsp_types::Url; | 13 | use lsp_types::Url; |
14 | use parking_lot::RwLock; | 14 | use parking_lot::RwLock; |
15 | use ra_cargo_watch::{ | 15 | use ra_cargo_watch::{ |
16 | url_from_path_with_drive_lowercasing, CheckOptions, CheckWatcher, CheckWatcherSharedState, | 16 | url_from_path_with_drive_lowercasing, CheckOptions, CheckState, CheckWatcher, |
17 | }; | 17 | }; |
18 | use ra_ide::{ | 18 | use ra_ide::{ |
19 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, | 19 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, |
@@ -62,9 +62,9 @@ pub struct WorldSnapshot { | |||
62 | pub options: Options, | 62 | pub options: Options, |
63 | pub workspaces: Arc<Vec<ProjectWorkspace>>, | 63 | pub workspaces: Arc<Vec<ProjectWorkspace>>, |
64 | pub analysis: Analysis, | 64 | pub analysis: Analysis, |
65 | pub vfs: Arc<RwLock<Vfs>>, | ||
66 | pub latest_requests: Arc<RwLock<LatestRequests>>, | 65 | pub latest_requests: Arc<RwLock<LatestRequests>>, |
67 | pub check_watcher: Arc<RwLock<CheckWatcherSharedState>>, | 66 | pub check_watcher: Arc<RwLock<CheckState>>, |
67 | vfs: Arc<RwLock<Vfs>>, | ||
68 | } | 68 | } |
69 | 69 | ||
70 | impl WorldState { | 70 | impl WorldState { |
@@ -220,7 +220,7 @@ impl WorldState { | |||
220 | analysis: self.analysis_host.analysis(), | 220 | analysis: self.analysis_host.analysis(), |
221 | vfs: Arc::clone(&self.vfs), | 221 | vfs: Arc::clone(&self.vfs), |
222 | latest_requests: Arc::clone(&self.latest_requests), | 222 | latest_requests: Arc::clone(&self.latest_requests), |
223 | check_watcher: self.check_watcher.shared.clone(), | 223 | check_watcher: self.check_watcher.state.clone(), |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
@@ -265,6 +265,10 @@ impl WorldSnapshot { | |||
265 | Ok(url) | 265 | Ok(url) |
266 | } | 266 | } |
267 | 267 | ||
268 | pub fn file_id_to_path(&self, id: FileId) -> PathBuf { | ||
269 | self.vfs.read().file2path(VfsFile(id.0)) | ||
270 | } | ||
271 | |||
268 | pub fn file_line_endings(&self, id: FileId) -> LineEndings { | 272 | pub fn file_line_endings(&self, id: FileId) -> LineEndings { |
269 | self.vfs.read().file_line_endings(VfsFile(id.0)) | 273 | self.vfs.read().file_line_endings(VfsFile(id.0)) |
270 | } | 274 | } |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index b736098ac..0e78d8b63 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -22,9 +22,8 @@ impl ast::BinExpr { | |||
22 | #[must_use] | 22 | #[must_use] |
23 | pub fn replace_op(&self, op: SyntaxKind) -> Option<ast::BinExpr> { | 23 | pub fn replace_op(&self, op: SyntaxKind) -> Option<ast::BinExpr> { |
24 | let op_node: SyntaxElement = self.op_details()?.0.into(); | 24 | let op_node: SyntaxElement = self.op_details()?.0.into(); |
25 | let to_insert: Option<SyntaxElement> = Some(tokens::op(op).into()); | 25 | let to_insert: Option<SyntaxElement> = Some(make::token(op).into()); |
26 | let replace_range = RangeInclusive::new(op_node.clone(), op_node); | 26 | Some(replace_children(self, single_node(op_node), to_insert)) |
27 | Some(replace_children(self, replace_range, to_insert.into_iter())) | ||
28 | } | 27 | } |
29 | } | 28 | } |
30 | 29 | ||
@@ -40,11 +39,10 @@ impl ast::FnDef { | |||
40 | } else { | 39 | } else { |
41 | to_insert.push(make::tokens::single_space().into()); | 40 | to_insert.push(make::tokens::single_space().into()); |
42 | to_insert.push(body.syntax().clone().into()); | 41 | to_insert.push(body.syntax().clone().into()); |
43 | return insert_children(self, InsertPosition::Last, to_insert.into_iter()); | 42 | return insert_children(self, InsertPosition::Last, to_insert); |
44 | }; | 43 | }; |
45 | to_insert.push(body.syntax().clone().into()); | 44 | to_insert.push(body.syntax().clone().into()); |
46 | let replace_range = RangeInclusive::new(old_body_or_semi.clone(), old_body_or_semi); | 45 | replace_children(self, single_node(old_body_or_semi), to_insert) |
47 | replace_children(self, replace_range, to_insert.into_iter()) | ||
48 | } | 46 | } |
49 | } | 47 | } |
50 | 48 | ||
@@ -77,7 +75,7 @@ impl ast::ItemList { | |||
77 | let ws = tokens::WsBuilder::new(&format!("\n{}", indent)); | 75 | let ws = tokens::WsBuilder::new(&format!("\n{}", indent)); |
78 | let to_insert: ArrayVec<[SyntaxElement; 2]> = | 76 | let to_insert: ArrayVec<[SyntaxElement; 2]> = |
79 | [ws.ws().into(), item.syntax().clone().into()].into(); | 77 | [ws.ws().into(), item.syntax().clone().into()].into(); |
80 | insert_children(self, position, to_insert.into_iter()) | 78 | insert_children(self, position, to_insert) |
81 | } | 79 | } |
82 | 80 | ||
83 | fn l_curly(&self) -> Option<SyntaxElement> { | 81 | fn l_curly(&self) -> Option<SyntaxElement> { |
@@ -109,9 +107,7 @@ impl ast::ItemList { | |||
109 | let to_insert = iter::once(ws.ws().into()); | 107 | let to_insert = iter::once(ws.ws().into()); |
110 | match existing_ws { | 108 | match existing_ws { |
111 | None => insert_children(self, InsertPosition::After(l_curly), to_insert), | 109 | None => insert_children(self, InsertPosition::After(l_curly), to_insert), |
112 | Some(ws) => { | 110 | Some(ws) => replace_children(self, single_node(ws), to_insert), |
113 | replace_children(self, RangeInclusive::new(ws.clone().into(), ws.into()), to_insert) | ||
114 | } | ||
115 | } | 111 | } |
116 | } | 112 | } |
117 | } | 113 | } |
@@ -188,7 +184,7 @@ impl ast::RecordFieldList { | |||
188 | InsertPosition::After(anchor) => after_field!(anchor), | 184 | InsertPosition::After(anchor) => after_field!(anchor), |
189 | }; | 185 | }; |
190 | 186 | ||
191 | insert_children(self, position, to_insert.iter().cloned()) | 187 | insert_children(self, position, to_insert) |
192 | } | 188 | } |
193 | 189 | ||
194 | fn l_curly(&self) -> Option<SyntaxElement> { | 190 | fn l_curly(&self) -> Option<SyntaxElement> { |
@@ -207,7 +203,49 @@ impl ast::TypeParam { | |||
207 | Some(it) => it.syntax().clone().into(), | 203 | Some(it) => it.syntax().clone().into(), |
208 | None => colon.clone().into(), | 204 | None => colon.clone().into(), |
209 | }; | 205 | }; |
210 | replace_children(self, RangeInclusive::new(colon.into(), end), iter::empty()) | 206 | replace_children(self, colon.into()..=end, iter::empty()) |
207 | } | ||
208 | } | ||
209 | |||
210 | impl ast::Path { | ||
211 | #[must_use] | ||
212 | pub fn with_segment(&self, segment: ast::PathSegment) -> ast::Path { | ||
213 | if let Some(old) = self.segment() { | ||
214 | return replace_children( | ||
215 | self, | ||
216 | single_node(old.syntax().clone()), | ||
217 | iter::once(segment.syntax().clone().into()), | ||
218 | ); | ||
219 | } | ||
220 | self.clone() | ||
221 | } | ||
222 | } | ||
223 | |||
224 | impl ast::PathSegment { | ||
225 | #[must_use] | ||
226 | pub fn with_type_args(&self, type_args: ast::TypeArgList) -> ast::PathSegment { | ||
227 | self._with_type_args(type_args, false) | ||
228 | } | ||
229 | |||
230 | #[must_use] | ||
231 | pub fn with_turbo_fish(&self, type_args: ast::TypeArgList) -> ast::PathSegment { | ||
232 | self._with_type_args(type_args, true) | ||
233 | } | ||
234 | |||
235 | fn _with_type_args(&self, type_args: ast::TypeArgList, turbo: bool) -> ast::PathSegment { | ||
236 | if let Some(old) = self.type_arg_list() { | ||
237 | return replace_children( | ||
238 | self, | ||
239 | single_node(old.syntax().clone()), | ||
240 | iter::once(type_args.syntax().clone().into()), | ||
241 | ); | ||
242 | } | ||
243 | let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); | ||
244 | if turbo { | ||
245 | to_insert.push(make::token(T![::]).into()); | ||
246 | } | ||
247 | to_insert.push(type_args.syntax().clone().into()); | ||
248 | insert_children(self, InsertPosition::Last, to_insert) | ||
211 | } | 249 | } |
212 | } | 250 | } |
213 | 251 | ||
@@ -224,7 +262,7 @@ fn strip_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode { | |||
224 | Some(el) if el.kind() == WHITESPACE => el.clone(), | 262 | Some(el) if el.kind() == WHITESPACE => el.clone(), |
225 | Some(_) | None => start.clone(), | 263 | Some(_) | None => start.clone(), |
226 | }; | 264 | }; |
227 | node = algo::replace_children(&node, RangeInclusive::new(start, end), &mut iter::empty()); | 265 | node = algo::replace_children(&node, start..=end, &mut iter::empty()); |
228 | } | 266 | } |
229 | node | 267 | node |
230 | } | 268 | } |
@@ -232,9 +270,10 @@ fn strip_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode { | |||
232 | #[must_use] | 270 | #[must_use] |
233 | pub fn replace_descendants<N: AstNode, D: AstNode>( | 271 | pub fn replace_descendants<N: AstNode, D: AstNode>( |
234 | parent: &N, | 272 | parent: &N, |
235 | replacement_map: impl Iterator<Item = (D, D)>, | 273 | replacement_map: impl IntoIterator<Item = (D, D)>, |
236 | ) -> N { | 274 | ) -> N { |
237 | let map = replacement_map | 275 | let map = replacement_map |
276 | .into_iter() | ||
238 | .map(|(from, to)| (from.syntax().clone().into(), to.syntax().clone().into())) | 277 | .map(|(from, to)| (from.syntax().clone().into(), to.syntax().clone().into())) |
239 | .collect::<FxHashMap<SyntaxElement, _>>(); | 278 | .collect::<FxHashMap<SyntaxElement, _>>(); |
240 | let new_syntax = algo::replace_descendants(parent.syntax(), &|n| map.get(n).cloned()); | 279 | let new_syntax = algo::replace_descendants(parent.syntax(), &|n| map.get(n).cloned()); |
@@ -348,19 +387,25 @@ fn prev_tokens(token: SyntaxToken) -> impl Iterator<Item = SyntaxToken> { | |||
348 | fn insert_children<N: AstNode>( | 387 | fn insert_children<N: AstNode>( |
349 | parent: &N, | 388 | parent: &N, |
350 | position: InsertPosition<SyntaxElement>, | 389 | position: InsertPosition<SyntaxElement>, |
351 | mut to_insert: impl Iterator<Item = SyntaxElement>, | 390 | to_insert: impl IntoIterator<Item = SyntaxElement>, |
352 | ) -> N { | 391 | ) -> N { |
353 | let new_syntax = algo::insert_children(parent.syntax(), position, &mut to_insert); | 392 | let new_syntax = algo::insert_children(parent.syntax(), position, &mut to_insert.into_iter()); |
354 | N::cast(new_syntax).unwrap() | 393 | N::cast(new_syntax).unwrap() |
355 | } | 394 | } |
356 | 395 | ||
396 | fn single_node(element: impl Into<SyntaxElement>) -> RangeInclusive<SyntaxElement> { | ||
397 | let element = element.into(); | ||
398 | element.clone()..=element | ||
399 | } | ||
400 | |||
357 | #[must_use] | 401 | #[must_use] |
358 | fn replace_children<N: AstNode>( | 402 | fn replace_children<N: AstNode>( |
359 | parent: &N, | 403 | parent: &N, |
360 | to_replace: RangeInclusive<SyntaxElement>, | 404 | to_replace: RangeInclusive<SyntaxElement>, |
361 | mut to_insert: impl Iterator<Item = SyntaxElement>, | 405 | to_insert: impl IntoIterator<Item = SyntaxElement>, |
362 | ) -> N { | 406 | ) -> N { |
363 | let new_syntax = algo::replace_children(parent.syntax(), to_replace, &mut to_insert); | 407 | let new_syntax = |
408 | algo::replace_children(parent.syntax(), to_replace, &mut to_insert.into_iter()); | ||
364 | N::cast(new_syntax).unwrap() | 409 | N::cast(new_syntax).unwrap() |
365 | } | 410 | } |
366 | 411 | ||
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index eef45090d..36e648180 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | //! of smaller pieces. | 2 | //! of smaller pieces. |
3 | use itertools::Itertools; | 3 | use itertools::Itertools; |
4 | 4 | ||
5 | use crate::{algo, ast, AstNode, SourceFile}; | 5 | use crate::{ast, AstNode, SourceFile, SyntaxKind, SyntaxToken}; |
6 | 6 | ||
7 | pub fn name(text: &str) -> ast::Name { | 7 | pub fn name(text: &str) -> ast::Name { |
8 | ast_from_text(&format!("mod {};", text)) | 8 | ast_from_text(&format!("mod {};", text)) |
@@ -21,20 +21,6 @@ pub fn path_qualified(qual: ast::Path, name_ref: ast::NameRef) -> ast::Path { | |||
21 | fn path_from_text(text: &str) -> ast::Path { | 21 | fn path_from_text(text: &str) -> ast::Path { |
22 | ast_from_text(text) | 22 | ast_from_text(text) |
23 | } | 23 | } |
24 | pub fn path_with_type_arg_list(path: ast::Path, args: Option<ast::TypeArgList>) -> ast::Path { | ||
25 | if let Some(args) = args { | ||
26 | let syntax = path.syntax(); | ||
27 | // FIXME: remove existing type args | ||
28 | let new_syntax = algo::insert_children( | ||
29 | syntax, | ||
30 | crate::algo::InsertPosition::Last, | ||
31 | &mut Some(args).into_iter().map(|n| n.syntax().clone().into()), | ||
32 | ); | ||
33 | ast::Path::cast(new_syntax).unwrap() | ||
34 | } else { | ||
35 | path | ||
36 | } | ||
37 | } | ||
38 | 24 | ||
39 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField { | 25 | pub fn record_field(name: ast::NameRef, expr: Option<ast::Expr>) -> ast::RecordField { |
40 | return match expr { | 26 | return match expr { |
@@ -181,27 +167,27 @@ pub fn let_stmt(pattern: ast::Pat, initializer: Option<ast::Expr>) -> ast::LetSt | |||
181 | ast_from_text(&format!("fn f() {{ {} }}", text)) | 167 | ast_from_text(&format!("fn f() {{ {} }}", text)) |
182 | } | 168 | } |
183 | 169 | ||
170 | pub fn token(kind: SyntaxKind) -> SyntaxToken { | ||
171 | tokens::SOURCE_FILE | ||
172 | .tree() | ||
173 | .syntax() | ||
174 | .descendants_with_tokens() | ||
175 | .filter_map(|it| it.into_token()) | ||
176 | .find(|it| it.kind() == kind) | ||
177 | .unwrap_or_else(|| panic!("unhandled token: {:?}", kind)) | ||
178 | } | ||
179 | |||
184 | fn ast_from_text<N: AstNode>(text: &str) -> N { | 180 | fn ast_from_text<N: AstNode>(text: &str) -> N { |
185 | let parse = SourceFile::parse(text); | 181 | let parse = SourceFile::parse(text); |
186 | parse.tree().syntax().descendants().find_map(N::cast).unwrap() | 182 | parse.tree().syntax().descendants().find_map(N::cast).unwrap() |
187 | } | 183 | } |
188 | 184 | ||
189 | pub mod tokens { | 185 | pub mod tokens { |
190 | use crate::{AstNode, Parse, SourceFile, SyntaxKind, SyntaxKind::*, SyntaxToken, T}; | 186 | use crate::{AstNode, Parse, SourceFile, SyntaxKind::*, SyntaxToken, T}; |
191 | use once_cell::sync::Lazy; | 187 | use once_cell::sync::Lazy; |
192 | 188 | ||
193 | static SOURCE_FILE: Lazy<Parse<SourceFile>> = | 189 | pub(super) static SOURCE_FILE: Lazy<Parse<SourceFile>> = |
194 | Lazy::new(|| SourceFile::parse("const C: () = (1 != 1, 2 == 2)\n;")); | 190 | Lazy::new(|| SourceFile::parse("const C: <()>::Item = (1 != 1, 2 == 2)\n;")); |
195 | |||
196 | pub fn op(op: SyntaxKind) -> SyntaxToken { | ||
197 | SOURCE_FILE | ||
198 | .tree() | ||
199 | .syntax() | ||
200 | .descendants_with_tokens() | ||
201 | .filter_map(|it| it.into_token()) | ||
202 | .find(|it| it.kind() == op) | ||
203 | .unwrap() | ||
204 | } | ||
205 | 191 | ||
206 | pub fn comma() -> SyntaxToken { | 192 | pub fn comma() -> SyntaxToken { |
207 | SOURCE_FILE | 193 | SOURCE_FILE |
diff --git a/crates/ra_syntax/test_data/accidentally_quadratic b/crates/ra_syntax/test_data/accidentally_quadratic new file mode 100644 index 000000000..428f83a62 --- /dev/null +++ b/crates/ra_syntax/test_data/accidentally_quadratic | |||
@@ -0,0 +1,3980 @@ | |||
1 | #[doc = r" Register block"] | ||
2 | #[repr(C)] | ||
3 | pub struct RegisterBlock { | ||
4 | #[doc = "0x00 - Control Register"] | ||
5 | pub cr: CR, | ||
6 | #[doc = "0x04 - Error Status Register"] | ||
7 | pub es: ES, | ||
8 | _reserved0: [u8; 4usize], | ||
9 | #[doc = "0x0c - Enable Request Register"] | ||
10 | pub erq: ERQ, | ||
11 | _reserved1: [u8; 4usize], | ||
12 | #[doc = "0x14 - Enable Error Interrupt Register"] | ||
13 | pub eei: EEI, | ||
14 | #[doc = "0x18 - Clear Enable Error Interrupt Register"] | ||
15 | pub ceei: CEEI, | ||
16 | #[doc = "0x19 - Set Enable Error Interrupt Register"] | ||
17 | pub seei: SEEI, | ||
18 | #[doc = "0x1a - Clear Enable Request Register"] | ||
19 | pub cerq: CERQ, | ||
20 | #[doc = "0x1b - Set Enable Request Register"] | ||
21 | pub serq: SERQ, | ||
22 | #[doc = "0x1c - Clear DONE Status Bit Register"] | ||
23 | pub cdne: CDNE, | ||
24 | #[doc = "0x1d - Set START Bit Register"] | ||
25 | pub ssrt: SSRT, | ||
26 | #[doc = "0x1e - Clear Error Register"] | ||
27 | pub cerr: CERR, | ||
28 | #[doc = "0x1f - Clear Interrupt Request Register"] | ||
29 | pub cint: CINT, | ||
30 | _reserved2: [u8; 4usize], | ||
31 | #[doc = "0x24 - Interrupt Request Register"] | ||
32 | pub int: INT, | ||
33 | _reserved3: [u8; 4usize], | ||
34 | #[doc = "0x2c - Error Register"] | ||
35 | pub err: ERR, | ||
36 | _reserved4: [u8; 4usize], | ||
37 | #[doc = "0x34 - Hardware Request Status Register"] | ||
38 | pub hrs: HRS, | ||
39 | _reserved5: [u8; 12usize], | ||
40 | #[doc = "0x44 - Enable Asynchronous Request in Stop Register"] | ||
41 | pub ears: EARS, | ||
42 | _reserved6: [u8; 184usize], | ||
43 | #[doc = "0x100 - Channel n Priority Register"] | ||
44 | pub dchpri3: DCHPRI3, | ||
45 | #[doc = "0x101 - Channel n Priority Register"] | ||
46 | pub dchpri2: DCHPRI2, | ||
47 | #[doc = "0x102 - Channel n Priority Register"] | ||
48 | pub dchpri1: DCHPRI1, | ||
49 | #[doc = "0x103 - Channel n Priority Register"] | ||
50 | pub dchpri0: DCHPRI0, | ||
51 | #[doc = "0x104 - Channel n Priority Register"] | ||
52 | pub dchpri7: DCHPRI7, | ||
53 | #[doc = "0x105 - Channel n Priority Register"] | ||
54 | pub dchpri6: DCHPRI6, | ||
55 | #[doc = "0x106 - Channel n Priority Register"] | ||
56 | pub dchpri5: DCHPRI5, | ||
57 | #[doc = "0x107 - Channel n Priority Register"] | ||
58 | pub dchpri4: DCHPRI4, | ||
59 | #[doc = "0x108 - Channel n Priority Register"] | ||
60 | pub dchpri11: DCHPRI11, | ||
61 | #[doc = "0x109 - Channel n Priority Register"] | ||
62 | pub dchpri10: DCHPRI10, | ||
63 | #[doc = "0x10a - Channel n Priority Register"] | ||
64 | pub dchpri9: DCHPRI9, | ||
65 | #[doc = "0x10b - Channel n Priority Register"] | ||
66 | pub dchpri8: DCHPRI8, | ||
67 | #[doc = "0x10c - Channel n Priority Register"] | ||
68 | pub dchpri15: DCHPRI15, | ||
69 | #[doc = "0x10d - Channel n Priority Register"] | ||
70 | pub dchpri14: DCHPRI14, | ||
71 | #[doc = "0x10e - Channel n Priority Register"] | ||
72 | pub dchpri13: DCHPRI13, | ||
73 | #[doc = "0x10f - Channel n Priority Register"] | ||
74 | pub dchpri12: DCHPRI12, | ||
75 | #[doc = "0x110 - Channel n Priority Register"] | ||
76 | pub dchpri19: DCHPRI19, | ||
77 | #[doc = "0x111 - Channel n Priority Register"] | ||
78 | pub dchpri18: DCHPRI18, | ||
79 | #[doc = "0x112 - Channel n Priority Register"] | ||
80 | pub dchpri17: DCHPRI17, | ||
81 | #[doc = "0x113 - Channel n Priority Register"] | ||
82 | pub dchpri16: DCHPRI16, | ||
83 | #[doc = "0x114 - Channel n Priority Register"] | ||
84 | pub dchpri23: DCHPRI23, | ||
85 | #[doc = "0x115 - Channel n Priority Register"] | ||
86 | pub dchpri22: DCHPRI22, | ||
87 | #[doc = "0x116 - Channel n Priority Register"] | ||
88 | pub dchpri21: DCHPRI21, | ||
89 | #[doc = "0x117 - Channel n Priority Register"] | ||
90 | pub dchpri20: DCHPRI20, | ||
91 | #[doc = "0x118 - Channel n Priority Register"] | ||
92 | pub dchpri27: DCHPRI27, | ||
93 | #[doc = "0x119 - Channel n Priority Register"] | ||
94 | pub dchpri26: DCHPRI26, | ||
95 | #[doc = "0x11a - Channel n Priority Register"] | ||
96 | pub dchpri25: DCHPRI25, | ||
97 | #[doc = "0x11b - Channel n Priority Register"] | ||
98 | pub dchpri24: DCHPRI24, | ||
99 | #[doc = "0x11c - Channel n Priority Register"] | ||
100 | pub dchpri31: DCHPRI31, | ||
101 | #[doc = "0x11d - Channel n Priority Register"] | ||
102 | pub dchpri30: DCHPRI30, | ||
103 | #[doc = "0x11e - Channel n Priority Register"] | ||
104 | pub dchpri29: DCHPRI29, | ||
105 | #[doc = "0x11f - Channel n Priority Register"] | ||
106 | pub dchpri28: DCHPRI28, | ||
107 | _reserved7: [u8; 3808usize], | ||
108 | #[doc = "0x1000 - TCD Source Address"] | ||
109 | pub tcd0_saddr: TCD0_SADDR, | ||
110 | #[doc = "0x1004 - TCD Signed Source Address Offset"] | ||
111 | pub tcd0_soff: TCD0_SOFF, | ||
112 | #[doc = "0x1006 - TCD Transfer Attributes"] | ||
113 | pub tcd0_attr: TCD0_ATTR, | ||
114 | #[doc = "0x1008 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
115 | pub tcd0_nbytes_mlno: TCD0_NBYTES_MLNO, | ||
116 | #[doc = "0x100c - TCD Last Source Address Adjustment"] | ||
117 | pub tcd0_slast: TCD0_SLAST, | ||
118 | #[doc = "0x1010 - TCD Destination Address"] | ||
119 | pub tcd0_daddr: TCD0_DADDR, | ||
120 | #[doc = "0x1014 - TCD Signed Destination Address Offset"] | ||
121 | pub tcd0_doff: TCD0_DOFF, | ||
122 | #[doc = "0x1016 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
123 | pub tcd0_citer_elinkno: TCD0_CITER_ELINKNO, | ||
124 | #[doc = "0x1018 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
125 | pub tcd0_dlastsga: TCD0_DLASTSGA, | ||
126 | #[doc = "0x101c - TCD Control and Status"] | ||
127 | pub tcd0_csr: TCD0_CSR, | ||
128 | #[doc = "0x101e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
129 | pub tcd0_biter_elinkno: TCD0_BITER_ELINKNO, | ||
130 | #[doc = "0x1020 - TCD Source Address"] | ||
131 | pub tcd1_saddr: TCD1_SADDR, | ||
132 | #[doc = "0x1024 - TCD Signed Source Address Offset"] | ||
133 | pub tcd1_soff: TCD1_SOFF, | ||
134 | #[doc = "0x1026 - TCD Transfer Attributes"] | ||
135 | pub tcd1_attr: TCD1_ATTR, | ||
136 | #[doc = "0x1028 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
137 | pub tcd1_nbytes_mlno: TCD1_NBYTES_MLNO, | ||
138 | #[doc = "0x102c - TCD Last Source Address Adjustment"] | ||
139 | pub tcd1_slast: TCD1_SLAST, | ||
140 | #[doc = "0x1030 - TCD Destination Address"] | ||
141 | pub tcd1_daddr: TCD1_DADDR, | ||
142 | #[doc = "0x1034 - TCD Signed Destination Address Offset"] | ||
143 | pub tcd1_doff: TCD1_DOFF, | ||
144 | #[doc = "0x1036 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
145 | pub tcd1_citer_elinkno: TCD1_CITER_ELINKNO, | ||
146 | #[doc = "0x1038 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
147 | pub tcd1_dlastsga: TCD1_DLASTSGA, | ||
148 | #[doc = "0x103c - TCD Control and Status"] | ||
149 | pub tcd1_csr: TCD1_CSR, | ||
150 | #[doc = "0x103e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
151 | pub tcd1_biter_elinkno: TCD1_BITER_ELINKNO, | ||
152 | #[doc = "0x1040 - TCD Source Address"] | ||
153 | pub tcd2_saddr: TCD2_SADDR, | ||
154 | #[doc = "0x1044 - TCD Signed Source Address Offset"] | ||
155 | pub tcd2_soff: TCD2_SOFF, | ||
156 | #[doc = "0x1046 - TCD Transfer Attributes"] | ||
157 | pub tcd2_attr: TCD2_ATTR, | ||
158 | #[doc = "0x1048 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
159 | pub tcd2_nbytes_mlno: TCD2_NBYTES_MLNO, | ||
160 | #[doc = "0x104c - TCD Last Source Address Adjustment"] | ||
161 | pub tcd2_slast: TCD2_SLAST, | ||
162 | #[doc = "0x1050 - TCD Destination Address"] | ||
163 | pub tcd2_daddr: TCD2_DADDR, | ||
164 | #[doc = "0x1054 - TCD Signed Destination Address Offset"] | ||
165 | pub tcd2_doff: TCD2_DOFF, | ||
166 | #[doc = "0x1056 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
167 | pub tcd2_citer_elinkno: TCD2_CITER_ELINKNO, | ||
168 | #[doc = "0x1058 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
169 | pub tcd2_dlastsga: TCD2_DLASTSGA, | ||
170 | #[doc = "0x105c - TCD Control and Status"] | ||
171 | pub tcd2_csr: TCD2_CSR, | ||
172 | #[doc = "0x105e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
173 | pub tcd2_biter_elinkno: TCD2_BITER_ELINKNO, | ||
174 | #[doc = "0x1060 - TCD Source Address"] | ||
175 | pub tcd3_saddr: TCD3_SADDR, | ||
176 | #[doc = "0x1064 - TCD Signed Source Address Offset"] | ||
177 | pub tcd3_soff: TCD3_SOFF, | ||
178 | #[doc = "0x1066 - TCD Transfer Attributes"] | ||
179 | pub tcd3_attr: TCD3_ATTR, | ||
180 | #[doc = "0x1068 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
181 | pub tcd3_nbytes_mlno: TCD3_NBYTES_MLNO, | ||
182 | #[doc = "0x106c - TCD Last Source Address Adjustment"] | ||
183 | pub tcd3_slast: TCD3_SLAST, | ||
184 | #[doc = "0x1070 - TCD Destination Address"] | ||
185 | pub tcd3_daddr: TCD3_DADDR, | ||
186 | #[doc = "0x1074 - TCD Signed Destination Address Offset"] | ||
187 | pub tcd3_doff: TCD3_DOFF, | ||
188 | #[doc = "0x1076 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
189 | pub tcd3_citer_elinkno: TCD3_CITER_ELINKNO, | ||
190 | #[doc = "0x1078 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
191 | pub tcd3_dlastsga: TCD3_DLASTSGA, | ||
192 | #[doc = "0x107c - TCD Control and Status"] | ||
193 | pub tcd3_csr: TCD3_CSR, | ||
194 | #[doc = "0x107e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
195 | pub tcd3_biter_elinkno: TCD3_BITER_ELINKNO, | ||
196 | #[doc = "0x1080 - TCD Source Address"] | ||
197 | pub tcd4_saddr: TCD4_SADDR, | ||
198 | #[doc = "0x1084 - TCD Signed Source Address Offset"] | ||
199 | pub tcd4_soff: TCD4_SOFF, | ||
200 | #[doc = "0x1086 - TCD Transfer Attributes"] | ||
201 | pub tcd4_attr: TCD4_ATTR, | ||
202 | #[doc = "0x1088 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
203 | pub tcd4_nbytes_mlno: TCD4_NBYTES_MLNO, | ||
204 | #[doc = "0x108c - TCD Last Source Address Adjustment"] | ||
205 | pub tcd4_slast: TCD4_SLAST, | ||
206 | #[doc = "0x1090 - TCD Destination Address"] | ||
207 | pub tcd4_daddr: TCD4_DADDR, | ||
208 | #[doc = "0x1094 - TCD Signed Destination Address Offset"] | ||
209 | pub tcd4_doff: TCD4_DOFF, | ||
210 | #[doc = "0x1096 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
211 | pub tcd4_citer_elinkno: TCD4_CITER_ELINKNO, | ||
212 | #[doc = "0x1098 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
213 | pub tcd4_dlastsga: TCD4_DLASTSGA, | ||
214 | #[doc = "0x109c - TCD Control and Status"] | ||
215 | pub tcd4_csr: TCD4_CSR, | ||
216 | #[doc = "0x109e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
217 | pub tcd4_biter_elinkno: TCD4_BITER_ELINKNO, | ||
218 | #[doc = "0x10a0 - TCD Source Address"] | ||
219 | pub tcd5_saddr: TCD5_SADDR, | ||
220 | #[doc = "0x10a4 - TCD Signed Source Address Offset"] | ||
221 | pub tcd5_soff: TCD5_SOFF, | ||
222 | #[doc = "0x10a6 - TCD Transfer Attributes"] | ||
223 | pub tcd5_attr: TCD5_ATTR, | ||
224 | #[doc = "0x10a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
225 | pub tcd5_nbytes_mlno: TCD5_NBYTES_MLNO, | ||
226 | #[doc = "0x10ac - TCD Last Source Address Adjustment"] | ||
227 | pub tcd5_slast: TCD5_SLAST, | ||
228 | #[doc = "0x10b0 - TCD Destination Address"] | ||
229 | pub tcd5_daddr: TCD5_DADDR, | ||
230 | #[doc = "0x10b4 - TCD Signed Destination Address Offset"] | ||
231 | pub tcd5_doff: TCD5_DOFF, | ||
232 | #[doc = "0x10b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
233 | pub tcd5_citer_elinkno: TCD5_CITER_ELINKNO, | ||
234 | #[doc = "0x10b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
235 | pub tcd5_dlastsga: TCD5_DLASTSGA, | ||
236 | #[doc = "0x10bc - TCD Control and Status"] | ||
237 | pub tcd5_csr: TCD5_CSR, | ||
238 | #[doc = "0x10be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
239 | pub tcd5_biter_elinkno: TCD5_BITER_ELINKNO, | ||
240 | #[doc = "0x10c0 - TCD Source Address"] | ||
241 | pub tcd6_saddr: TCD6_SADDR, | ||
242 | #[doc = "0x10c4 - TCD Signed Source Address Offset"] | ||
243 | pub tcd6_soff: TCD6_SOFF, | ||
244 | #[doc = "0x10c6 - TCD Transfer Attributes"] | ||
245 | pub tcd6_attr: TCD6_ATTR, | ||
246 | #[doc = "0x10c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
247 | pub tcd6_nbytes_mlno: TCD6_NBYTES_MLNO, | ||
248 | #[doc = "0x10cc - TCD Last Source Address Adjustment"] | ||
249 | pub tcd6_slast: TCD6_SLAST, | ||
250 | #[doc = "0x10d0 - TCD Destination Address"] | ||
251 | pub tcd6_daddr: TCD6_DADDR, | ||
252 | #[doc = "0x10d4 - TCD Signed Destination Address Offset"] | ||
253 | pub tcd6_doff: TCD6_DOFF, | ||
254 | #[doc = "0x10d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
255 | pub tcd6_citer_elinkno: TCD6_CITER_ELINKNO, | ||
256 | #[doc = "0x10d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
257 | pub tcd6_dlastsga: TCD6_DLASTSGA, | ||
258 | #[doc = "0x10dc - TCD Control and Status"] | ||
259 | pub tcd6_csr: TCD6_CSR, | ||
260 | #[doc = "0x10de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
261 | pub tcd6_biter_elinkno: TCD6_BITER_ELINKNO, | ||
262 | #[doc = "0x10e0 - TCD Source Address"] | ||
263 | pub tcd7_saddr: TCD7_SADDR, | ||
264 | #[doc = "0x10e4 - TCD Signed Source Address Offset"] | ||
265 | pub tcd7_soff: TCD7_SOFF, | ||
266 | #[doc = "0x10e6 - TCD Transfer Attributes"] | ||
267 | pub tcd7_attr: TCD7_ATTR, | ||
268 | #[doc = "0x10e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
269 | pub tcd7_nbytes_mlno: TCD7_NBYTES_MLNO, | ||
270 | #[doc = "0x10ec - TCD Last Source Address Adjustment"] | ||
271 | pub tcd7_slast: TCD7_SLAST, | ||
272 | #[doc = "0x10f0 - TCD Destination Address"] | ||
273 | pub tcd7_daddr: TCD7_DADDR, | ||
274 | #[doc = "0x10f4 - TCD Signed Destination Address Offset"] | ||
275 | pub tcd7_doff: TCD7_DOFF, | ||
276 | #[doc = "0x10f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
277 | pub tcd7_citer_elinkno: TCD7_CITER_ELINKNO, | ||
278 | #[doc = "0x10f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
279 | pub tcd7_dlastsga: TCD7_DLASTSGA, | ||
280 | #[doc = "0x10fc - TCD Control and Status"] | ||
281 | pub tcd7_csr: TCD7_CSR, | ||
282 | #[doc = "0x10fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
283 | pub tcd7_biter_elinkno: TCD7_BITER_ELINKNO, | ||
284 | #[doc = "0x1100 - TCD Source Address"] | ||
285 | pub tcd8_saddr: TCD8_SADDR, | ||
286 | #[doc = "0x1104 - TCD Signed Source Address Offset"] | ||
287 | pub tcd8_soff: TCD8_SOFF, | ||
288 | #[doc = "0x1106 - TCD Transfer Attributes"] | ||
289 | pub tcd8_attr: TCD8_ATTR, | ||
290 | #[doc = "0x1108 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
291 | pub tcd8_nbytes_mlno: TCD8_NBYTES_MLNO, | ||
292 | #[doc = "0x110c - TCD Last Source Address Adjustment"] | ||
293 | pub tcd8_slast: TCD8_SLAST, | ||
294 | #[doc = "0x1110 - TCD Destination Address"] | ||
295 | pub tcd8_daddr: TCD8_DADDR, | ||
296 | #[doc = "0x1114 - TCD Signed Destination Address Offset"] | ||
297 | pub tcd8_doff: TCD8_DOFF, | ||
298 | #[doc = "0x1116 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
299 | pub tcd8_citer_elinkno: TCD8_CITER_ELINKNO, | ||
300 | #[doc = "0x1118 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
301 | pub tcd8_dlastsga: TCD8_DLASTSGA, | ||
302 | #[doc = "0x111c - TCD Control and Status"] | ||
303 | pub tcd8_csr: TCD8_CSR, | ||
304 | #[doc = "0x111e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
305 | pub tcd8_biter_elinkno: TCD8_BITER_ELINKNO, | ||
306 | #[doc = "0x1120 - TCD Source Address"] | ||
307 | pub tcd9_saddr: TCD9_SADDR, | ||
308 | #[doc = "0x1124 - TCD Signed Source Address Offset"] | ||
309 | pub tcd9_soff: TCD9_SOFF, | ||
310 | #[doc = "0x1126 - TCD Transfer Attributes"] | ||
311 | pub tcd9_attr: TCD9_ATTR, | ||
312 | #[doc = "0x1128 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
313 | pub tcd9_nbytes_mlno: TCD9_NBYTES_MLNO, | ||
314 | #[doc = "0x112c - TCD Last Source Address Adjustment"] | ||
315 | pub tcd9_slast: TCD9_SLAST, | ||
316 | #[doc = "0x1130 - TCD Destination Address"] | ||
317 | pub tcd9_daddr: TCD9_DADDR, | ||
318 | #[doc = "0x1134 - TCD Signed Destination Address Offset"] | ||
319 | pub tcd9_doff: TCD9_DOFF, | ||
320 | #[doc = "0x1136 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
321 | pub tcd9_citer_elinkno: TCD9_CITER_ELINKNO, | ||
322 | #[doc = "0x1138 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
323 | pub tcd9_dlastsga: TCD9_DLASTSGA, | ||
324 | #[doc = "0x113c - TCD Control and Status"] | ||
325 | pub tcd9_csr: TCD9_CSR, | ||
326 | #[doc = "0x113e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
327 | pub tcd9_biter_elinkno: TCD9_BITER_ELINKNO, | ||
328 | #[doc = "0x1140 - TCD Source Address"] | ||
329 | pub tcd10_saddr: TCD10_SADDR, | ||
330 | #[doc = "0x1144 - TCD Signed Source Address Offset"] | ||
331 | pub tcd10_soff: TCD10_SOFF, | ||
332 | #[doc = "0x1146 - TCD Transfer Attributes"] | ||
333 | pub tcd10_attr: TCD10_ATTR, | ||
334 | #[doc = "0x1148 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
335 | pub tcd10_nbytes_mlno: TCD10_NBYTES_MLNO, | ||
336 | #[doc = "0x114c - TCD Last Source Address Adjustment"] | ||
337 | pub tcd10_slast: TCD10_SLAST, | ||
338 | #[doc = "0x1150 - TCD Destination Address"] | ||
339 | pub tcd10_daddr: TCD10_DADDR, | ||
340 | #[doc = "0x1154 - TCD Signed Destination Address Offset"] | ||
341 | pub tcd10_doff: TCD10_DOFF, | ||
342 | #[doc = "0x1156 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
343 | pub tcd10_citer_elinkno: TCD10_CITER_ELINKNO, | ||
344 | #[doc = "0x1158 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
345 | pub tcd10_dlastsga: TCD10_DLASTSGA, | ||
346 | #[doc = "0x115c - TCD Control and Status"] | ||
347 | pub tcd10_csr: TCD10_CSR, | ||
348 | #[doc = "0x115e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
349 | pub tcd10_biter_elinkno: TCD10_BITER_ELINKNO, | ||
350 | #[doc = "0x1160 - TCD Source Address"] | ||
351 | pub tcd11_saddr: TCD11_SADDR, | ||
352 | #[doc = "0x1164 - TCD Signed Source Address Offset"] | ||
353 | pub tcd11_soff: TCD11_SOFF, | ||
354 | #[doc = "0x1166 - TCD Transfer Attributes"] | ||
355 | pub tcd11_attr: TCD11_ATTR, | ||
356 | #[doc = "0x1168 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
357 | pub tcd11_nbytes_mlno: TCD11_NBYTES_MLNO, | ||
358 | #[doc = "0x116c - TCD Last Source Address Adjustment"] | ||
359 | pub tcd11_slast: TCD11_SLAST, | ||
360 | #[doc = "0x1170 - TCD Destination Address"] | ||
361 | pub tcd11_daddr: TCD11_DADDR, | ||
362 | #[doc = "0x1174 - TCD Signed Destination Address Offset"] | ||
363 | pub tcd11_doff: TCD11_DOFF, | ||
364 | #[doc = "0x1176 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
365 | pub tcd11_citer_elinkno: TCD11_CITER_ELINKNO, | ||
366 | #[doc = "0x1178 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
367 | pub tcd11_dlastsga: TCD11_DLASTSGA, | ||
368 | #[doc = "0x117c - TCD Control and Status"] | ||
369 | pub tcd11_csr: TCD11_CSR, | ||
370 | #[doc = "0x117e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
371 | pub tcd11_biter_elinkno: TCD11_BITER_ELINKNO, | ||
372 | #[doc = "0x1180 - TCD Source Address"] | ||
373 | pub tcd12_saddr: TCD12_SADDR, | ||
374 | #[doc = "0x1184 - TCD Signed Source Address Offset"] | ||
375 | pub tcd12_soff: TCD12_SOFF, | ||
376 | #[doc = "0x1186 - TCD Transfer Attributes"] | ||
377 | pub tcd12_attr: TCD12_ATTR, | ||
378 | #[doc = "0x1188 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
379 | pub tcd12_nbytes_mlno: TCD12_NBYTES_MLNO, | ||
380 | #[doc = "0x118c - TCD Last Source Address Adjustment"] | ||
381 | pub tcd12_slast: TCD12_SLAST, | ||
382 | #[doc = "0x1190 - TCD Destination Address"] | ||
383 | pub tcd12_daddr: TCD12_DADDR, | ||
384 | #[doc = "0x1194 - TCD Signed Destination Address Offset"] | ||
385 | pub tcd12_doff: TCD12_DOFF, | ||
386 | #[doc = "0x1196 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
387 | pub tcd12_citer_elinkno: TCD12_CITER_ELINKNO, | ||
388 | #[doc = "0x1198 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
389 | pub tcd12_dlastsga: TCD12_DLASTSGA, | ||
390 | #[doc = "0x119c - TCD Control and Status"] | ||
391 | pub tcd12_csr: TCD12_CSR, | ||
392 | #[doc = "0x119e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
393 | pub tcd12_biter_elinkno: TCD12_BITER_ELINKNO, | ||
394 | #[doc = "0x11a0 - TCD Source Address"] | ||
395 | pub tcd13_saddr: TCD13_SADDR, | ||
396 | #[doc = "0x11a4 - TCD Signed Source Address Offset"] | ||
397 | pub tcd13_soff: TCD13_SOFF, | ||
398 | #[doc = "0x11a6 - TCD Transfer Attributes"] | ||
399 | pub tcd13_attr: TCD13_ATTR, | ||
400 | #[doc = "0x11a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
401 | pub tcd13_nbytes_mlno: TCD13_NBYTES_MLNO, | ||
402 | #[doc = "0x11ac - TCD Last Source Address Adjustment"] | ||
403 | pub tcd13_slast: TCD13_SLAST, | ||
404 | #[doc = "0x11b0 - TCD Destination Address"] | ||
405 | pub tcd13_daddr: TCD13_DADDR, | ||
406 | #[doc = "0x11b4 - TCD Signed Destination Address Offset"] | ||
407 | pub tcd13_doff: TCD13_DOFF, | ||
408 | #[doc = "0x11b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
409 | pub tcd13_citer_elinkno: TCD13_CITER_ELINKNO, | ||
410 | #[doc = "0x11b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
411 | pub tcd13_dlastsga: TCD13_DLASTSGA, | ||
412 | #[doc = "0x11bc - TCD Control and Status"] | ||
413 | pub tcd13_csr: TCD13_CSR, | ||
414 | #[doc = "0x11be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
415 | pub tcd13_biter_elinkno: TCD13_BITER_ELINKNO, | ||
416 | #[doc = "0x11c0 - TCD Source Address"] | ||
417 | pub tcd14_saddr: TCD14_SADDR, | ||
418 | #[doc = "0x11c4 - TCD Signed Source Address Offset"] | ||
419 | pub tcd14_soff: TCD14_SOFF, | ||
420 | #[doc = "0x11c6 - TCD Transfer Attributes"] | ||
421 | pub tcd14_attr: TCD14_ATTR, | ||
422 | #[doc = "0x11c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
423 | pub tcd14_nbytes_mlno: TCD14_NBYTES_MLNO, | ||
424 | #[doc = "0x11cc - TCD Last Source Address Adjustment"] | ||
425 | pub tcd14_slast: TCD14_SLAST, | ||
426 | #[doc = "0x11d0 - TCD Destination Address"] | ||
427 | pub tcd14_daddr: TCD14_DADDR, | ||
428 | #[doc = "0x11d4 - TCD Signed Destination Address Offset"] | ||
429 | pub tcd14_doff: TCD14_DOFF, | ||
430 | #[doc = "0x11d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
431 | pub tcd14_citer_elinkno: TCD14_CITER_ELINKNO, | ||
432 | #[doc = "0x11d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
433 | pub tcd14_dlastsga: TCD14_DLASTSGA, | ||
434 | #[doc = "0x11dc - TCD Control and Status"] | ||
435 | pub tcd14_csr: TCD14_CSR, | ||
436 | #[doc = "0x11de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
437 | pub tcd14_biter_elinkno: TCD14_BITER_ELINKNO, | ||
438 | #[doc = "0x11e0 - TCD Source Address"] | ||
439 | pub tcd15_saddr: TCD15_SADDR, | ||
440 | #[doc = "0x11e4 - TCD Signed Source Address Offset"] | ||
441 | pub tcd15_soff: TCD15_SOFF, | ||
442 | #[doc = "0x11e6 - TCD Transfer Attributes"] | ||
443 | pub tcd15_attr: TCD15_ATTR, | ||
444 | #[doc = "0x11e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
445 | pub tcd15_nbytes_mlno: TCD15_NBYTES_MLNO, | ||
446 | #[doc = "0x11ec - TCD Last Source Address Adjustment"] | ||
447 | pub tcd15_slast: TCD15_SLAST, | ||
448 | #[doc = "0x11f0 - TCD Destination Address"] | ||
449 | pub tcd15_daddr: TCD15_DADDR, | ||
450 | #[doc = "0x11f4 - TCD Signed Destination Address Offset"] | ||
451 | pub tcd15_doff: TCD15_DOFF, | ||
452 | #[doc = "0x11f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
453 | pub tcd15_citer_elinkno: TCD15_CITER_ELINKNO, | ||
454 | #[doc = "0x11f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
455 | pub tcd15_dlastsga: TCD15_DLASTSGA, | ||
456 | #[doc = "0x11fc - TCD Control and Status"] | ||
457 | pub tcd15_csr: TCD15_CSR, | ||
458 | #[doc = "0x11fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
459 | pub tcd15_biter_elinkno: TCD15_BITER_ELINKNO, | ||
460 | #[doc = "0x1200 - TCD Source Address"] | ||
461 | pub tcd16_saddr: TCD16_SADDR, | ||
462 | #[doc = "0x1204 - TCD Signed Source Address Offset"] | ||
463 | pub tcd16_soff: TCD16_SOFF, | ||
464 | #[doc = "0x1206 - TCD Transfer Attributes"] | ||
465 | pub tcd16_attr: TCD16_ATTR, | ||
466 | #[doc = "0x1208 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
467 | pub tcd16_nbytes_mlno: TCD16_NBYTES_MLNO, | ||
468 | #[doc = "0x120c - TCD Last Source Address Adjustment"] | ||
469 | pub tcd16_slast: TCD16_SLAST, | ||
470 | #[doc = "0x1210 - TCD Destination Address"] | ||
471 | pub tcd16_daddr: TCD16_DADDR, | ||
472 | #[doc = "0x1214 - TCD Signed Destination Address Offset"] | ||
473 | pub tcd16_doff: TCD16_DOFF, | ||
474 | #[doc = "0x1216 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
475 | pub tcd16_citer_elinkno: TCD16_CITER_ELINKNO, | ||
476 | #[doc = "0x1218 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
477 | pub tcd16_dlastsga: TCD16_DLASTSGA, | ||
478 | #[doc = "0x121c - TCD Control and Status"] | ||
479 | pub tcd16_csr: TCD16_CSR, | ||
480 | #[doc = "0x121e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
481 | pub tcd16_biter_elinkno: TCD16_BITER_ELINKNO, | ||
482 | #[doc = "0x1220 - TCD Source Address"] | ||
483 | pub tcd17_saddr: TCD17_SADDR, | ||
484 | #[doc = "0x1224 - TCD Signed Source Address Offset"] | ||
485 | pub tcd17_soff: TCD17_SOFF, | ||
486 | #[doc = "0x1226 - TCD Transfer Attributes"] | ||
487 | pub tcd17_attr: TCD17_ATTR, | ||
488 | #[doc = "0x1228 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
489 | pub tcd17_nbytes_mlno: TCD17_NBYTES_MLNO, | ||
490 | #[doc = "0x122c - TCD Last Source Address Adjustment"] | ||
491 | pub tcd17_slast: TCD17_SLAST, | ||
492 | #[doc = "0x1230 - TCD Destination Address"] | ||
493 | pub tcd17_daddr: TCD17_DADDR, | ||
494 | #[doc = "0x1234 - TCD Signed Destination Address Offset"] | ||
495 | pub tcd17_doff: TCD17_DOFF, | ||
496 | #[doc = "0x1236 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
497 | pub tcd17_citer_elinkno: TCD17_CITER_ELINKNO, | ||
498 | #[doc = "0x1238 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
499 | pub tcd17_dlastsga: TCD17_DLASTSGA, | ||
500 | #[doc = "0x123c - TCD Control and Status"] | ||
501 | pub tcd17_csr: TCD17_CSR, | ||
502 | #[doc = "0x123e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
503 | pub tcd17_biter_elinkno: TCD17_BITER_ELINKNO, | ||
504 | #[doc = "0x1240 - TCD Source Address"] | ||
505 | pub tcd18_saddr: TCD18_SADDR, | ||
506 | #[doc = "0x1244 - TCD Signed Source Address Offset"] | ||
507 | pub tcd18_soff: TCD18_SOFF, | ||
508 | #[doc = "0x1246 - TCD Transfer Attributes"] | ||
509 | pub tcd18_attr: TCD18_ATTR, | ||
510 | #[doc = "0x1248 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
511 | pub tcd18_nbytes_mlno: TCD18_NBYTES_MLNO, | ||
512 | #[doc = "0x124c - TCD Last Source Address Adjustment"] | ||
513 | pub tcd18_slast: TCD18_SLAST, | ||
514 | #[doc = "0x1250 - TCD Destination Address"] | ||
515 | pub tcd18_daddr: TCD18_DADDR, | ||
516 | #[doc = "0x1254 - TCD Signed Destination Address Offset"] | ||
517 | pub tcd18_doff: TCD18_DOFF, | ||
518 | #[doc = "0x1256 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
519 | pub tcd18_citer_elinkno: TCD18_CITER_ELINKNO, | ||
520 | #[doc = "0x1258 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
521 | pub tcd18_dlastsga: TCD18_DLASTSGA, | ||
522 | #[doc = "0x125c - TCD Control and Status"] | ||
523 | pub tcd18_csr: TCD18_CSR, | ||
524 | #[doc = "0x125e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
525 | pub tcd18_biter_elinkno: TCD18_BITER_ELINKNO, | ||
526 | #[doc = "0x1260 - TCD Source Address"] | ||
527 | pub tcd19_saddr: TCD19_SADDR, | ||
528 | #[doc = "0x1264 - TCD Signed Source Address Offset"] | ||
529 | pub tcd19_soff: TCD19_SOFF, | ||
530 | #[doc = "0x1266 - TCD Transfer Attributes"] | ||
531 | pub tcd19_attr: TCD19_ATTR, | ||
532 | #[doc = "0x1268 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
533 | pub tcd19_nbytes_mlno: TCD19_NBYTES_MLNO, | ||
534 | #[doc = "0x126c - TCD Last Source Address Adjustment"] | ||
535 | pub tcd19_slast: TCD19_SLAST, | ||
536 | #[doc = "0x1270 - TCD Destination Address"] | ||
537 | pub tcd19_daddr: TCD19_DADDR, | ||
538 | #[doc = "0x1274 - TCD Signed Destination Address Offset"] | ||
539 | pub tcd19_doff: TCD19_DOFF, | ||
540 | #[doc = "0x1276 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
541 | pub tcd19_citer_elinkno: TCD19_CITER_ELINKNO, | ||
542 | #[doc = "0x1278 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
543 | pub tcd19_dlastsga: TCD19_DLASTSGA, | ||
544 | #[doc = "0x127c - TCD Control and Status"] | ||
545 | pub tcd19_csr: TCD19_CSR, | ||
546 | #[doc = "0x127e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
547 | pub tcd19_biter_elinkno: TCD19_BITER_ELINKNO, | ||
548 | #[doc = "0x1280 - TCD Source Address"] | ||
549 | pub tcd20_saddr: TCD20_SADDR, | ||
550 | #[doc = "0x1284 - TCD Signed Source Address Offset"] | ||
551 | pub tcd20_soff: TCD20_SOFF, | ||
552 | #[doc = "0x1286 - TCD Transfer Attributes"] | ||
553 | pub tcd20_attr: TCD20_ATTR, | ||
554 | #[doc = "0x1288 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
555 | pub tcd20_nbytes_mlno: TCD20_NBYTES_MLNO, | ||
556 | #[doc = "0x128c - TCD Last Source Address Adjustment"] | ||
557 | pub tcd20_slast: TCD20_SLAST, | ||
558 | #[doc = "0x1290 - TCD Destination Address"] | ||
559 | pub tcd20_daddr: TCD20_DADDR, | ||
560 | #[doc = "0x1294 - TCD Signed Destination Address Offset"] | ||
561 | pub tcd20_doff: TCD20_DOFF, | ||
562 | #[doc = "0x1296 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
563 | pub tcd20_citer_elinkno: TCD20_CITER_ELINKNO, | ||
564 | #[doc = "0x1298 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
565 | pub tcd20_dlastsga: TCD20_DLASTSGA, | ||
566 | #[doc = "0x129c - TCD Control and Status"] | ||
567 | pub tcd20_csr: TCD20_CSR, | ||
568 | #[doc = "0x129e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
569 | pub tcd20_biter_elinkno: TCD20_BITER_ELINKNO, | ||
570 | #[doc = "0x12a0 - TCD Source Address"] | ||
571 | pub tcd21_saddr: TCD21_SADDR, | ||
572 | #[doc = "0x12a4 - TCD Signed Source Address Offset"] | ||
573 | pub tcd21_soff: TCD21_SOFF, | ||
574 | #[doc = "0x12a6 - TCD Transfer Attributes"] | ||
575 | pub tcd21_attr: TCD21_ATTR, | ||
576 | #[doc = "0x12a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
577 | pub tcd21_nbytes_mlno: TCD21_NBYTES_MLNO, | ||
578 | #[doc = "0x12ac - TCD Last Source Address Adjustment"] | ||
579 | pub tcd21_slast: TCD21_SLAST, | ||
580 | #[doc = "0x12b0 - TCD Destination Address"] | ||
581 | pub tcd21_daddr: TCD21_DADDR, | ||
582 | #[doc = "0x12b4 - TCD Signed Destination Address Offset"] | ||
583 | pub tcd21_doff: TCD21_DOFF, | ||
584 | #[doc = "0x12b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
585 | pub tcd21_citer_elinkno: TCD21_CITER_ELINKNO, | ||
586 | #[doc = "0x12b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
587 | pub tcd21_dlastsga: TCD21_DLASTSGA, | ||
588 | #[doc = "0x12bc - TCD Control and Status"] | ||
589 | pub tcd21_csr: TCD21_CSR, | ||
590 | #[doc = "0x12be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
591 | pub tcd21_biter_elinkno: TCD21_BITER_ELINKNO, | ||
592 | #[doc = "0x12c0 - TCD Source Address"] | ||
593 | pub tcd22_saddr: TCD22_SADDR, | ||
594 | #[doc = "0x12c4 - TCD Signed Source Address Offset"] | ||
595 | pub tcd22_soff: TCD22_SOFF, | ||
596 | #[doc = "0x12c6 - TCD Transfer Attributes"] | ||
597 | pub tcd22_attr: TCD22_ATTR, | ||
598 | #[doc = "0x12c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
599 | pub tcd22_nbytes_mlno: TCD22_NBYTES_MLNO, | ||
600 | #[doc = "0x12cc - TCD Last Source Address Adjustment"] | ||
601 | pub tcd22_slast: TCD22_SLAST, | ||
602 | #[doc = "0x12d0 - TCD Destination Address"] | ||
603 | pub tcd22_daddr: TCD22_DADDR, | ||
604 | #[doc = "0x12d4 - TCD Signed Destination Address Offset"] | ||
605 | pub tcd22_doff: TCD22_DOFF, | ||
606 | #[doc = "0x12d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
607 | pub tcd22_citer_elinkno: TCD22_CITER_ELINKNO, | ||
608 | #[doc = "0x12d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
609 | pub tcd22_dlastsga: TCD22_DLASTSGA, | ||
610 | #[doc = "0x12dc - TCD Control and Status"] | ||
611 | pub tcd22_csr: TCD22_CSR, | ||
612 | #[doc = "0x12de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
613 | pub tcd22_biter_elinkno: TCD22_BITER_ELINKNO, | ||
614 | #[doc = "0x12e0 - TCD Source Address"] | ||
615 | pub tcd23_saddr: TCD23_SADDR, | ||
616 | #[doc = "0x12e4 - TCD Signed Source Address Offset"] | ||
617 | pub tcd23_soff: TCD23_SOFF, | ||
618 | #[doc = "0x12e6 - TCD Transfer Attributes"] | ||
619 | pub tcd23_attr: TCD23_ATTR, | ||
620 | #[doc = "0x12e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
621 | pub tcd23_nbytes_mlno: TCD23_NBYTES_MLNO, | ||
622 | #[doc = "0x12ec - TCD Last Source Address Adjustment"] | ||
623 | pub tcd23_slast: TCD23_SLAST, | ||
624 | #[doc = "0x12f0 - TCD Destination Address"] | ||
625 | pub tcd23_daddr: TCD23_DADDR, | ||
626 | #[doc = "0x12f4 - TCD Signed Destination Address Offset"] | ||
627 | pub tcd23_doff: TCD23_DOFF, | ||
628 | #[doc = "0x12f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
629 | pub tcd23_citer_elinkno: TCD23_CITER_ELINKNO, | ||
630 | #[doc = "0x12f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
631 | pub tcd23_dlastsga: TCD23_DLASTSGA, | ||
632 | #[doc = "0x12fc - TCD Control and Status"] | ||
633 | pub tcd23_csr: TCD23_CSR, | ||
634 | #[doc = "0x12fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
635 | pub tcd23_biter_elinkno: TCD23_BITER_ELINKNO, | ||
636 | #[doc = "0x1300 - TCD Source Address"] | ||
637 | pub tcd24_saddr: TCD24_SADDR, | ||
638 | #[doc = "0x1304 - TCD Signed Source Address Offset"] | ||
639 | pub tcd24_soff: TCD24_SOFF, | ||
640 | #[doc = "0x1306 - TCD Transfer Attributes"] | ||
641 | pub tcd24_attr: TCD24_ATTR, | ||
642 | #[doc = "0x1308 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
643 | pub tcd24_nbytes_mlno: TCD24_NBYTES_MLNO, | ||
644 | #[doc = "0x130c - TCD Last Source Address Adjustment"] | ||
645 | pub tcd24_slast: TCD24_SLAST, | ||
646 | #[doc = "0x1310 - TCD Destination Address"] | ||
647 | pub tcd24_daddr: TCD24_DADDR, | ||
648 | #[doc = "0x1314 - TCD Signed Destination Address Offset"] | ||
649 | pub tcd24_doff: TCD24_DOFF, | ||
650 | #[doc = "0x1316 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
651 | pub tcd24_citer_elinkno: TCD24_CITER_ELINKNO, | ||
652 | #[doc = "0x1318 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
653 | pub tcd24_dlastsga: TCD24_DLASTSGA, | ||
654 | #[doc = "0x131c - TCD Control and Status"] | ||
655 | pub tcd24_csr: TCD24_CSR, | ||
656 | #[doc = "0x131e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
657 | pub tcd24_biter_elinkno: TCD24_BITER_ELINKNO, | ||
658 | #[doc = "0x1320 - TCD Source Address"] | ||
659 | pub tcd25_saddr: TCD25_SADDR, | ||
660 | #[doc = "0x1324 - TCD Signed Source Address Offset"] | ||
661 | pub tcd25_soff: TCD25_SOFF, | ||
662 | #[doc = "0x1326 - TCD Transfer Attributes"] | ||
663 | pub tcd25_attr: TCD25_ATTR, | ||
664 | #[doc = "0x1328 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
665 | pub tcd25_nbytes_mlno: TCD25_NBYTES_MLNO, | ||
666 | #[doc = "0x132c - TCD Last Source Address Adjustment"] | ||
667 | pub tcd25_slast: TCD25_SLAST, | ||
668 | #[doc = "0x1330 - TCD Destination Address"] | ||
669 | pub tcd25_daddr: TCD25_DADDR, | ||
670 | #[doc = "0x1334 - TCD Signed Destination Address Offset"] | ||
671 | pub tcd25_doff: TCD25_DOFF, | ||
672 | #[doc = "0x1336 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
673 | pub tcd25_citer_elinkno: TCD25_CITER_ELINKNO, | ||
674 | #[doc = "0x1338 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
675 | pub tcd25_dlastsga: TCD25_DLASTSGA, | ||
676 | #[doc = "0x133c - TCD Control and Status"] | ||
677 | pub tcd25_csr: TCD25_CSR, | ||
678 | #[doc = "0x133e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
679 | pub tcd25_biter_elinkno: TCD25_BITER_ELINKNO, | ||
680 | #[doc = "0x1340 - TCD Source Address"] | ||
681 | pub tcd26_saddr: TCD26_SADDR, | ||
682 | #[doc = "0x1344 - TCD Signed Source Address Offset"] | ||
683 | pub tcd26_soff: TCD26_SOFF, | ||
684 | #[doc = "0x1346 - TCD Transfer Attributes"] | ||
685 | pub tcd26_attr: TCD26_ATTR, | ||
686 | #[doc = "0x1348 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
687 | pub tcd26_nbytes_mlno: TCD26_NBYTES_MLNO, | ||
688 | #[doc = "0x134c - TCD Last Source Address Adjustment"] | ||
689 | pub tcd26_slast: TCD26_SLAST, | ||
690 | #[doc = "0x1350 - TCD Destination Address"] | ||
691 | pub tcd26_daddr: TCD26_DADDR, | ||
692 | #[doc = "0x1354 - TCD Signed Destination Address Offset"] | ||
693 | pub tcd26_doff: TCD26_DOFF, | ||
694 | #[doc = "0x1356 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
695 | pub tcd26_citer_elinkno: TCD26_CITER_ELINKNO, | ||
696 | #[doc = "0x1358 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
697 | pub tcd26_dlastsga: TCD26_DLASTSGA, | ||
698 | #[doc = "0x135c - TCD Control and Status"] | ||
699 | pub tcd26_csr: TCD26_CSR, | ||
700 | #[doc = "0x135e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
701 | pub tcd26_biter_elinkno: TCD26_BITER_ELINKNO, | ||
702 | #[doc = "0x1360 - TCD Source Address"] | ||
703 | pub tcd27_saddr: TCD27_SADDR, | ||
704 | #[doc = "0x1364 - TCD Signed Source Address Offset"] | ||
705 | pub tcd27_soff: TCD27_SOFF, | ||
706 | #[doc = "0x1366 - TCD Transfer Attributes"] | ||
707 | pub tcd27_attr: TCD27_ATTR, | ||
708 | #[doc = "0x1368 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
709 | pub tcd27_nbytes_mlno: TCD27_NBYTES_MLNO, | ||
710 | #[doc = "0x136c - TCD Last Source Address Adjustment"] | ||
711 | pub tcd27_slast: TCD27_SLAST, | ||
712 | #[doc = "0x1370 - TCD Destination Address"] | ||
713 | pub tcd27_daddr: TCD27_DADDR, | ||
714 | #[doc = "0x1374 - TCD Signed Destination Address Offset"] | ||
715 | pub tcd27_doff: TCD27_DOFF, | ||
716 | #[doc = "0x1376 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
717 | pub tcd27_citer_elinkno: TCD27_CITER_ELINKNO, | ||
718 | #[doc = "0x1378 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
719 | pub tcd27_dlastsga: TCD27_DLASTSGA, | ||
720 | #[doc = "0x137c - TCD Control and Status"] | ||
721 | pub tcd27_csr: TCD27_CSR, | ||
722 | #[doc = "0x137e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
723 | pub tcd27_biter_elinkno: TCD27_BITER_ELINKNO, | ||
724 | #[doc = "0x1380 - TCD Source Address"] | ||
725 | pub tcd28_saddr: TCD28_SADDR, | ||
726 | #[doc = "0x1384 - TCD Signed Source Address Offset"] | ||
727 | pub tcd28_soff: TCD28_SOFF, | ||
728 | #[doc = "0x1386 - TCD Transfer Attributes"] | ||
729 | pub tcd28_attr: TCD28_ATTR, | ||
730 | #[doc = "0x1388 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
731 | pub tcd28_nbytes_mlno: TCD28_NBYTES_MLNO, | ||
732 | #[doc = "0x138c - TCD Last Source Address Adjustment"] | ||
733 | pub tcd28_slast: TCD28_SLAST, | ||
734 | #[doc = "0x1390 - TCD Destination Address"] | ||
735 | pub tcd28_daddr: TCD28_DADDR, | ||
736 | #[doc = "0x1394 - TCD Signed Destination Address Offset"] | ||
737 | pub tcd28_doff: TCD28_DOFF, | ||
738 | #[doc = "0x1396 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
739 | pub tcd28_citer_elinkno: TCD28_CITER_ELINKNO, | ||
740 | #[doc = "0x1398 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
741 | pub tcd28_dlastsga: TCD28_DLASTSGA, | ||
742 | #[doc = "0x139c - TCD Control and Status"] | ||
743 | pub tcd28_csr: TCD28_CSR, | ||
744 | #[doc = "0x139e - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
745 | pub tcd28_biter_elinkno: TCD28_BITER_ELINKNO, | ||
746 | #[doc = "0x13a0 - TCD Source Address"] | ||
747 | pub tcd29_saddr: TCD29_SADDR, | ||
748 | #[doc = "0x13a4 - TCD Signed Source Address Offset"] | ||
749 | pub tcd29_soff: TCD29_SOFF, | ||
750 | #[doc = "0x13a6 - TCD Transfer Attributes"] | ||
751 | pub tcd29_attr: TCD29_ATTR, | ||
752 | #[doc = "0x13a8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
753 | pub tcd29_nbytes_mlno: TCD29_NBYTES_MLNO, | ||
754 | #[doc = "0x13ac - TCD Last Source Address Adjustment"] | ||
755 | pub tcd29_slast: TCD29_SLAST, | ||
756 | #[doc = "0x13b0 - TCD Destination Address"] | ||
757 | pub tcd29_daddr: TCD29_DADDR, | ||
758 | #[doc = "0x13b4 - TCD Signed Destination Address Offset"] | ||
759 | pub tcd29_doff: TCD29_DOFF, | ||
760 | #[doc = "0x13b6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
761 | pub tcd29_citer_elinkno: TCD29_CITER_ELINKNO, | ||
762 | #[doc = "0x13b8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
763 | pub tcd29_dlastsga: TCD29_DLASTSGA, | ||
764 | #[doc = "0x13bc - TCD Control and Status"] | ||
765 | pub tcd29_csr: TCD29_CSR, | ||
766 | #[doc = "0x13be - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
767 | pub tcd29_biter_elinkno: TCD29_BITER_ELINKNO, | ||
768 | #[doc = "0x13c0 - TCD Source Address"] | ||
769 | pub tcd30_saddr: TCD30_SADDR, | ||
770 | #[doc = "0x13c4 - TCD Signed Source Address Offset"] | ||
771 | pub tcd30_soff: TCD30_SOFF, | ||
772 | #[doc = "0x13c6 - TCD Transfer Attributes"] | ||
773 | pub tcd30_attr: TCD30_ATTR, | ||
774 | #[doc = "0x13c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
775 | pub tcd30_nbytes_mlno: TCD30_NBYTES_MLNO, | ||
776 | #[doc = "0x13cc - TCD Last Source Address Adjustment"] | ||
777 | pub tcd30_slast: TCD30_SLAST, | ||
778 | #[doc = "0x13d0 - TCD Destination Address"] | ||
779 | pub tcd30_daddr: TCD30_DADDR, | ||
780 | #[doc = "0x13d4 - TCD Signed Destination Address Offset"] | ||
781 | pub tcd30_doff: TCD30_DOFF, | ||
782 | #[doc = "0x13d6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
783 | pub tcd30_citer_elinkno: TCD30_CITER_ELINKNO, | ||
784 | #[doc = "0x13d8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
785 | pub tcd30_dlastsga: TCD30_DLASTSGA, | ||
786 | #[doc = "0x13dc - TCD Control and Status"] | ||
787 | pub tcd30_csr: TCD30_CSR, | ||
788 | #[doc = "0x13de - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
789 | pub tcd30_biter_elinkno: TCD30_BITER_ELINKNO, | ||
790 | #[doc = "0x13e0 - TCD Source Address"] | ||
791 | pub tcd31_saddr: TCD31_SADDR, | ||
792 | #[doc = "0x13e4 - TCD Signed Source Address Offset"] | ||
793 | pub tcd31_soff: TCD31_SOFF, | ||
794 | #[doc = "0x13e6 - TCD Transfer Attributes"] | ||
795 | pub tcd31_attr: TCD31_ATTR, | ||
796 | #[doc = "0x13e8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
797 | pub tcd31_nbytes_mlno: TCD31_NBYTES_MLNO, | ||
798 | #[doc = "0x13ec - TCD Last Source Address Adjustment"] | ||
799 | pub tcd31_slast: TCD31_SLAST, | ||
800 | #[doc = "0x13f0 - TCD Destination Address"] | ||
801 | pub tcd31_daddr: TCD31_DADDR, | ||
802 | #[doc = "0x13f4 - TCD Signed Destination Address Offset"] | ||
803 | pub tcd31_doff: TCD31_DOFF, | ||
804 | #[doc = "0x13f6 - TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
805 | pub tcd31_citer_elinkno: TCD31_CITER_ELINKNO, | ||
806 | #[doc = "0x13f8 - TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
807 | pub tcd31_dlastsga: TCD31_DLASTSGA, | ||
808 | #[doc = "0x13fc - TCD Control and Status"] | ||
809 | pub tcd31_csr: TCD31_CSR, | ||
810 | #[doc = "0x13fe - TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
811 | pub tcd31_biter_elinkno: TCD31_BITER_ELINKNO, | ||
812 | } | ||
813 | #[doc = "Control Register"] | ||
814 | pub struct CR { | ||
815 | register: VolatileCell<u32>, | ||
816 | } | ||
817 | #[doc = "Control Register"] | ||
818 | pub mod cr; | ||
819 | #[doc = "Error Status Register"] | ||
820 | pub struct ES { | ||
821 | register: VolatileCell<u32>, | ||
822 | } | ||
823 | #[doc = "Error Status Register"] | ||
824 | pub mod es; | ||
825 | #[doc = "Enable Request Register"] | ||
826 | pub struct ERQ { | ||
827 | register: VolatileCell<u32>, | ||
828 | } | ||
829 | #[doc = "Enable Request Register"] | ||
830 | pub mod erq; | ||
831 | #[doc = "Enable Error Interrupt Register"] | ||
832 | pub struct EEI { | ||
833 | register: VolatileCell<u32>, | ||
834 | } | ||
835 | #[doc = "Enable Error Interrupt Register"] | ||
836 | pub mod eei; | ||
837 | #[doc = "Clear Enable Error Interrupt Register"] | ||
838 | pub struct CEEI { | ||
839 | register: VolatileCell<u8>, | ||
840 | } | ||
841 | #[doc = "Clear Enable Error Interrupt Register"] | ||
842 | pub mod ceei; | ||
843 | #[doc = "Set Enable Error Interrupt Register"] | ||
844 | pub struct SEEI { | ||
845 | register: VolatileCell<u8>, | ||
846 | } | ||
847 | #[doc = "Set Enable Error Interrupt Register"] | ||
848 | pub mod seei; | ||
849 | #[doc = "Clear Enable Request Register"] | ||
850 | pub struct CERQ { | ||
851 | register: VolatileCell<u8>, | ||
852 | } | ||
853 | #[doc = "Clear Enable Request Register"] | ||
854 | pub mod cerq; | ||
855 | #[doc = "Set Enable Request Register"] | ||
856 | pub struct SERQ { | ||
857 | register: VolatileCell<u8>, | ||
858 | } | ||
859 | #[doc = "Set Enable Request Register"] | ||
860 | pub mod serq; | ||
861 | #[doc = "Clear DONE Status Bit Register"] | ||
862 | pub struct CDNE { | ||
863 | register: VolatileCell<u8>, | ||
864 | } | ||
865 | #[doc = "Clear DONE Status Bit Register"] | ||
866 | pub mod cdne; | ||
867 | #[doc = "Set START Bit Register"] | ||
868 | pub struct SSRT { | ||
869 | register: VolatileCell<u8>, | ||
870 | } | ||
871 | #[doc = "Set START Bit Register"] | ||
872 | pub mod ssrt; | ||
873 | #[doc = "Clear Error Register"] | ||
874 | pub struct CERR { | ||
875 | register: VolatileCell<u8>, | ||
876 | } | ||
877 | #[doc = "Clear Error Register"] | ||
878 | pub mod cerr; | ||
879 | #[doc = "Clear Interrupt Request Register"] | ||
880 | pub struct CINT { | ||
881 | register: VolatileCell<u8>, | ||
882 | } | ||
883 | #[doc = "Clear Interrupt Request Register"] | ||
884 | pub mod cint; | ||
885 | #[doc = "Interrupt Request Register"] | ||
886 | pub struct INT { | ||
887 | register: VolatileCell<u32>, | ||
888 | } | ||
889 | #[doc = "Interrupt Request Register"] | ||
890 | pub mod int; | ||
891 | #[doc = "Error Register"] | ||
892 | pub struct ERR { | ||
893 | register: VolatileCell<u32>, | ||
894 | } | ||
895 | #[doc = "Error Register"] | ||
896 | pub mod err; | ||
897 | #[doc = "Hardware Request Status Register"] | ||
898 | pub struct HRS { | ||
899 | register: VolatileCell<u32>, | ||
900 | } | ||
901 | #[doc = "Hardware Request Status Register"] | ||
902 | pub mod hrs; | ||
903 | #[doc = "Enable Asynchronous Request in Stop Register"] | ||
904 | pub struct EARS { | ||
905 | register: VolatileCell<u32>, | ||
906 | } | ||
907 | #[doc = "Enable Asynchronous Request in Stop Register"] | ||
908 | pub mod ears; | ||
909 | #[doc = "Channel n Priority Register"] | ||
910 | pub struct DCHPRI3 { | ||
911 | register: VolatileCell<u8>, | ||
912 | } | ||
913 | #[doc = "Channel n Priority Register"] | ||
914 | pub mod dchpri3; | ||
915 | #[doc = "Channel n Priority Register"] | ||
916 | pub struct DCHPRI2 { | ||
917 | register: VolatileCell<u8>, | ||
918 | } | ||
919 | #[doc = "Channel n Priority Register"] | ||
920 | pub mod dchpri2; | ||
921 | #[doc = "Channel n Priority Register"] | ||
922 | pub struct DCHPRI1 { | ||
923 | register: VolatileCell<u8>, | ||
924 | } | ||
925 | #[doc = "Channel n Priority Register"] | ||
926 | pub mod dchpri1; | ||
927 | #[doc = "Channel n Priority Register"] | ||
928 | pub struct DCHPRI0 { | ||
929 | register: VolatileCell<u8>, | ||
930 | } | ||
931 | #[doc = "Channel n Priority Register"] | ||
932 | pub mod dchpri0; | ||
933 | #[doc = "Channel n Priority Register"] | ||
934 | pub struct DCHPRI7 { | ||
935 | register: VolatileCell<u8>, | ||
936 | } | ||
937 | #[doc = "Channel n Priority Register"] | ||
938 | pub mod dchpri7; | ||
939 | #[doc = "Channel n Priority Register"] | ||
940 | pub struct DCHPRI6 { | ||
941 | register: VolatileCell<u8>, | ||
942 | } | ||
943 | #[doc = "Channel n Priority Register"] | ||
944 | pub mod dchpri6; | ||
945 | #[doc = "Channel n Priority Register"] | ||
946 | pub struct DCHPRI5 { | ||
947 | register: VolatileCell<u8>, | ||
948 | } | ||
949 | #[doc = "Channel n Priority Register"] | ||
950 | pub mod dchpri5; | ||
951 | #[doc = "Channel n Priority Register"] | ||
952 | pub struct DCHPRI4 { | ||
953 | register: VolatileCell<u8>, | ||
954 | } | ||
955 | #[doc = "Channel n Priority Register"] | ||
956 | pub mod dchpri4; | ||
957 | #[doc = "Channel n Priority Register"] | ||
958 | pub struct DCHPRI11 { | ||
959 | register: VolatileCell<u8>, | ||
960 | } | ||
961 | #[doc = "Channel n Priority Register"] | ||
962 | pub mod dchpri11; | ||
963 | #[doc = "Channel n Priority Register"] | ||
964 | pub struct DCHPRI10 { | ||
965 | register: VolatileCell<u8>, | ||
966 | } | ||
967 | #[doc = "Channel n Priority Register"] | ||
968 | pub mod dchpri10; | ||
969 | #[doc = "Channel n Priority Register"] | ||
970 | pub struct DCHPRI9 { | ||
971 | register: VolatileCell<u8>, | ||
972 | } | ||
973 | #[doc = "Channel n Priority Register"] | ||
974 | pub mod dchpri9; | ||
975 | #[doc = "Channel n Priority Register"] | ||
976 | pub struct DCHPRI8 { | ||
977 | register: VolatileCell<u8>, | ||
978 | } | ||
979 | #[doc = "Channel n Priority Register"] | ||
980 | pub mod dchpri8; | ||
981 | #[doc = "Channel n Priority Register"] | ||
982 | pub struct DCHPRI15 { | ||
983 | register: VolatileCell<u8>, | ||
984 | } | ||
985 | #[doc = "Channel n Priority Register"] | ||
986 | pub mod dchpri15; | ||
987 | #[doc = "Channel n Priority Register"] | ||
988 | pub struct DCHPRI14 { | ||
989 | register: VolatileCell<u8>, | ||
990 | } | ||
991 | #[doc = "Channel n Priority Register"] | ||
992 | pub mod dchpri14; | ||
993 | #[doc = "Channel n Priority Register"] | ||
994 | pub struct DCHPRI13 { | ||
995 | register: VolatileCell<u8>, | ||
996 | } | ||
997 | #[doc = "Channel n Priority Register"] | ||
998 | pub mod dchpri13; | ||
999 | #[doc = "Channel n Priority Register"] | ||
1000 | pub struct DCHPRI12 { | ||
1001 | register: VolatileCell<u8>, | ||
1002 | } | ||
1003 | #[doc = "Channel n Priority Register"] | ||
1004 | pub mod dchpri12; | ||
1005 | #[doc = "Channel n Priority Register"] | ||
1006 | pub struct DCHPRI19 { | ||
1007 | register: VolatileCell<u8>, | ||
1008 | } | ||
1009 | #[doc = "Channel n Priority Register"] | ||
1010 | pub mod dchpri19; | ||
1011 | #[doc = "Channel n Priority Register"] | ||
1012 | pub struct DCHPRI18 { | ||
1013 | register: VolatileCell<u8>, | ||
1014 | } | ||
1015 | #[doc = "Channel n Priority Register"] | ||
1016 | pub mod dchpri18; | ||
1017 | #[doc = "Channel n Priority Register"] | ||
1018 | pub struct DCHPRI17 { | ||
1019 | register: VolatileCell<u8>, | ||
1020 | } | ||
1021 | #[doc = "Channel n Priority Register"] | ||
1022 | pub mod dchpri17; | ||
1023 | #[doc = "Channel n Priority Register"] | ||
1024 | pub struct DCHPRI16 { | ||
1025 | register: VolatileCell<u8>, | ||
1026 | } | ||
1027 | #[doc = "Channel n Priority Register"] | ||
1028 | pub mod dchpri16; | ||
1029 | #[doc = "Channel n Priority Register"] | ||
1030 | pub struct DCHPRI23 { | ||
1031 | register: VolatileCell<u8>, | ||
1032 | } | ||
1033 | #[doc = "Channel n Priority Register"] | ||
1034 | pub mod dchpri23; | ||
1035 | #[doc = "Channel n Priority Register"] | ||
1036 | pub struct DCHPRI22 { | ||
1037 | register: VolatileCell<u8>, | ||
1038 | } | ||
1039 | #[doc = "Channel n Priority Register"] | ||
1040 | pub mod dchpri22; | ||
1041 | #[doc = "Channel n Priority Register"] | ||
1042 | pub struct DCHPRI21 { | ||
1043 | register: VolatileCell<u8>, | ||
1044 | } | ||
1045 | #[doc = "Channel n Priority Register"] | ||
1046 | pub mod dchpri21; | ||
1047 | #[doc = "Channel n Priority Register"] | ||
1048 | pub struct DCHPRI20 { | ||
1049 | register: VolatileCell<u8>, | ||
1050 | } | ||
1051 | #[doc = "Channel n Priority Register"] | ||
1052 | pub mod dchpri20; | ||
1053 | #[doc = "Channel n Priority Register"] | ||
1054 | pub struct DCHPRI27 { | ||
1055 | register: VolatileCell<u8>, | ||
1056 | } | ||
1057 | #[doc = "Channel n Priority Register"] | ||
1058 | pub mod dchpri27; | ||
1059 | #[doc = "Channel n Priority Register"] | ||
1060 | pub struct DCHPRI26 { | ||
1061 | register: VolatileCell<u8>, | ||
1062 | } | ||
1063 | #[doc = "Channel n Priority Register"] | ||
1064 | pub mod dchpri26; | ||
1065 | #[doc = "Channel n Priority Register"] | ||
1066 | pub struct DCHPRI25 { | ||
1067 | register: VolatileCell<u8>, | ||
1068 | } | ||
1069 | #[doc = "Channel n Priority Register"] | ||
1070 | pub mod dchpri25; | ||
1071 | #[doc = "Channel n Priority Register"] | ||
1072 | pub struct DCHPRI24 { | ||
1073 | register: VolatileCell<u8>, | ||
1074 | } | ||
1075 | #[doc = "Channel n Priority Register"] | ||
1076 | pub mod dchpri24; | ||
1077 | #[doc = "Channel n Priority Register"] | ||
1078 | pub struct DCHPRI31 { | ||
1079 | register: VolatileCell<u8>, | ||
1080 | } | ||
1081 | #[doc = "Channel n Priority Register"] | ||
1082 | pub mod dchpri31; | ||
1083 | #[doc = "Channel n Priority Register"] | ||
1084 | pub struct DCHPRI30 { | ||
1085 | register: VolatileCell<u8>, | ||
1086 | } | ||
1087 | #[doc = "Channel n Priority Register"] | ||
1088 | pub mod dchpri30; | ||
1089 | #[doc = "Channel n Priority Register"] | ||
1090 | pub struct DCHPRI29 { | ||
1091 | register: VolatileCell<u8>, | ||
1092 | } | ||
1093 | #[doc = "Channel n Priority Register"] | ||
1094 | pub mod dchpri29; | ||
1095 | #[doc = "Channel n Priority Register"] | ||
1096 | pub struct DCHPRI28 { | ||
1097 | register: VolatileCell<u8>, | ||
1098 | } | ||
1099 | #[doc = "Channel n Priority Register"] | ||
1100 | pub mod dchpri28; | ||
1101 | #[doc = "TCD Source Address"] | ||
1102 | pub struct TCD0_SADDR { | ||
1103 | register: VolatileCell<u32>, | ||
1104 | } | ||
1105 | #[doc = "TCD Source Address"] | ||
1106 | pub mod tcd0_saddr; | ||
1107 | #[doc = "TCD Signed Source Address Offset"] | ||
1108 | pub struct TCD0_SOFF { | ||
1109 | register: VolatileCell<u16>, | ||
1110 | } | ||
1111 | #[doc = "TCD Signed Source Address Offset"] | ||
1112 | pub mod tcd0_soff; | ||
1113 | #[doc = "TCD Transfer Attributes"] | ||
1114 | pub struct TCD0_ATTR { | ||
1115 | register: VolatileCell<u16>, | ||
1116 | } | ||
1117 | #[doc = "TCD Transfer Attributes"] | ||
1118 | pub mod tcd0_attr; | ||
1119 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1120 | pub struct TCD0_NBYTES_MLNO { | ||
1121 | register: VolatileCell<u32>, | ||
1122 | } | ||
1123 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1124 | pub mod tcd0_nbytes_mlno; | ||
1125 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1126 | pub struct TCD0_NBYTES_MLOFFNO { | ||
1127 | register: VolatileCell<u32>, | ||
1128 | } | ||
1129 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1130 | pub mod tcd0_nbytes_mloffno; | ||
1131 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1132 | pub struct TCD0_NBYTES_MLOFFYES { | ||
1133 | register: VolatileCell<u32>, | ||
1134 | } | ||
1135 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1136 | pub mod tcd0_nbytes_mloffyes; | ||
1137 | #[doc = "TCD Last Source Address Adjustment"] | ||
1138 | pub struct TCD0_SLAST { | ||
1139 | register: VolatileCell<u32>, | ||
1140 | } | ||
1141 | #[doc = "TCD Last Source Address Adjustment"] | ||
1142 | pub mod tcd0_slast; | ||
1143 | #[doc = "TCD Destination Address"] | ||
1144 | pub struct TCD0_DADDR { | ||
1145 | register: VolatileCell<u32>, | ||
1146 | } | ||
1147 | #[doc = "TCD Destination Address"] | ||
1148 | pub mod tcd0_daddr; | ||
1149 | #[doc = "TCD Signed Destination Address Offset"] | ||
1150 | pub struct TCD0_DOFF { | ||
1151 | register: VolatileCell<u16>, | ||
1152 | } | ||
1153 | #[doc = "TCD Signed Destination Address Offset"] | ||
1154 | pub mod tcd0_doff; | ||
1155 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1156 | pub struct TCD0_CITER_ELINKNO { | ||
1157 | register: VolatileCell<u16>, | ||
1158 | } | ||
1159 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1160 | pub mod tcd0_citer_elinkno; | ||
1161 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1162 | pub struct TCD0_CITER_ELINKYES { | ||
1163 | register: VolatileCell<u16>, | ||
1164 | } | ||
1165 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1166 | pub mod tcd0_citer_elinkyes; | ||
1167 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1168 | pub struct TCD0_DLASTSGA { | ||
1169 | register: VolatileCell<u32>, | ||
1170 | } | ||
1171 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1172 | pub mod tcd0_dlastsga; | ||
1173 | #[doc = "TCD Control and Status"] | ||
1174 | pub struct TCD0_CSR { | ||
1175 | register: VolatileCell<u16>, | ||
1176 | } | ||
1177 | #[doc = "TCD Control and Status"] | ||
1178 | pub mod tcd0_csr; | ||
1179 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1180 | pub struct TCD0_BITER_ELINKNO { | ||
1181 | register: VolatileCell<u16>, | ||
1182 | } | ||
1183 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1184 | pub mod tcd0_biter_elinkno; | ||
1185 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1186 | pub struct TCD0_BITER_ELINKYES { | ||
1187 | register: VolatileCell<u16>, | ||
1188 | } | ||
1189 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1190 | pub mod tcd0_biter_elinkyes; | ||
1191 | #[doc = "TCD Source Address"] | ||
1192 | pub struct TCD1_SADDR { | ||
1193 | register: VolatileCell<u32>, | ||
1194 | } | ||
1195 | #[doc = "TCD Source Address"] | ||
1196 | pub mod tcd1_saddr; | ||
1197 | #[doc = "TCD Signed Source Address Offset"] | ||
1198 | pub struct TCD1_SOFF { | ||
1199 | register: VolatileCell<u16>, | ||
1200 | } | ||
1201 | #[doc = "TCD Signed Source Address Offset"] | ||
1202 | pub mod tcd1_soff; | ||
1203 | #[doc = "TCD Transfer Attributes"] | ||
1204 | pub struct TCD1_ATTR { | ||
1205 | register: VolatileCell<u16>, | ||
1206 | } | ||
1207 | #[doc = "TCD Transfer Attributes"] | ||
1208 | pub mod tcd1_attr; | ||
1209 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1210 | pub struct TCD1_NBYTES_MLNO { | ||
1211 | register: VolatileCell<u32>, | ||
1212 | } | ||
1213 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1214 | pub mod tcd1_nbytes_mlno; | ||
1215 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1216 | pub struct TCD1_NBYTES_MLOFFNO { | ||
1217 | register: VolatileCell<u32>, | ||
1218 | } | ||
1219 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1220 | pub mod tcd1_nbytes_mloffno; | ||
1221 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1222 | pub struct TCD1_NBYTES_MLOFFYES { | ||
1223 | register: VolatileCell<u32>, | ||
1224 | } | ||
1225 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1226 | pub mod tcd1_nbytes_mloffyes; | ||
1227 | #[doc = "TCD Last Source Address Adjustment"] | ||
1228 | pub struct TCD1_SLAST { | ||
1229 | register: VolatileCell<u32>, | ||
1230 | } | ||
1231 | #[doc = "TCD Last Source Address Adjustment"] | ||
1232 | pub mod tcd1_slast; | ||
1233 | #[doc = "TCD Destination Address"] | ||
1234 | pub struct TCD1_DADDR { | ||
1235 | register: VolatileCell<u32>, | ||
1236 | } | ||
1237 | #[doc = "TCD Destination Address"] | ||
1238 | pub mod tcd1_daddr; | ||
1239 | #[doc = "TCD Signed Destination Address Offset"] | ||
1240 | pub struct TCD1_DOFF { | ||
1241 | register: VolatileCell<u16>, | ||
1242 | } | ||
1243 | #[doc = "TCD Signed Destination Address Offset"] | ||
1244 | pub mod tcd1_doff; | ||
1245 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1246 | pub struct TCD1_CITER_ELINKNO { | ||
1247 | register: VolatileCell<u16>, | ||
1248 | } | ||
1249 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1250 | pub mod tcd1_citer_elinkno; | ||
1251 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1252 | pub struct TCD1_CITER_ELINKYES { | ||
1253 | register: VolatileCell<u16>, | ||
1254 | } | ||
1255 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1256 | pub mod tcd1_citer_elinkyes; | ||
1257 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1258 | pub struct TCD1_DLASTSGA { | ||
1259 | register: VolatileCell<u32>, | ||
1260 | } | ||
1261 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1262 | pub mod tcd1_dlastsga; | ||
1263 | #[doc = "TCD Control and Status"] | ||
1264 | pub struct TCD1_CSR { | ||
1265 | register: VolatileCell<u16>, | ||
1266 | } | ||
1267 | #[doc = "TCD Control and Status"] | ||
1268 | pub mod tcd1_csr; | ||
1269 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1270 | pub struct TCD1_BITER_ELINKNO { | ||
1271 | register: VolatileCell<u16>, | ||
1272 | } | ||
1273 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1274 | pub mod tcd1_biter_elinkno; | ||
1275 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1276 | pub struct TCD1_BITER_ELINKYES { | ||
1277 | register: VolatileCell<u16>, | ||
1278 | } | ||
1279 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1280 | pub mod tcd1_biter_elinkyes; | ||
1281 | #[doc = "TCD Source Address"] | ||
1282 | pub struct TCD2_SADDR { | ||
1283 | register: VolatileCell<u32>, | ||
1284 | } | ||
1285 | #[doc = "TCD Source Address"] | ||
1286 | pub mod tcd2_saddr; | ||
1287 | #[doc = "TCD Signed Source Address Offset"] | ||
1288 | pub struct TCD2_SOFF { | ||
1289 | register: VolatileCell<u16>, | ||
1290 | } | ||
1291 | #[doc = "TCD Signed Source Address Offset"] | ||
1292 | pub mod tcd2_soff; | ||
1293 | #[doc = "TCD Transfer Attributes"] | ||
1294 | pub struct TCD2_ATTR { | ||
1295 | register: VolatileCell<u16>, | ||
1296 | } | ||
1297 | #[doc = "TCD Transfer Attributes"] | ||
1298 | pub mod tcd2_attr; | ||
1299 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1300 | pub struct TCD2_NBYTES_MLNO { | ||
1301 | register: VolatileCell<u32>, | ||
1302 | } | ||
1303 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1304 | pub mod tcd2_nbytes_mlno; | ||
1305 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1306 | pub struct TCD2_NBYTES_MLOFFNO { | ||
1307 | register: VolatileCell<u32>, | ||
1308 | } | ||
1309 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1310 | pub mod tcd2_nbytes_mloffno; | ||
1311 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1312 | pub struct TCD2_NBYTES_MLOFFYES { | ||
1313 | register: VolatileCell<u32>, | ||
1314 | } | ||
1315 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1316 | pub mod tcd2_nbytes_mloffyes; | ||
1317 | #[doc = "TCD Last Source Address Adjustment"] | ||
1318 | pub struct TCD2_SLAST { | ||
1319 | register: VolatileCell<u32>, | ||
1320 | } | ||
1321 | #[doc = "TCD Last Source Address Adjustment"] | ||
1322 | pub mod tcd2_slast; | ||
1323 | #[doc = "TCD Destination Address"] | ||
1324 | pub struct TCD2_DADDR { | ||
1325 | register: VolatileCell<u32>, | ||
1326 | } | ||
1327 | #[doc = "TCD Destination Address"] | ||
1328 | pub mod tcd2_daddr; | ||
1329 | #[doc = "TCD Signed Destination Address Offset"] | ||
1330 | pub struct TCD2_DOFF { | ||
1331 | register: VolatileCell<u16>, | ||
1332 | } | ||
1333 | #[doc = "TCD Signed Destination Address Offset"] | ||
1334 | pub mod tcd2_doff; | ||
1335 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1336 | pub struct TCD2_CITER_ELINKNO { | ||
1337 | register: VolatileCell<u16>, | ||
1338 | } | ||
1339 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1340 | pub mod tcd2_citer_elinkno; | ||
1341 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1342 | pub struct TCD2_CITER_ELINKYES { | ||
1343 | register: VolatileCell<u16>, | ||
1344 | } | ||
1345 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1346 | pub mod tcd2_citer_elinkyes; | ||
1347 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1348 | pub struct TCD2_DLASTSGA { | ||
1349 | register: VolatileCell<u32>, | ||
1350 | } | ||
1351 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1352 | pub mod tcd2_dlastsga; | ||
1353 | #[doc = "TCD Control and Status"] | ||
1354 | pub struct TCD2_CSR { | ||
1355 | register: VolatileCell<u16>, | ||
1356 | } | ||
1357 | #[doc = "TCD Control and Status"] | ||
1358 | pub mod tcd2_csr; | ||
1359 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1360 | pub struct TCD2_BITER_ELINKNO { | ||
1361 | register: VolatileCell<u16>, | ||
1362 | } | ||
1363 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1364 | pub mod tcd2_biter_elinkno; | ||
1365 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1366 | pub struct TCD2_BITER_ELINKYES { | ||
1367 | register: VolatileCell<u16>, | ||
1368 | } | ||
1369 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1370 | pub mod tcd2_biter_elinkyes; | ||
1371 | #[doc = "TCD Source Address"] | ||
1372 | pub struct TCD3_SADDR { | ||
1373 | register: VolatileCell<u32>, | ||
1374 | } | ||
1375 | #[doc = "TCD Source Address"] | ||
1376 | pub mod tcd3_saddr; | ||
1377 | #[doc = "TCD Signed Source Address Offset"] | ||
1378 | pub struct TCD3_SOFF { | ||
1379 | register: VolatileCell<u16>, | ||
1380 | } | ||
1381 | #[doc = "TCD Signed Source Address Offset"] | ||
1382 | pub mod tcd3_soff; | ||
1383 | #[doc = "TCD Transfer Attributes"] | ||
1384 | pub struct TCD3_ATTR { | ||
1385 | register: VolatileCell<u16>, | ||
1386 | } | ||
1387 | #[doc = "TCD Transfer Attributes"] | ||
1388 | pub mod tcd3_attr; | ||
1389 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1390 | pub struct TCD3_NBYTES_MLNO { | ||
1391 | register: VolatileCell<u32>, | ||
1392 | } | ||
1393 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1394 | pub mod tcd3_nbytes_mlno; | ||
1395 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1396 | pub struct TCD3_NBYTES_MLOFFNO { | ||
1397 | register: VolatileCell<u32>, | ||
1398 | } | ||
1399 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1400 | pub mod tcd3_nbytes_mloffno; | ||
1401 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1402 | pub struct TCD3_NBYTES_MLOFFYES { | ||
1403 | register: VolatileCell<u32>, | ||
1404 | } | ||
1405 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1406 | pub mod tcd3_nbytes_mloffyes; | ||
1407 | #[doc = "TCD Last Source Address Adjustment"] | ||
1408 | pub struct TCD3_SLAST { | ||
1409 | register: VolatileCell<u32>, | ||
1410 | } | ||
1411 | #[doc = "TCD Last Source Address Adjustment"] | ||
1412 | pub mod tcd3_slast; | ||
1413 | #[doc = "TCD Destination Address"] | ||
1414 | pub struct TCD3_DADDR { | ||
1415 | register: VolatileCell<u32>, | ||
1416 | } | ||
1417 | #[doc = "TCD Destination Address"] | ||
1418 | pub mod tcd3_daddr; | ||
1419 | #[doc = "TCD Signed Destination Address Offset"] | ||
1420 | pub struct TCD3_DOFF { | ||
1421 | register: VolatileCell<u16>, | ||
1422 | } | ||
1423 | #[doc = "TCD Signed Destination Address Offset"] | ||
1424 | pub mod tcd3_doff; | ||
1425 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1426 | pub struct TCD3_CITER_ELINKNO { | ||
1427 | register: VolatileCell<u16>, | ||
1428 | } | ||
1429 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1430 | pub mod tcd3_citer_elinkno; | ||
1431 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1432 | pub struct TCD3_CITER_ELINKYES { | ||
1433 | register: VolatileCell<u16>, | ||
1434 | } | ||
1435 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1436 | pub mod tcd3_citer_elinkyes; | ||
1437 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1438 | pub struct TCD3_DLASTSGA { | ||
1439 | register: VolatileCell<u32>, | ||
1440 | } | ||
1441 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1442 | pub mod tcd3_dlastsga; | ||
1443 | #[doc = "TCD Control and Status"] | ||
1444 | pub struct TCD3_CSR { | ||
1445 | register: VolatileCell<u16>, | ||
1446 | } | ||
1447 | #[doc = "TCD Control and Status"] | ||
1448 | pub mod tcd3_csr; | ||
1449 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1450 | pub struct TCD3_BITER_ELINKNO { | ||
1451 | register: VolatileCell<u16>, | ||
1452 | } | ||
1453 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1454 | pub mod tcd3_biter_elinkno; | ||
1455 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1456 | pub struct TCD3_BITER_ELINKYES { | ||
1457 | register: VolatileCell<u16>, | ||
1458 | } | ||
1459 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1460 | pub mod tcd3_biter_elinkyes; | ||
1461 | #[doc = "TCD Source Address"] | ||
1462 | pub struct TCD4_SADDR { | ||
1463 | register: VolatileCell<u32>, | ||
1464 | } | ||
1465 | #[doc = "TCD Source Address"] | ||
1466 | pub mod tcd4_saddr; | ||
1467 | #[doc = "TCD Signed Source Address Offset"] | ||
1468 | pub struct TCD4_SOFF { | ||
1469 | register: VolatileCell<u16>, | ||
1470 | } | ||
1471 | #[doc = "TCD Signed Source Address Offset"] | ||
1472 | pub mod tcd4_soff; | ||
1473 | #[doc = "TCD Transfer Attributes"] | ||
1474 | pub struct TCD4_ATTR { | ||
1475 | register: VolatileCell<u16>, | ||
1476 | } | ||
1477 | #[doc = "TCD Transfer Attributes"] | ||
1478 | pub mod tcd4_attr; | ||
1479 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1480 | pub struct TCD4_NBYTES_MLNO { | ||
1481 | register: VolatileCell<u32>, | ||
1482 | } | ||
1483 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1484 | pub mod tcd4_nbytes_mlno; | ||
1485 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1486 | pub struct TCD4_NBYTES_MLOFFNO { | ||
1487 | register: VolatileCell<u32>, | ||
1488 | } | ||
1489 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1490 | pub mod tcd4_nbytes_mloffno; | ||
1491 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1492 | pub struct TCD4_NBYTES_MLOFFYES { | ||
1493 | register: VolatileCell<u32>, | ||
1494 | } | ||
1495 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1496 | pub mod tcd4_nbytes_mloffyes; | ||
1497 | #[doc = "TCD Last Source Address Adjustment"] | ||
1498 | pub struct TCD4_SLAST { | ||
1499 | register: VolatileCell<u32>, | ||
1500 | } | ||
1501 | #[doc = "TCD Last Source Address Adjustment"] | ||
1502 | pub mod tcd4_slast; | ||
1503 | #[doc = "TCD Destination Address"] | ||
1504 | pub struct TCD4_DADDR { | ||
1505 | register: VolatileCell<u32>, | ||
1506 | } | ||
1507 | #[doc = "TCD Destination Address"] | ||
1508 | pub mod tcd4_daddr; | ||
1509 | #[doc = "TCD Signed Destination Address Offset"] | ||
1510 | pub struct TCD4_DOFF { | ||
1511 | register: VolatileCell<u16>, | ||
1512 | } | ||
1513 | #[doc = "TCD Signed Destination Address Offset"] | ||
1514 | pub mod tcd4_doff; | ||
1515 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1516 | pub struct TCD4_CITER_ELINKNO { | ||
1517 | register: VolatileCell<u16>, | ||
1518 | } | ||
1519 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1520 | pub mod tcd4_citer_elinkno; | ||
1521 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1522 | pub struct TCD4_CITER_ELINKYES { | ||
1523 | register: VolatileCell<u16>, | ||
1524 | } | ||
1525 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1526 | pub mod tcd4_citer_elinkyes; | ||
1527 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1528 | pub struct TCD4_DLASTSGA { | ||
1529 | register: VolatileCell<u32>, | ||
1530 | } | ||
1531 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1532 | pub mod tcd4_dlastsga; | ||
1533 | #[doc = "TCD Control and Status"] | ||
1534 | pub struct TCD4_CSR { | ||
1535 | register: VolatileCell<u16>, | ||
1536 | } | ||
1537 | #[doc = "TCD Control and Status"] | ||
1538 | pub mod tcd4_csr; | ||
1539 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1540 | pub struct TCD4_BITER_ELINKNO { | ||
1541 | register: VolatileCell<u16>, | ||
1542 | } | ||
1543 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1544 | pub mod tcd4_biter_elinkno; | ||
1545 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1546 | pub struct TCD4_BITER_ELINKYES { | ||
1547 | register: VolatileCell<u16>, | ||
1548 | } | ||
1549 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1550 | pub mod tcd4_biter_elinkyes; | ||
1551 | #[doc = "TCD Source Address"] | ||
1552 | pub struct TCD5_SADDR { | ||
1553 | register: VolatileCell<u32>, | ||
1554 | } | ||
1555 | #[doc = "TCD Source Address"] | ||
1556 | pub mod tcd5_saddr; | ||
1557 | #[doc = "TCD Signed Source Address Offset"] | ||
1558 | pub struct TCD5_SOFF { | ||
1559 | register: VolatileCell<u16>, | ||
1560 | } | ||
1561 | #[doc = "TCD Signed Source Address Offset"] | ||
1562 | pub mod tcd5_soff; | ||
1563 | #[doc = "TCD Transfer Attributes"] | ||
1564 | pub struct TCD5_ATTR { | ||
1565 | register: VolatileCell<u16>, | ||
1566 | } | ||
1567 | #[doc = "TCD Transfer Attributes"] | ||
1568 | pub mod tcd5_attr; | ||
1569 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1570 | pub struct TCD5_NBYTES_MLNO { | ||
1571 | register: VolatileCell<u32>, | ||
1572 | } | ||
1573 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1574 | pub mod tcd5_nbytes_mlno; | ||
1575 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1576 | pub struct TCD5_NBYTES_MLOFFNO { | ||
1577 | register: VolatileCell<u32>, | ||
1578 | } | ||
1579 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1580 | pub mod tcd5_nbytes_mloffno; | ||
1581 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1582 | pub struct TCD5_NBYTES_MLOFFYES { | ||
1583 | register: VolatileCell<u32>, | ||
1584 | } | ||
1585 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1586 | pub mod tcd5_nbytes_mloffyes; | ||
1587 | #[doc = "TCD Last Source Address Adjustment"] | ||
1588 | pub struct TCD5_SLAST { | ||
1589 | register: VolatileCell<u32>, | ||
1590 | } | ||
1591 | #[doc = "TCD Last Source Address Adjustment"] | ||
1592 | pub mod tcd5_slast; | ||
1593 | #[doc = "TCD Destination Address"] | ||
1594 | pub struct TCD5_DADDR { | ||
1595 | register: VolatileCell<u32>, | ||
1596 | } | ||
1597 | #[doc = "TCD Destination Address"] | ||
1598 | pub mod tcd5_daddr; | ||
1599 | #[doc = "TCD Signed Destination Address Offset"] | ||
1600 | pub struct TCD5_DOFF { | ||
1601 | register: VolatileCell<u16>, | ||
1602 | } | ||
1603 | #[doc = "TCD Signed Destination Address Offset"] | ||
1604 | pub mod tcd5_doff; | ||
1605 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1606 | pub struct TCD5_CITER_ELINKNO { | ||
1607 | register: VolatileCell<u16>, | ||
1608 | } | ||
1609 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1610 | pub mod tcd5_citer_elinkno; | ||
1611 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1612 | pub struct TCD5_CITER_ELINKYES { | ||
1613 | register: VolatileCell<u16>, | ||
1614 | } | ||
1615 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1616 | pub mod tcd5_citer_elinkyes; | ||
1617 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1618 | pub struct TCD5_DLASTSGA { | ||
1619 | register: VolatileCell<u32>, | ||
1620 | } | ||
1621 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1622 | pub mod tcd5_dlastsga; | ||
1623 | #[doc = "TCD Control and Status"] | ||
1624 | pub struct TCD5_CSR { | ||
1625 | register: VolatileCell<u16>, | ||
1626 | } | ||
1627 | #[doc = "TCD Control and Status"] | ||
1628 | pub mod tcd5_csr; | ||
1629 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1630 | pub struct TCD5_BITER_ELINKNO { | ||
1631 | register: VolatileCell<u16>, | ||
1632 | } | ||
1633 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1634 | pub mod tcd5_biter_elinkno; | ||
1635 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1636 | pub struct TCD5_BITER_ELINKYES { | ||
1637 | register: VolatileCell<u16>, | ||
1638 | } | ||
1639 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1640 | pub mod tcd5_biter_elinkyes; | ||
1641 | #[doc = "TCD Source Address"] | ||
1642 | pub struct TCD6_SADDR { | ||
1643 | register: VolatileCell<u32>, | ||
1644 | } | ||
1645 | #[doc = "TCD Source Address"] | ||
1646 | pub mod tcd6_saddr; | ||
1647 | #[doc = "TCD Signed Source Address Offset"] | ||
1648 | pub struct TCD6_SOFF { | ||
1649 | register: VolatileCell<u16>, | ||
1650 | } | ||
1651 | #[doc = "TCD Signed Source Address Offset"] | ||
1652 | pub mod tcd6_soff; | ||
1653 | #[doc = "TCD Transfer Attributes"] | ||
1654 | pub struct TCD6_ATTR { | ||
1655 | register: VolatileCell<u16>, | ||
1656 | } | ||
1657 | #[doc = "TCD Transfer Attributes"] | ||
1658 | pub mod tcd6_attr; | ||
1659 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1660 | pub struct TCD6_NBYTES_MLNO { | ||
1661 | register: VolatileCell<u32>, | ||
1662 | } | ||
1663 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1664 | pub mod tcd6_nbytes_mlno; | ||
1665 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1666 | pub struct TCD6_NBYTES_MLOFFNO { | ||
1667 | register: VolatileCell<u32>, | ||
1668 | } | ||
1669 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1670 | pub mod tcd6_nbytes_mloffno; | ||
1671 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1672 | pub struct TCD6_NBYTES_MLOFFYES { | ||
1673 | register: VolatileCell<u32>, | ||
1674 | } | ||
1675 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1676 | pub mod tcd6_nbytes_mloffyes; | ||
1677 | #[doc = "TCD Last Source Address Adjustment"] | ||
1678 | pub struct TCD6_SLAST { | ||
1679 | register: VolatileCell<u32>, | ||
1680 | } | ||
1681 | #[doc = "TCD Last Source Address Adjustment"] | ||
1682 | pub mod tcd6_slast; | ||
1683 | #[doc = "TCD Destination Address"] | ||
1684 | pub struct TCD6_DADDR { | ||
1685 | register: VolatileCell<u32>, | ||
1686 | } | ||
1687 | #[doc = "TCD Destination Address"] | ||
1688 | pub mod tcd6_daddr; | ||
1689 | #[doc = "TCD Signed Destination Address Offset"] | ||
1690 | pub struct TCD6_DOFF { | ||
1691 | register: VolatileCell<u16>, | ||
1692 | } | ||
1693 | #[doc = "TCD Signed Destination Address Offset"] | ||
1694 | pub mod tcd6_doff; | ||
1695 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1696 | pub struct TCD6_CITER_ELINKNO { | ||
1697 | register: VolatileCell<u16>, | ||
1698 | } | ||
1699 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1700 | pub mod tcd6_citer_elinkno; | ||
1701 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1702 | pub struct TCD6_CITER_ELINKYES { | ||
1703 | register: VolatileCell<u16>, | ||
1704 | } | ||
1705 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1706 | pub mod tcd6_citer_elinkyes; | ||
1707 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1708 | pub struct TCD6_DLASTSGA { | ||
1709 | register: VolatileCell<u32>, | ||
1710 | } | ||
1711 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1712 | pub mod tcd6_dlastsga; | ||
1713 | #[doc = "TCD Control and Status"] | ||
1714 | pub struct TCD6_CSR { | ||
1715 | register: VolatileCell<u16>, | ||
1716 | } | ||
1717 | #[doc = "TCD Control and Status"] | ||
1718 | pub mod tcd6_csr; | ||
1719 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1720 | pub struct TCD6_BITER_ELINKNO { | ||
1721 | register: VolatileCell<u16>, | ||
1722 | } | ||
1723 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1724 | pub mod tcd6_biter_elinkno; | ||
1725 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1726 | pub struct TCD6_BITER_ELINKYES { | ||
1727 | register: VolatileCell<u16>, | ||
1728 | } | ||
1729 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1730 | pub mod tcd6_biter_elinkyes; | ||
1731 | #[doc = "TCD Source Address"] | ||
1732 | pub struct TCD7_SADDR { | ||
1733 | register: VolatileCell<u32>, | ||
1734 | } | ||
1735 | #[doc = "TCD Source Address"] | ||
1736 | pub mod tcd7_saddr; | ||
1737 | #[doc = "TCD Signed Source Address Offset"] | ||
1738 | pub struct TCD7_SOFF { | ||
1739 | register: VolatileCell<u16>, | ||
1740 | } | ||
1741 | #[doc = "TCD Signed Source Address Offset"] | ||
1742 | pub mod tcd7_soff; | ||
1743 | #[doc = "TCD Transfer Attributes"] | ||
1744 | pub struct TCD7_ATTR { | ||
1745 | register: VolatileCell<u16>, | ||
1746 | } | ||
1747 | #[doc = "TCD Transfer Attributes"] | ||
1748 | pub mod tcd7_attr; | ||
1749 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1750 | pub struct TCD7_NBYTES_MLNO { | ||
1751 | register: VolatileCell<u32>, | ||
1752 | } | ||
1753 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1754 | pub mod tcd7_nbytes_mlno; | ||
1755 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1756 | pub struct TCD7_NBYTES_MLOFFNO { | ||
1757 | register: VolatileCell<u32>, | ||
1758 | } | ||
1759 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1760 | pub mod tcd7_nbytes_mloffno; | ||
1761 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1762 | pub struct TCD7_NBYTES_MLOFFYES { | ||
1763 | register: VolatileCell<u32>, | ||
1764 | } | ||
1765 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1766 | pub mod tcd7_nbytes_mloffyes; | ||
1767 | #[doc = "TCD Last Source Address Adjustment"] | ||
1768 | pub struct TCD7_SLAST { | ||
1769 | register: VolatileCell<u32>, | ||
1770 | } | ||
1771 | #[doc = "TCD Last Source Address Adjustment"] | ||
1772 | pub mod tcd7_slast; | ||
1773 | #[doc = "TCD Destination Address"] | ||
1774 | pub struct TCD7_DADDR { | ||
1775 | register: VolatileCell<u32>, | ||
1776 | } | ||
1777 | #[doc = "TCD Destination Address"] | ||
1778 | pub mod tcd7_daddr; | ||
1779 | #[doc = "TCD Signed Destination Address Offset"] | ||
1780 | pub struct TCD7_DOFF { | ||
1781 | register: VolatileCell<u16>, | ||
1782 | } | ||
1783 | #[doc = "TCD Signed Destination Address Offset"] | ||
1784 | pub mod tcd7_doff; | ||
1785 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1786 | pub struct TCD7_CITER_ELINKNO { | ||
1787 | register: VolatileCell<u16>, | ||
1788 | } | ||
1789 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1790 | pub mod tcd7_citer_elinkno; | ||
1791 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1792 | pub struct TCD7_CITER_ELINKYES { | ||
1793 | register: VolatileCell<u16>, | ||
1794 | } | ||
1795 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1796 | pub mod tcd7_citer_elinkyes; | ||
1797 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1798 | pub struct TCD7_DLASTSGA { | ||
1799 | register: VolatileCell<u32>, | ||
1800 | } | ||
1801 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1802 | pub mod tcd7_dlastsga; | ||
1803 | #[doc = "TCD Control and Status"] | ||
1804 | pub struct TCD7_CSR { | ||
1805 | register: VolatileCell<u16>, | ||
1806 | } | ||
1807 | #[doc = "TCD Control and Status"] | ||
1808 | pub mod tcd7_csr; | ||
1809 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1810 | pub struct TCD7_BITER_ELINKNO { | ||
1811 | register: VolatileCell<u16>, | ||
1812 | } | ||
1813 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1814 | pub mod tcd7_biter_elinkno; | ||
1815 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1816 | pub struct TCD7_BITER_ELINKYES { | ||
1817 | register: VolatileCell<u16>, | ||
1818 | } | ||
1819 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1820 | pub mod tcd7_biter_elinkyes; | ||
1821 | #[doc = "TCD Source Address"] | ||
1822 | pub struct TCD8_SADDR { | ||
1823 | register: VolatileCell<u32>, | ||
1824 | } | ||
1825 | #[doc = "TCD Source Address"] | ||
1826 | pub mod tcd8_saddr; | ||
1827 | #[doc = "TCD Signed Source Address Offset"] | ||
1828 | pub struct TCD8_SOFF { | ||
1829 | register: VolatileCell<u16>, | ||
1830 | } | ||
1831 | #[doc = "TCD Signed Source Address Offset"] | ||
1832 | pub mod tcd8_soff; | ||
1833 | #[doc = "TCD Transfer Attributes"] | ||
1834 | pub struct TCD8_ATTR { | ||
1835 | register: VolatileCell<u16>, | ||
1836 | } | ||
1837 | #[doc = "TCD Transfer Attributes"] | ||
1838 | pub mod tcd8_attr; | ||
1839 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1840 | pub struct TCD8_NBYTES_MLNO { | ||
1841 | register: VolatileCell<u32>, | ||
1842 | } | ||
1843 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1844 | pub mod tcd8_nbytes_mlno; | ||
1845 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1846 | pub struct TCD8_NBYTES_MLOFFNO { | ||
1847 | register: VolatileCell<u32>, | ||
1848 | } | ||
1849 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1850 | pub mod tcd8_nbytes_mloffno; | ||
1851 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1852 | pub struct TCD8_NBYTES_MLOFFYES { | ||
1853 | register: VolatileCell<u32>, | ||
1854 | } | ||
1855 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1856 | pub mod tcd8_nbytes_mloffyes; | ||
1857 | #[doc = "TCD Last Source Address Adjustment"] | ||
1858 | pub struct TCD8_SLAST { | ||
1859 | register: VolatileCell<u32>, | ||
1860 | } | ||
1861 | #[doc = "TCD Last Source Address Adjustment"] | ||
1862 | pub mod tcd8_slast; | ||
1863 | #[doc = "TCD Destination Address"] | ||
1864 | pub struct TCD8_DADDR { | ||
1865 | register: VolatileCell<u32>, | ||
1866 | } | ||
1867 | #[doc = "TCD Destination Address"] | ||
1868 | pub mod tcd8_daddr; | ||
1869 | #[doc = "TCD Signed Destination Address Offset"] | ||
1870 | pub struct TCD8_DOFF { | ||
1871 | register: VolatileCell<u16>, | ||
1872 | } | ||
1873 | #[doc = "TCD Signed Destination Address Offset"] | ||
1874 | pub mod tcd8_doff; | ||
1875 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1876 | pub struct TCD8_CITER_ELINKNO { | ||
1877 | register: VolatileCell<u16>, | ||
1878 | } | ||
1879 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1880 | pub mod tcd8_citer_elinkno; | ||
1881 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1882 | pub struct TCD8_CITER_ELINKYES { | ||
1883 | register: VolatileCell<u16>, | ||
1884 | } | ||
1885 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1886 | pub mod tcd8_citer_elinkyes; | ||
1887 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1888 | pub struct TCD8_DLASTSGA { | ||
1889 | register: VolatileCell<u32>, | ||
1890 | } | ||
1891 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1892 | pub mod tcd8_dlastsga; | ||
1893 | #[doc = "TCD Control and Status"] | ||
1894 | pub struct TCD8_CSR { | ||
1895 | register: VolatileCell<u16>, | ||
1896 | } | ||
1897 | #[doc = "TCD Control and Status"] | ||
1898 | pub mod tcd8_csr; | ||
1899 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1900 | pub struct TCD8_BITER_ELINKNO { | ||
1901 | register: VolatileCell<u16>, | ||
1902 | } | ||
1903 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1904 | pub mod tcd8_biter_elinkno; | ||
1905 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1906 | pub struct TCD8_BITER_ELINKYES { | ||
1907 | register: VolatileCell<u16>, | ||
1908 | } | ||
1909 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1910 | pub mod tcd8_biter_elinkyes; | ||
1911 | #[doc = "TCD Source Address"] | ||
1912 | pub struct TCD9_SADDR { | ||
1913 | register: VolatileCell<u32>, | ||
1914 | } | ||
1915 | #[doc = "TCD Source Address"] | ||
1916 | pub mod tcd9_saddr; | ||
1917 | #[doc = "TCD Signed Source Address Offset"] | ||
1918 | pub struct TCD9_SOFF { | ||
1919 | register: VolatileCell<u16>, | ||
1920 | } | ||
1921 | #[doc = "TCD Signed Source Address Offset"] | ||
1922 | pub mod tcd9_soff; | ||
1923 | #[doc = "TCD Transfer Attributes"] | ||
1924 | pub struct TCD9_ATTR { | ||
1925 | register: VolatileCell<u16>, | ||
1926 | } | ||
1927 | #[doc = "TCD Transfer Attributes"] | ||
1928 | pub mod tcd9_attr; | ||
1929 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1930 | pub struct TCD9_NBYTES_MLNO { | ||
1931 | register: VolatileCell<u32>, | ||
1932 | } | ||
1933 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
1934 | pub mod tcd9_nbytes_mlno; | ||
1935 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1936 | pub struct TCD9_NBYTES_MLOFFNO { | ||
1937 | register: VolatileCell<u32>, | ||
1938 | } | ||
1939 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
1940 | pub mod tcd9_nbytes_mloffno; | ||
1941 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1942 | pub struct TCD9_NBYTES_MLOFFYES { | ||
1943 | register: VolatileCell<u32>, | ||
1944 | } | ||
1945 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
1946 | pub mod tcd9_nbytes_mloffyes; | ||
1947 | #[doc = "TCD Last Source Address Adjustment"] | ||
1948 | pub struct TCD9_SLAST { | ||
1949 | register: VolatileCell<u32>, | ||
1950 | } | ||
1951 | #[doc = "TCD Last Source Address Adjustment"] | ||
1952 | pub mod tcd9_slast; | ||
1953 | #[doc = "TCD Destination Address"] | ||
1954 | pub struct TCD9_DADDR { | ||
1955 | register: VolatileCell<u32>, | ||
1956 | } | ||
1957 | #[doc = "TCD Destination Address"] | ||
1958 | pub mod tcd9_daddr; | ||
1959 | #[doc = "TCD Signed Destination Address Offset"] | ||
1960 | pub struct TCD9_DOFF { | ||
1961 | register: VolatileCell<u16>, | ||
1962 | } | ||
1963 | #[doc = "TCD Signed Destination Address Offset"] | ||
1964 | pub mod tcd9_doff; | ||
1965 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1966 | pub struct TCD9_CITER_ELINKNO { | ||
1967 | register: VolatileCell<u16>, | ||
1968 | } | ||
1969 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1970 | pub mod tcd9_citer_elinkno; | ||
1971 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1972 | pub struct TCD9_CITER_ELINKYES { | ||
1973 | register: VolatileCell<u16>, | ||
1974 | } | ||
1975 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1976 | pub mod tcd9_citer_elinkyes; | ||
1977 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1978 | pub struct TCD9_DLASTSGA { | ||
1979 | register: VolatileCell<u32>, | ||
1980 | } | ||
1981 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
1982 | pub mod tcd9_dlastsga; | ||
1983 | #[doc = "TCD Control and Status"] | ||
1984 | pub struct TCD9_CSR { | ||
1985 | register: VolatileCell<u16>, | ||
1986 | } | ||
1987 | #[doc = "TCD Control and Status"] | ||
1988 | pub mod tcd9_csr; | ||
1989 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1990 | pub struct TCD9_BITER_ELINKNO { | ||
1991 | register: VolatileCell<u16>, | ||
1992 | } | ||
1993 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
1994 | pub mod tcd9_biter_elinkno; | ||
1995 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
1996 | pub struct TCD9_BITER_ELINKYES { | ||
1997 | register: VolatileCell<u16>, | ||
1998 | } | ||
1999 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2000 | pub mod tcd9_biter_elinkyes; | ||
2001 | #[doc = "TCD Source Address"] | ||
2002 | pub struct TCD10_SADDR { | ||
2003 | register: VolatileCell<u32>, | ||
2004 | } | ||
2005 | #[doc = "TCD Source Address"] | ||
2006 | pub mod tcd10_saddr; | ||
2007 | #[doc = "TCD Signed Source Address Offset"] | ||
2008 | pub struct TCD10_SOFF { | ||
2009 | register: VolatileCell<u16>, | ||
2010 | } | ||
2011 | #[doc = "TCD Signed Source Address Offset"] | ||
2012 | pub mod tcd10_soff; | ||
2013 | #[doc = "TCD Transfer Attributes"] | ||
2014 | pub struct TCD10_ATTR { | ||
2015 | register: VolatileCell<u16>, | ||
2016 | } | ||
2017 | #[doc = "TCD Transfer Attributes"] | ||
2018 | pub mod tcd10_attr; | ||
2019 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2020 | pub struct TCD10_NBYTES_MLNO { | ||
2021 | register: VolatileCell<u32>, | ||
2022 | } | ||
2023 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2024 | pub mod tcd10_nbytes_mlno; | ||
2025 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2026 | pub struct TCD10_NBYTES_MLOFFNO { | ||
2027 | register: VolatileCell<u32>, | ||
2028 | } | ||
2029 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2030 | pub mod tcd10_nbytes_mloffno; | ||
2031 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2032 | pub struct TCD10_NBYTES_MLOFFYES { | ||
2033 | register: VolatileCell<u32>, | ||
2034 | } | ||
2035 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2036 | pub mod tcd10_nbytes_mloffyes; | ||
2037 | #[doc = "TCD Last Source Address Adjustment"] | ||
2038 | pub struct TCD10_SLAST { | ||
2039 | register: VolatileCell<u32>, | ||
2040 | } | ||
2041 | #[doc = "TCD Last Source Address Adjustment"] | ||
2042 | pub mod tcd10_slast; | ||
2043 | #[doc = "TCD Destination Address"] | ||
2044 | pub struct TCD10_DADDR { | ||
2045 | register: VolatileCell<u32>, | ||
2046 | } | ||
2047 | #[doc = "TCD Destination Address"] | ||
2048 | pub mod tcd10_daddr; | ||
2049 | #[doc = "TCD Signed Destination Address Offset"] | ||
2050 | pub struct TCD10_DOFF { | ||
2051 | register: VolatileCell<u16>, | ||
2052 | } | ||
2053 | #[doc = "TCD Signed Destination Address Offset"] | ||
2054 | pub mod tcd10_doff; | ||
2055 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2056 | pub struct TCD10_CITER_ELINKNO { | ||
2057 | register: VolatileCell<u16>, | ||
2058 | } | ||
2059 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2060 | pub mod tcd10_citer_elinkno; | ||
2061 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2062 | pub struct TCD10_CITER_ELINKYES { | ||
2063 | register: VolatileCell<u16>, | ||
2064 | } | ||
2065 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2066 | pub mod tcd10_citer_elinkyes; | ||
2067 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2068 | pub struct TCD10_DLASTSGA { | ||
2069 | register: VolatileCell<u32>, | ||
2070 | } | ||
2071 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2072 | pub mod tcd10_dlastsga; | ||
2073 | #[doc = "TCD Control and Status"] | ||
2074 | pub struct TCD10_CSR { | ||
2075 | register: VolatileCell<u16>, | ||
2076 | } | ||
2077 | #[doc = "TCD Control and Status"] | ||
2078 | pub mod tcd10_csr; | ||
2079 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2080 | pub struct TCD10_BITER_ELINKNO { | ||
2081 | register: VolatileCell<u16>, | ||
2082 | } | ||
2083 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2084 | pub mod tcd10_biter_elinkno; | ||
2085 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2086 | pub struct TCD10_BITER_ELINKYES { | ||
2087 | register: VolatileCell<u16>, | ||
2088 | } | ||
2089 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2090 | pub mod tcd10_biter_elinkyes; | ||
2091 | #[doc = "TCD Source Address"] | ||
2092 | pub struct TCD11_SADDR { | ||
2093 | register: VolatileCell<u32>, | ||
2094 | } | ||
2095 | #[doc = "TCD Source Address"] | ||
2096 | pub mod tcd11_saddr; | ||
2097 | #[doc = "TCD Signed Source Address Offset"] | ||
2098 | pub struct TCD11_SOFF { | ||
2099 | register: VolatileCell<u16>, | ||
2100 | } | ||
2101 | #[doc = "TCD Signed Source Address Offset"] | ||
2102 | pub mod tcd11_soff; | ||
2103 | #[doc = "TCD Transfer Attributes"] | ||
2104 | pub struct TCD11_ATTR { | ||
2105 | register: VolatileCell<u16>, | ||
2106 | } | ||
2107 | #[doc = "TCD Transfer Attributes"] | ||
2108 | pub mod tcd11_attr; | ||
2109 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2110 | pub struct TCD11_NBYTES_MLNO { | ||
2111 | register: VolatileCell<u32>, | ||
2112 | } | ||
2113 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2114 | pub mod tcd11_nbytes_mlno; | ||
2115 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2116 | pub struct TCD11_NBYTES_MLOFFNO { | ||
2117 | register: VolatileCell<u32>, | ||
2118 | } | ||
2119 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2120 | pub mod tcd11_nbytes_mloffno; | ||
2121 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2122 | pub struct TCD11_NBYTES_MLOFFYES { | ||
2123 | register: VolatileCell<u32>, | ||
2124 | } | ||
2125 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2126 | pub mod tcd11_nbytes_mloffyes; | ||
2127 | #[doc = "TCD Last Source Address Adjustment"] | ||
2128 | pub struct TCD11_SLAST { | ||
2129 | register: VolatileCell<u32>, | ||
2130 | } | ||
2131 | #[doc = "TCD Last Source Address Adjustment"] | ||
2132 | pub mod tcd11_slast; | ||
2133 | #[doc = "TCD Destination Address"] | ||
2134 | pub struct TCD11_DADDR { | ||
2135 | register: VolatileCell<u32>, | ||
2136 | } | ||
2137 | #[doc = "TCD Destination Address"] | ||
2138 | pub mod tcd11_daddr; | ||
2139 | #[doc = "TCD Signed Destination Address Offset"] | ||
2140 | pub struct TCD11_DOFF { | ||
2141 | register: VolatileCell<u16>, | ||
2142 | } | ||
2143 | #[doc = "TCD Signed Destination Address Offset"] | ||
2144 | pub mod tcd11_doff; | ||
2145 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2146 | pub struct TCD11_CITER_ELINKNO { | ||
2147 | register: VolatileCell<u16>, | ||
2148 | } | ||
2149 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2150 | pub mod tcd11_citer_elinkno; | ||
2151 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2152 | pub struct TCD11_CITER_ELINKYES { | ||
2153 | register: VolatileCell<u16>, | ||
2154 | } | ||
2155 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2156 | pub mod tcd11_citer_elinkyes; | ||
2157 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2158 | pub struct TCD11_DLASTSGA { | ||
2159 | register: VolatileCell<u32>, | ||
2160 | } | ||
2161 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2162 | pub mod tcd11_dlastsga; | ||
2163 | #[doc = "TCD Control and Status"] | ||
2164 | pub struct TCD11_CSR { | ||
2165 | register: VolatileCell<u16>, | ||
2166 | } | ||
2167 | #[doc = "TCD Control and Status"] | ||
2168 | pub mod tcd11_csr; | ||
2169 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2170 | pub struct TCD11_BITER_ELINKNO { | ||
2171 | register: VolatileCell<u16>, | ||
2172 | } | ||
2173 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2174 | pub mod tcd11_biter_elinkno; | ||
2175 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2176 | pub struct TCD11_BITER_ELINKYES { | ||
2177 | register: VolatileCell<u16>, | ||
2178 | } | ||
2179 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2180 | pub mod tcd11_biter_elinkyes; | ||
2181 | #[doc = "TCD Source Address"] | ||
2182 | pub struct TCD12_SADDR { | ||
2183 | register: VolatileCell<u32>, | ||
2184 | } | ||
2185 | #[doc = "TCD Source Address"] | ||
2186 | pub mod tcd12_saddr; | ||
2187 | #[doc = "TCD Signed Source Address Offset"] | ||
2188 | pub struct TCD12_SOFF { | ||
2189 | register: VolatileCell<u16>, | ||
2190 | } | ||
2191 | #[doc = "TCD Signed Source Address Offset"] | ||
2192 | pub mod tcd12_soff; | ||
2193 | #[doc = "TCD Transfer Attributes"] | ||
2194 | pub struct TCD12_ATTR { | ||
2195 | register: VolatileCell<u16>, | ||
2196 | } | ||
2197 | #[doc = "TCD Transfer Attributes"] | ||
2198 | pub mod tcd12_attr; | ||
2199 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2200 | pub struct TCD12_NBYTES_MLNO { | ||
2201 | register: VolatileCell<u32>, | ||
2202 | } | ||
2203 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2204 | pub mod tcd12_nbytes_mlno; | ||
2205 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2206 | pub struct TCD12_NBYTES_MLOFFNO { | ||
2207 | register: VolatileCell<u32>, | ||
2208 | } | ||
2209 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2210 | pub mod tcd12_nbytes_mloffno; | ||
2211 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2212 | pub struct TCD12_NBYTES_MLOFFYES { | ||
2213 | register: VolatileCell<u32>, | ||
2214 | } | ||
2215 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2216 | pub mod tcd12_nbytes_mloffyes; | ||
2217 | #[doc = "TCD Last Source Address Adjustment"] | ||
2218 | pub struct TCD12_SLAST { | ||
2219 | register: VolatileCell<u32>, | ||
2220 | } | ||
2221 | #[doc = "TCD Last Source Address Adjustment"] | ||
2222 | pub mod tcd12_slast; | ||
2223 | #[doc = "TCD Destination Address"] | ||
2224 | pub struct TCD12_DADDR { | ||
2225 | register: VolatileCell<u32>, | ||
2226 | } | ||
2227 | #[doc = "TCD Destination Address"] | ||
2228 | pub mod tcd12_daddr; | ||
2229 | #[doc = "TCD Signed Destination Address Offset"] | ||
2230 | pub struct TCD12_DOFF { | ||
2231 | register: VolatileCell<u16>, | ||
2232 | } | ||
2233 | #[doc = "TCD Signed Destination Address Offset"] | ||
2234 | pub mod tcd12_doff; | ||
2235 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2236 | pub struct TCD12_CITER_ELINKNO { | ||
2237 | register: VolatileCell<u16>, | ||
2238 | } | ||
2239 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2240 | pub mod tcd12_citer_elinkno; | ||
2241 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2242 | pub struct TCD12_CITER_ELINKYES { | ||
2243 | register: VolatileCell<u16>, | ||
2244 | } | ||
2245 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2246 | pub mod tcd12_citer_elinkyes; | ||
2247 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2248 | pub struct TCD12_DLASTSGA { | ||
2249 | register: VolatileCell<u32>, | ||
2250 | } | ||
2251 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2252 | pub mod tcd12_dlastsga; | ||
2253 | #[doc = "TCD Control and Status"] | ||
2254 | pub struct TCD12_CSR { | ||
2255 | register: VolatileCell<u16>, | ||
2256 | } | ||
2257 | #[doc = "TCD Control and Status"] | ||
2258 | pub mod tcd12_csr; | ||
2259 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2260 | pub struct TCD12_BITER_ELINKNO { | ||
2261 | register: VolatileCell<u16>, | ||
2262 | } | ||
2263 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2264 | pub mod tcd12_biter_elinkno; | ||
2265 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2266 | pub struct TCD12_BITER_ELINKYES { | ||
2267 | register: VolatileCell<u16>, | ||
2268 | } | ||
2269 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2270 | pub mod tcd12_biter_elinkyes; | ||
2271 | #[doc = "TCD Source Address"] | ||
2272 | pub struct TCD13_SADDR { | ||
2273 | register: VolatileCell<u32>, | ||
2274 | } | ||
2275 | #[doc = "TCD Source Address"] | ||
2276 | pub mod tcd13_saddr; | ||
2277 | #[doc = "TCD Signed Source Address Offset"] | ||
2278 | pub struct TCD13_SOFF { | ||
2279 | register: VolatileCell<u16>, | ||
2280 | } | ||
2281 | #[doc = "TCD Signed Source Address Offset"] | ||
2282 | pub mod tcd13_soff; | ||
2283 | #[doc = "TCD Transfer Attributes"] | ||
2284 | pub struct TCD13_ATTR { | ||
2285 | register: VolatileCell<u16>, | ||
2286 | } | ||
2287 | #[doc = "TCD Transfer Attributes"] | ||
2288 | pub mod tcd13_attr; | ||
2289 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2290 | pub struct TCD13_NBYTES_MLNO { | ||
2291 | register: VolatileCell<u32>, | ||
2292 | } | ||
2293 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2294 | pub mod tcd13_nbytes_mlno; | ||
2295 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2296 | pub struct TCD13_NBYTES_MLOFFNO { | ||
2297 | register: VolatileCell<u32>, | ||
2298 | } | ||
2299 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2300 | pub mod tcd13_nbytes_mloffno; | ||
2301 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2302 | pub struct TCD13_NBYTES_MLOFFYES { | ||
2303 | register: VolatileCell<u32>, | ||
2304 | } | ||
2305 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2306 | pub mod tcd13_nbytes_mloffyes; | ||
2307 | #[doc = "TCD Last Source Address Adjustment"] | ||
2308 | pub struct TCD13_SLAST { | ||
2309 | register: VolatileCell<u32>, | ||
2310 | } | ||
2311 | #[doc = "TCD Last Source Address Adjustment"] | ||
2312 | pub mod tcd13_slast; | ||
2313 | #[doc = "TCD Destination Address"] | ||
2314 | pub struct TCD13_DADDR { | ||
2315 | register: VolatileCell<u32>, | ||
2316 | } | ||
2317 | #[doc = "TCD Destination Address"] | ||
2318 | pub mod tcd13_daddr; | ||
2319 | #[doc = "TCD Signed Destination Address Offset"] | ||
2320 | pub struct TCD13_DOFF { | ||
2321 | register: VolatileCell<u16>, | ||
2322 | } | ||
2323 | #[doc = "TCD Signed Destination Address Offset"] | ||
2324 | pub mod tcd13_doff; | ||
2325 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2326 | pub struct TCD13_CITER_ELINKNO { | ||
2327 | register: VolatileCell<u16>, | ||
2328 | } | ||
2329 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2330 | pub mod tcd13_citer_elinkno; | ||
2331 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2332 | pub struct TCD13_CITER_ELINKYES { | ||
2333 | register: VolatileCell<u16>, | ||
2334 | } | ||
2335 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2336 | pub mod tcd13_citer_elinkyes; | ||
2337 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2338 | pub struct TCD13_DLASTSGA { | ||
2339 | register: VolatileCell<u32>, | ||
2340 | } | ||
2341 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2342 | pub mod tcd13_dlastsga; | ||
2343 | #[doc = "TCD Control and Status"] | ||
2344 | pub struct TCD13_CSR { | ||
2345 | register: VolatileCell<u16>, | ||
2346 | } | ||
2347 | #[doc = "TCD Control and Status"] | ||
2348 | pub mod tcd13_csr; | ||
2349 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2350 | pub struct TCD13_BITER_ELINKNO { | ||
2351 | register: VolatileCell<u16>, | ||
2352 | } | ||
2353 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2354 | pub mod tcd13_biter_elinkno; | ||
2355 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2356 | pub struct TCD13_BITER_ELINKYES { | ||
2357 | register: VolatileCell<u16>, | ||
2358 | } | ||
2359 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2360 | pub mod tcd13_biter_elinkyes; | ||
2361 | #[doc = "TCD Source Address"] | ||
2362 | pub struct TCD14_SADDR { | ||
2363 | register: VolatileCell<u32>, | ||
2364 | } | ||
2365 | #[doc = "TCD Source Address"] | ||
2366 | pub mod tcd14_saddr; | ||
2367 | #[doc = "TCD Signed Source Address Offset"] | ||
2368 | pub struct TCD14_SOFF { | ||
2369 | register: VolatileCell<u16>, | ||
2370 | } | ||
2371 | #[doc = "TCD Signed Source Address Offset"] | ||
2372 | pub mod tcd14_soff; | ||
2373 | #[doc = "TCD Transfer Attributes"] | ||
2374 | pub struct TCD14_ATTR { | ||
2375 | register: VolatileCell<u16>, | ||
2376 | } | ||
2377 | #[doc = "TCD Transfer Attributes"] | ||
2378 | pub mod tcd14_attr; | ||
2379 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2380 | pub struct TCD14_NBYTES_MLNO { | ||
2381 | register: VolatileCell<u32>, | ||
2382 | } | ||
2383 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2384 | pub mod tcd14_nbytes_mlno; | ||
2385 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2386 | pub struct TCD14_NBYTES_MLOFFNO { | ||
2387 | register: VolatileCell<u32>, | ||
2388 | } | ||
2389 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2390 | pub mod tcd14_nbytes_mloffno; | ||
2391 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2392 | pub struct TCD14_NBYTES_MLOFFYES { | ||
2393 | register: VolatileCell<u32>, | ||
2394 | } | ||
2395 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2396 | pub mod tcd14_nbytes_mloffyes; | ||
2397 | #[doc = "TCD Last Source Address Adjustment"] | ||
2398 | pub struct TCD14_SLAST { | ||
2399 | register: VolatileCell<u32>, | ||
2400 | } | ||
2401 | #[doc = "TCD Last Source Address Adjustment"] | ||
2402 | pub mod tcd14_slast; | ||
2403 | #[doc = "TCD Destination Address"] | ||
2404 | pub struct TCD14_DADDR { | ||
2405 | register: VolatileCell<u32>, | ||
2406 | } | ||
2407 | #[doc = "TCD Destination Address"] | ||
2408 | pub mod tcd14_daddr; | ||
2409 | #[doc = "TCD Signed Destination Address Offset"] | ||
2410 | pub struct TCD14_DOFF { | ||
2411 | register: VolatileCell<u16>, | ||
2412 | } | ||
2413 | #[doc = "TCD Signed Destination Address Offset"] | ||
2414 | pub mod tcd14_doff; | ||
2415 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2416 | pub struct TCD14_CITER_ELINKNO { | ||
2417 | register: VolatileCell<u16>, | ||
2418 | } | ||
2419 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2420 | pub mod tcd14_citer_elinkno; | ||
2421 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2422 | pub struct TCD14_CITER_ELINKYES { | ||
2423 | register: VolatileCell<u16>, | ||
2424 | } | ||
2425 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2426 | pub mod tcd14_citer_elinkyes; | ||
2427 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2428 | pub struct TCD14_DLASTSGA { | ||
2429 | register: VolatileCell<u32>, | ||
2430 | } | ||
2431 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2432 | pub mod tcd14_dlastsga; | ||
2433 | #[doc = "TCD Control and Status"] | ||
2434 | pub struct TCD14_CSR { | ||
2435 | register: VolatileCell<u16>, | ||
2436 | } | ||
2437 | #[doc = "TCD Control and Status"] | ||
2438 | pub mod tcd14_csr; | ||
2439 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2440 | pub struct TCD14_BITER_ELINKNO { | ||
2441 | register: VolatileCell<u16>, | ||
2442 | } | ||
2443 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2444 | pub mod tcd14_biter_elinkno; | ||
2445 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2446 | pub struct TCD14_BITER_ELINKYES { | ||
2447 | register: VolatileCell<u16>, | ||
2448 | } | ||
2449 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2450 | pub mod tcd14_biter_elinkyes; | ||
2451 | #[doc = "TCD Source Address"] | ||
2452 | pub struct TCD15_SADDR { | ||
2453 | register: VolatileCell<u32>, | ||
2454 | } | ||
2455 | #[doc = "TCD Source Address"] | ||
2456 | pub mod tcd15_saddr; | ||
2457 | #[doc = "TCD Signed Source Address Offset"] | ||
2458 | pub struct TCD15_SOFF { | ||
2459 | register: VolatileCell<u16>, | ||
2460 | } | ||
2461 | #[doc = "TCD Signed Source Address Offset"] | ||
2462 | pub mod tcd15_soff; | ||
2463 | #[doc = "TCD Transfer Attributes"] | ||
2464 | pub struct TCD15_ATTR { | ||
2465 | register: VolatileCell<u16>, | ||
2466 | } | ||
2467 | #[doc = "TCD Transfer Attributes"] | ||
2468 | pub mod tcd15_attr; | ||
2469 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2470 | pub struct TCD15_NBYTES_MLNO { | ||
2471 | register: VolatileCell<u32>, | ||
2472 | } | ||
2473 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2474 | pub mod tcd15_nbytes_mlno; | ||
2475 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2476 | pub struct TCD15_NBYTES_MLOFFNO { | ||
2477 | register: VolatileCell<u32>, | ||
2478 | } | ||
2479 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2480 | pub mod tcd15_nbytes_mloffno; | ||
2481 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2482 | pub struct TCD15_NBYTES_MLOFFYES { | ||
2483 | register: VolatileCell<u32>, | ||
2484 | } | ||
2485 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2486 | pub mod tcd15_nbytes_mloffyes; | ||
2487 | #[doc = "TCD Last Source Address Adjustment"] | ||
2488 | pub struct TCD15_SLAST { | ||
2489 | register: VolatileCell<u32>, | ||
2490 | } | ||
2491 | #[doc = "TCD Last Source Address Adjustment"] | ||
2492 | pub mod tcd15_slast; | ||
2493 | #[doc = "TCD Destination Address"] | ||
2494 | pub struct TCD15_DADDR { | ||
2495 | register: VolatileCell<u32>, | ||
2496 | } | ||
2497 | #[doc = "TCD Destination Address"] | ||
2498 | pub mod tcd15_daddr; | ||
2499 | #[doc = "TCD Signed Destination Address Offset"] | ||
2500 | pub struct TCD15_DOFF { | ||
2501 | register: VolatileCell<u16>, | ||
2502 | } | ||
2503 | #[doc = "TCD Signed Destination Address Offset"] | ||
2504 | pub mod tcd15_doff; | ||
2505 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2506 | pub struct TCD15_CITER_ELINKNO { | ||
2507 | register: VolatileCell<u16>, | ||
2508 | } | ||
2509 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2510 | pub mod tcd15_citer_elinkno; | ||
2511 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2512 | pub struct TCD15_CITER_ELINKYES { | ||
2513 | register: VolatileCell<u16>, | ||
2514 | } | ||
2515 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2516 | pub mod tcd15_citer_elinkyes; | ||
2517 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2518 | pub struct TCD15_DLASTSGA { | ||
2519 | register: VolatileCell<u32>, | ||
2520 | } | ||
2521 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2522 | pub mod tcd15_dlastsga; | ||
2523 | #[doc = "TCD Control and Status"] | ||
2524 | pub struct TCD15_CSR { | ||
2525 | register: VolatileCell<u16>, | ||
2526 | } | ||
2527 | #[doc = "TCD Control and Status"] | ||
2528 | pub mod tcd15_csr; | ||
2529 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2530 | pub struct TCD15_BITER_ELINKNO { | ||
2531 | register: VolatileCell<u16>, | ||
2532 | } | ||
2533 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2534 | pub mod tcd15_biter_elinkno; | ||
2535 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2536 | pub struct TCD15_BITER_ELINKYES { | ||
2537 | register: VolatileCell<u16>, | ||
2538 | } | ||
2539 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2540 | pub mod tcd15_biter_elinkyes; | ||
2541 | #[doc = "TCD Source Address"] | ||
2542 | pub struct TCD16_SADDR { | ||
2543 | register: VolatileCell<u32>, | ||
2544 | } | ||
2545 | #[doc = "TCD Source Address"] | ||
2546 | pub mod tcd16_saddr; | ||
2547 | #[doc = "TCD Signed Source Address Offset"] | ||
2548 | pub struct TCD16_SOFF { | ||
2549 | register: VolatileCell<u16>, | ||
2550 | } | ||
2551 | #[doc = "TCD Signed Source Address Offset"] | ||
2552 | pub mod tcd16_soff; | ||
2553 | #[doc = "TCD Transfer Attributes"] | ||
2554 | pub struct TCD16_ATTR { | ||
2555 | register: VolatileCell<u16>, | ||
2556 | } | ||
2557 | #[doc = "TCD Transfer Attributes"] | ||
2558 | pub mod tcd16_attr; | ||
2559 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2560 | pub struct TCD16_NBYTES_MLNO { | ||
2561 | register: VolatileCell<u32>, | ||
2562 | } | ||
2563 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2564 | pub mod tcd16_nbytes_mlno; | ||
2565 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2566 | pub struct TCD16_NBYTES_MLOFFNO { | ||
2567 | register: VolatileCell<u32>, | ||
2568 | } | ||
2569 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2570 | pub mod tcd16_nbytes_mloffno; | ||
2571 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2572 | pub struct TCD16_NBYTES_MLOFFYES { | ||
2573 | register: VolatileCell<u32>, | ||
2574 | } | ||
2575 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2576 | pub mod tcd16_nbytes_mloffyes; | ||
2577 | #[doc = "TCD Last Source Address Adjustment"] | ||
2578 | pub struct TCD16_SLAST { | ||
2579 | register: VolatileCell<u32>, | ||
2580 | } | ||
2581 | #[doc = "TCD Last Source Address Adjustment"] | ||
2582 | pub mod tcd16_slast; | ||
2583 | #[doc = "TCD Destination Address"] | ||
2584 | pub struct TCD16_DADDR { | ||
2585 | register: VolatileCell<u32>, | ||
2586 | } | ||
2587 | #[doc = "TCD Destination Address"] | ||
2588 | pub mod tcd16_daddr; | ||
2589 | #[doc = "TCD Signed Destination Address Offset"] | ||
2590 | pub struct TCD16_DOFF { | ||
2591 | register: VolatileCell<u16>, | ||
2592 | } | ||
2593 | #[doc = "TCD Signed Destination Address Offset"] | ||
2594 | pub mod tcd16_doff; | ||
2595 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2596 | pub struct TCD16_CITER_ELINKNO { | ||
2597 | register: VolatileCell<u16>, | ||
2598 | } | ||
2599 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2600 | pub mod tcd16_citer_elinkno; | ||
2601 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2602 | pub struct TCD16_CITER_ELINKYES { | ||
2603 | register: VolatileCell<u16>, | ||
2604 | } | ||
2605 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2606 | pub mod tcd16_citer_elinkyes; | ||
2607 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2608 | pub struct TCD16_DLASTSGA { | ||
2609 | register: VolatileCell<u32>, | ||
2610 | } | ||
2611 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2612 | pub mod tcd16_dlastsga; | ||
2613 | #[doc = "TCD Control and Status"] | ||
2614 | pub struct TCD16_CSR { | ||
2615 | register: VolatileCell<u16>, | ||
2616 | } | ||
2617 | #[doc = "TCD Control and Status"] | ||
2618 | pub mod tcd16_csr; | ||
2619 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2620 | pub struct TCD16_BITER_ELINKNO { | ||
2621 | register: VolatileCell<u16>, | ||
2622 | } | ||
2623 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2624 | pub mod tcd16_biter_elinkno; | ||
2625 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2626 | pub struct TCD16_BITER_ELINKYES { | ||
2627 | register: VolatileCell<u16>, | ||
2628 | } | ||
2629 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2630 | pub mod tcd16_biter_elinkyes; | ||
2631 | #[doc = "TCD Source Address"] | ||
2632 | pub struct TCD17_SADDR { | ||
2633 | register: VolatileCell<u32>, | ||
2634 | } | ||
2635 | #[doc = "TCD Source Address"] | ||
2636 | pub mod tcd17_saddr; | ||
2637 | #[doc = "TCD Signed Source Address Offset"] | ||
2638 | pub struct TCD17_SOFF { | ||
2639 | register: VolatileCell<u16>, | ||
2640 | } | ||
2641 | #[doc = "TCD Signed Source Address Offset"] | ||
2642 | pub mod tcd17_soff; | ||
2643 | #[doc = "TCD Transfer Attributes"] | ||
2644 | pub struct TCD17_ATTR { | ||
2645 | register: VolatileCell<u16>, | ||
2646 | } | ||
2647 | #[doc = "TCD Transfer Attributes"] | ||
2648 | pub mod tcd17_attr; | ||
2649 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2650 | pub struct TCD17_NBYTES_MLNO { | ||
2651 | register: VolatileCell<u32>, | ||
2652 | } | ||
2653 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2654 | pub mod tcd17_nbytes_mlno; | ||
2655 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2656 | pub struct TCD17_NBYTES_MLOFFNO { | ||
2657 | register: VolatileCell<u32>, | ||
2658 | } | ||
2659 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2660 | pub mod tcd17_nbytes_mloffno; | ||
2661 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2662 | pub struct TCD17_NBYTES_MLOFFYES { | ||
2663 | register: VolatileCell<u32>, | ||
2664 | } | ||
2665 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2666 | pub mod tcd17_nbytes_mloffyes; | ||
2667 | #[doc = "TCD Last Source Address Adjustment"] | ||
2668 | pub struct TCD17_SLAST { | ||
2669 | register: VolatileCell<u32>, | ||
2670 | } | ||
2671 | #[doc = "TCD Last Source Address Adjustment"] | ||
2672 | pub mod tcd17_slast; | ||
2673 | #[doc = "TCD Destination Address"] | ||
2674 | pub struct TCD17_DADDR { | ||
2675 | register: VolatileCell<u32>, | ||
2676 | } | ||
2677 | #[doc = "TCD Destination Address"] | ||
2678 | pub mod tcd17_daddr; | ||
2679 | #[doc = "TCD Signed Destination Address Offset"] | ||
2680 | pub struct TCD17_DOFF { | ||
2681 | register: VolatileCell<u16>, | ||
2682 | } | ||
2683 | #[doc = "TCD Signed Destination Address Offset"] | ||
2684 | pub mod tcd17_doff; | ||
2685 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2686 | pub struct TCD17_CITER_ELINKNO { | ||
2687 | register: VolatileCell<u16>, | ||
2688 | } | ||
2689 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2690 | pub mod tcd17_citer_elinkno; | ||
2691 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2692 | pub struct TCD17_CITER_ELINKYES { | ||
2693 | register: VolatileCell<u16>, | ||
2694 | } | ||
2695 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2696 | pub mod tcd17_citer_elinkyes; | ||
2697 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2698 | pub struct TCD17_DLASTSGA { | ||
2699 | register: VolatileCell<u32>, | ||
2700 | } | ||
2701 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2702 | pub mod tcd17_dlastsga; | ||
2703 | #[doc = "TCD Control and Status"] | ||
2704 | pub struct TCD17_CSR { | ||
2705 | register: VolatileCell<u16>, | ||
2706 | } | ||
2707 | #[doc = "TCD Control and Status"] | ||
2708 | pub mod tcd17_csr; | ||
2709 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2710 | pub struct TCD17_BITER_ELINKNO { | ||
2711 | register: VolatileCell<u16>, | ||
2712 | } | ||
2713 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2714 | pub mod tcd17_biter_elinkno; | ||
2715 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2716 | pub struct TCD17_BITER_ELINKYES { | ||
2717 | register: VolatileCell<u16>, | ||
2718 | } | ||
2719 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2720 | pub mod tcd17_biter_elinkyes; | ||
2721 | #[doc = "TCD Source Address"] | ||
2722 | pub struct TCD18_SADDR { | ||
2723 | register: VolatileCell<u32>, | ||
2724 | } | ||
2725 | #[doc = "TCD Source Address"] | ||
2726 | pub mod tcd18_saddr; | ||
2727 | #[doc = "TCD Signed Source Address Offset"] | ||
2728 | pub struct TCD18_SOFF { | ||
2729 | register: VolatileCell<u16>, | ||
2730 | } | ||
2731 | #[doc = "TCD Signed Source Address Offset"] | ||
2732 | pub mod tcd18_soff; | ||
2733 | #[doc = "TCD Transfer Attributes"] | ||
2734 | pub struct TCD18_ATTR { | ||
2735 | register: VolatileCell<u16>, | ||
2736 | } | ||
2737 | #[doc = "TCD Transfer Attributes"] | ||
2738 | pub mod tcd18_attr; | ||
2739 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2740 | pub struct TCD18_NBYTES_MLNO { | ||
2741 | register: VolatileCell<u32>, | ||
2742 | } | ||
2743 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2744 | pub mod tcd18_nbytes_mlno; | ||
2745 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2746 | pub struct TCD18_NBYTES_MLOFFNO { | ||
2747 | register: VolatileCell<u32>, | ||
2748 | } | ||
2749 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2750 | pub mod tcd18_nbytes_mloffno; | ||
2751 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2752 | pub struct TCD18_NBYTES_MLOFFYES { | ||
2753 | register: VolatileCell<u32>, | ||
2754 | } | ||
2755 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2756 | pub mod tcd18_nbytes_mloffyes; | ||
2757 | #[doc = "TCD Last Source Address Adjustment"] | ||
2758 | pub struct TCD18_SLAST { | ||
2759 | register: VolatileCell<u32>, | ||
2760 | } | ||
2761 | #[doc = "TCD Last Source Address Adjustment"] | ||
2762 | pub mod tcd18_slast; | ||
2763 | #[doc = "TCD Destination Address"] | ||
2764 | pub struct TCD18_DADDR { | ||
2765 | register: VolatileCell<u32>, | ||
2766 | } | ||
2767 | #[doc = "TCD Destination Address"] | ||
2768 | pub mod tcd18_daddr; | ||
2769 | #[doc = "TCD Signed Destination Address Offset"] | ||
2770 | pub struct TCD18_DOFF { | ||
2771 | register: VolatileCell<u16>, | ||
2772 | } | ||
2773 | #[doc = "TCD Signed Destination Address Offset"] | ||
2774 | pub mod tcd18_doff; | ||
2775 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2776 | pub struct TCD18_CITER_ELINKNO { | ||
2777 | register: VolatileCell<u16>, | ||
2778 | } | ||
2779 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2780 | pub mod tcd18_citer_elinkno; | ||
2781 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2782 | pub struct TCD18_CITER_ELINKYES { | ||
2783 | register: VolatileCell<u16>, | ||
2784 | } | ||
2785 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2786 | pub mod tcd18_citer_elinkyes; | ||
2787 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2788 | pub struct TCD18_DLASTSGA { | ||
2789 | register: VolatileCell<u32>, | ||
2790 | } | ||
2791 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2792 | pub mod tcd18_dlastsga; | ||
2793 | #[doc = "TCD Control and Status"] | ||
2794 | pub struct TCD18_CSR { | ||
2795 | register: VolatileCell<u16>, | ||
2796 | } | ||
2797 | #[doc = "TCD Control and Status"] | ||
2798 | pub mod tcd18_csr; | ||
2799 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2800 | pub struct TCD18_BITER_ELINKNO { | ||
2801 | register: VolatileCell<u16>, | ||
2802 | } | ||
2803 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2804 | pub mod tcd18_biter_elinkno; | ||
2805 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2806 | pub struct TCD18_BITER_ELINKYES { | ||
2807 | register: VolatileCell<u16>, | ||
2808 | } | ||
2809 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2810 | pub mod tcd18_biter_elinkyes; | ||
2811 | #[doc = "TCD Source Address"] | ||
2812 | pub struct TCD19_SADDR { | ||
2813 | register: VolatileCell<u32>, | ||
2814 | } | ||
2815 | #[doc = "TCD Source Address"] | ||
2816 | pub mod tcd19_saddr; | ||
2817 | #[doc = "TCD Signed Source Address Offset"] | ||
2818 | pub struct TCD19_SOFF { | ||
2819 | register: VolatileCell<u16>, | ||
2820 | } | ||
2821 | #[doc = "TCD Signed Source Address Offset"] | ||
2822 | pub mod tcd19_soff; | ||
2823 | #[doc = "TCD Transfer Attributes"] | ||
2824 | pub struct TCD19_ATTR { | ||
2825 | register: VolatileCell<u16>, | ||
2826 | } | ||
2827 | #[doc = "TCD Transfer Attributes"] | ||
2828 | pub mod tcd19_attr; | ||
2829 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2830 | pub struct TCD19_NBYTES_MLNO { | ||
2831 | register: VolatileCell<u32>, | ||
2832 | } | ||
2833 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2834 | pub mod tcd19_nbytes_mlno; | ||
2835 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2836 | pub struct TCD19_NBYTES_MLOFFNO { | ||
2837 | register: VolatileCell<u32>, | ||
2838 | } | ||
2839 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2840 | pub mod tcd19_nbytes_mloffno; | ||
2841 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2842 | pub struct TCD19_NBYTES_MLOFFYES { | ||
2843 | register: VolatileCell<u32>, | ||
2844 | } | ||
2845 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2846 | pub mod tcd19_nbytes_mloffyes; | ||
2847 | #[doc = "TCD Last Source Address Adjustment"] | ||
2848 | pub struct TCD19_SLAST { | ||
2849 | register: VolatileCell<u32>, | ||
2850 | } | ||
2851 | #[doc = "TCD Last Source Address Adjustment"] | ||
2852 | pub mod tcd19_slast; | ||
2853 | #[doc = "TCD Destination Address"] | ||
2854 | pub struct TCD19_DADDR { | ||
2855 | register: VolatileCell<u32>, | ||
2856 | } | ||
2857 | #[doc = "TCD Destination Address"] | ||
2858 | pub mod tcd19_daddr; | ||
2859 | #[doc = "TCD Signed Destination Address Offset"] | ||
2860 | pub struct TCD19_DOFF { | ||
2861 | register: VolatileCell<u16>, | ||
2862 | } | ||
2863 | #[doc = "TCD Signed Destination Address Offset"] | ||
2864 | pub mod tcd19_doff; | ||
2865 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2866 | pub struct TCD19_CITER_ELINKNO { | ||
2867 | register: VolatileCell<u16>, | ||
2868 | } | ||
2869 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2870 | pub mod tcd19_citer_elinkno; | ||
2871 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2872 | pub struct TCD19_CITER_ELINKYES { | ||
2873 | register: VolatileCell<u16>, | ||
2874 | } | ||
2875 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2876 | pub mod tcd19_citer_elinkyes; | ||
2877 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2878 | pub struct TCD19_DLASTSGA { | ||
2879 | register: VolatileCell<u32>, | ||
2880 | } | ||
2881 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2882 | pub mod tcd19_dlastsga; | ||
2883 | #[doc = "TCD Control and Status"] | ||
2884 | pub struct TCD19_CSR { | ||
2885 | register: VolatileCell<u16>, | ||
2886 | } | ||
2887 | #[doc = "TCD Control and Status"] | ||
2888 | pub mod tcd19_csr; | ||
2889 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2890 | pub struct TCD19_BITER_ELINKNO { | ||
2891 | register: VolatileCell<u16>, | ||
2892 | } | ||
2893 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2894 | pub mod tcd19_biter_elinkno; | ||
2895 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2896 | pub struct TCD19_BITER_ELINKYES { | ||
2897 | register: VolatileCell<u16>, | ||
2898 | } | ||
2899 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2900 | pub mod tcd19_biter_elinkyes; | ||
2901 | #[doc = "TCD Source Address"] | ||
2902 | pub struct TCD20_SADDR { | ||
2903 | register: VolatileCell<u32>, | ||
2904 | } | ||
2905 | #[doc = "TCD Source Address"] | ||
2906 | pub mod tcd20_saddr; | ||
2907 | #[doc = "TCD Signed Source Address Offset"] | ||
2908 | pub struct TCD20_SOFF { | ||
2909 | register: VolatileCell<u16>, | ||
2910 | } | ||
2911 | #[doc = "TCD Signed Source Address Offset"] | ||
2912 | pub mod tcd20_soff; | ||
2913 | #[doc = "TCD Transfer Attributes"] | ||
2914 | pub struct TCD20_ATTR { | ||
2915 | register: VolatileCell<u16>, | ||
2916 | } | ||
2917 | #[doc = "TCD Transfer Attributes"] | ||
2918 | pub mod tcd20_attr; | ||
2919 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2920 | pub struct TCD20_NBYTES_MLNO { | ||
2921 | register: VolatileCell<u32>, | ||
2922 | } | ||
2923 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
2924 | pub mod tcd20_nbytes_mlno; | ||
2925 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2926 | pub struct TCD20_NBYTES_MLOFFNO { | ||
2927 | register: VolatileCell<u32>, | ||
2928 | } | ||
2929 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
2930 | pub mod tcd20_nbytes_mloffno; | ||
2931 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2932 | pub struct TCD20_NBYTES_MLOFFYES { | ||
2933 | register: VolatileCell<u32>, | ||
2934 | } | ||
2935 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
2936 | pub mod tcd20_nbytes_mloffyes; | ||
2937 | #[doc = "TCD Last Source Address Adjustment"] | ||
2938 | pub struct TCD20_SLAST { | ||
2939 | register: VolatileCell<u32>, | ||
2940 | } | ||
2941 | #[doc = "TCD Last Source Address Adjustment"] | ||
2942 | pub mod tcd20_slast; | ||
2943 | #[doc = "TCD Destination Address"] | ||
2944 | pub struct TCD20_DADDR { | ||
2945 | register: VolatileCell<u32>, | ||
2946 | } | ||
2947 | #[doc = "TCD Destination Address"] | ||
2948 | pub mod tcd20_daddr; | ||
2949 | #[doc = "TCD Signed Destination Address Offset"] | ||
2950 | pub struct TCD20_DOFF { | ||
2951 | register: VolatileCell<u16>, | ||
2952 | } | ||
2953 | #[doc = "TCD Signed Destination Address Offset"] | ||
2954 | pub mod tcd20_doff; | ||
2955 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2956 | pub struct TCD20_CITER_ELINKNO { | ||
2957 | register: VolatileCell<u16>, | ||
2958 | } | ||
2959 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2960 | pub mod tcd20_citer_elinkno; | ||
2961 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2962 | pub struct TCD20_CITER_ELINKYES { | ||
2963 | register: VolatileCell<u16>, | ||
2964 | } | ||
2965 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2966 | pub mod tcd20_citer_elinkyes; | ||
2967 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2968 | pub struct TCD20_DLASTSGA { | ||
2969 | register: VolatileCell<u32>, | ||
2970 | } | ||
2971 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
2972 | pub mod tcd20_dlastsga; | ||
2973 | #[doc = "TCD Control and Status"] | ||
2974 | pub struct TCD20_CSR { | ||
2975 | register: VolatileCell<u16>, | ||
2976 | } | ||
2977 | #[doc = "TCD Control and Status"] | ||
2978 | pub mod tcd20_csr; | ||
2979 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2980 | pub struct TCD20_BITER_ELINKNO { | ||
2981 | register: VolatileCell<u16>, | ||
2982 | } | ||
2983 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
2984 | pub mod tcd20_biter_elinkno; | ||
2985 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2986 | pub struct TCD20_BITER_ELINKYES { | ||
2987 | register: VolatileCell<u16>, | ||
2988 | } | ||
2989 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
2990 | pub mod tcd20_biter_elinkyes; | ||
2991 | #[doc = "TCD Source Address"] | ||
2992 | pub struct TCD21_SADDR { | ||
2993 | register: VolatileCell<u32>, | ||
2994 | } | ||
2995 | #[doc = "TCD Source Address"] | ||
2996 | pub mod tcd21_saddr; | ||
2997 | #[doc = "TCD Signed Source Address Offset"] | ||
2998 | pub struct TCD21_SOFF { | ||
2999 | register: VolatileCell<u16>, | ||
3000 | } | ||
3001 | #[doc = "TCD Signed Source Address Offset"] | ||
3002 | pub mod tcd21_soff; | ||
3003 | #[doc = "TCD Transfer Attributes"] | ||
3004 | pub struct TCD21_ATTR { | ||
3005 | register: VolatileCell<u16>, | ||
3006 | } | ||
3007 | #[doc = "TCD Transfer Attributes"] | ||
3008 | pub mod tcd21_attr; | ||
3009 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3010 | pub struct TCD21_NBYTES_MLNO { | ||
3011 | register: VolatileCell<u32>, | ||
3012 | } | ||
3013 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3014 | pub mod tcd21_nbytes_mlno; | ||
3015 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3016 | pub struct TCD21_NBYTES_MLOFFNO { | ||
3017 | register: VolatileCell<u32>, | ||
3018 | } | ||
3019 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3020 | pub mod tcd21_nbytes_mloffno; | ||
3021 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3022 | pub struct TCD21_NBYTES_MLOFFYES { | ||
3023 | register: VolatileCell<u32>, | ||
3024 | } | ||
3025 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3026 | pub mod tcd21_nbytes_mloffyes; | ||
3027 | #[doc = "TCD Last Source Address Adjustment"] | ||
3028 | pub struct TCD21_SLAST { | ||
3029 | register: VolatileCell<u32>, | ||
3030 | } | ||
3031 | #[doc = "TCD Last Source Address Adjustment"] | ||
3032 | pub mod tcd21_slast; | ||
3033 | #[doc = "TCD Destination Address"] | ||
3034 | pub struct TCD21_DADDR { | ||
3035 | register: VolatileCell<u32>, | ||
3036 | } | ||
3037 | #[doc = "TCD Destination Address"] | ||
3038 | pub mod tcd21_daddr; | ||
3039 | #[doc = "TCD Signed Destination Address Offset"] | ||
3040 | pub struct TCD21_DOFF { | ||
3041 | register: VolatileCell<u16>, | ||
3042 | } | ||
3043 | #[doc = "TCD Signed Destination Address Offset"] | ||
3044 | pub mod tcd21_doff; | ||
3045 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3046 | pub struct TCD21_CITER_ELINKNO { | ||
3047 | register: VolatileCell<u16>, | ||
3048 | } | ||
3049 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3050 | pub mod tcd21_citer_elinkno; | ||
3051 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3052 | pub struct TCD21_CITER_ELINKYES { | ||
3053 | register: VolatileCell<u16>, | ||
3054 | } | ||
3055 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3056 | pub mod tcd21_citer_elinkyes; | ||
3057 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3058 | pub struct TCD21_DLASTSGA { | ||
3059 | register: VolatileCell<u32>, | ||
3060 | } | ||
3061 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3062 | pub mod tcd21_dlastsga; | ||
3063 | #[doc = "TCD Control and Status"] | ||
3064 | pub struct TCD21_CSR { | ||
3065 | register: VolatileCell<u16>, | ||
3066 | } | ||
3067 | #[doc = "TCD Control and Status"] | ||
3068 | pub mod tcd21_csr; | ||
3069 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3070 | pub struct TCD21_BITER_ELINKNO { | ||
3071 | register: VolatileCell<u16>, | ||
3072 | } | ||
3073 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3074 | pub mod tcd21_biter_elinkno; | ||
3075 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3076 | pub struct TCD21_BITER_ELINKYES { | ||
3077 | register: VolatileCell<u16>, | ||
3078 | } | ||
3079 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3080 | pub mod tcd21_biter_elinkyes; | ||
3081 | #[doc = "TCD Source Address"] | ||
3082 | pub struct TCD22_SADDR { | ||
3083 | register: VolatileCell<u32>, | ||
3084 | } | ||
3085 | #[doc = "TCD Source Address"] | ||
3086 | pub mod tcd22_saddr; | ||
3087 | #[doc = "TCD Signed Source Address Offset"] | ||
3088 | pub struct TCD22_SOFF { | ||
3089 | register: VolatileCell<u16>, | ||
3090 | } | ||
3091 | #[doc = "TCD Signed Source Address Offset"] | ||
3092 | pub mod tcd22_soff; | ||
3093 | #[doc = "TCD Transfer Attributes"] | ||
3094 | pub struct TCD22_ATTR { | ||
3095 | register: VolatileCell<u16>, | ||
3096 | } | ||
3097 | #[doc = "TCD Transfer Attributes"] | ||
3098 | pub mod tcd22_attr; | ||
3099 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3100 | pub struct TCD22_NBYTES_MLNO { | ||
3101 | register: VolatileCell<u32>, | ||
3102 | } | ||
3103 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3104 | pub mod tcd22_nbytes_mlno; | ||
3105 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3106 | pub struct TCD22_NBYTES_MLOFFNO { | ||
3107 | register: VolatileCell<u32>, | ||
3108 | } | ||
3109 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3110 | pub mod tcd22_nbytes_mloffno; | ||
3111 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3112 | pub struct TCD22_NBYTES_MLOFFYES { | ||
3113 | register: VolatileCell<u32>, | ||
3114 | } | ||
3115 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3116 | pub mod tcd22_nbytes_mloffyes; | ||
3117 | #[doc = "TCD Last Source Address Adjustment"] | ||
3118 | pub struct TCD22_SLAST { | ||
3119 | register: VolatileCell<u32>, | ||
3120 | } | ||
3121 | #[doc = "TCD Last Source Address Adjustment"] | ||
3122 | pub mod tcd22_slast; | ||
3123 | #[doc = "TCD Destination Address"] | ||
3124 | pub struct TCD22_DADDR { | ||
3125 | register: VolatileCell<u32>, | ||
3126 | } | ||
3127 | #[doc = "TCD Destination Address"] | ||
3128 | pub mod tcd22_daddr; | ||
3129 | #[doc = "TCD Signed Destination Address Offset"] | ||
3130 | pub struct TCD22_DOFF { | ||
3131 | register: VolatileCell<u16>, | ||
3132 | } | ||
3133 | #[doc = "TCD Signed Destination Address Offset"] | ||
3134 | pub mod tcd22_doff; | ||
3135 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3136 | pub struct TCD22_CITER_ELINKNO { | ||
3137 | register: VolatileCell<u16>, | ||
3138 | } | ||
3139 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3140 | pub mod tcd22_citer_elinkno; | ||
3141 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3142 | pub struct TCD22_CITER_ELINKYES { | ||
3143 | register: VolatileCell<u16>, | ||
3144 | } | ||
3145 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3146 | pub mod tcd22_citer_elinkyes; | ||
3147 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3148 | pub struct TCD22_DLASTSGA { | ||
3149 | register: VolatileCell<u32>, | ||
3150 | } | ||
3151 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3152 | pub mod tcd22_dlastsga; | ||
3153 | #[doc = "TCD Control and Status"] | ||
3154 | pub struct TCD22_CSR { | ||
3155 | register: VolatileCell<u16>, | ||
3156 | } | ||
3157 | #[doc = "TCD Control and Status"] | ||
3158 | pub mod tcd22_csr; | ||
3159 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3160 | pub struct TCD22_BITER_ELINKNO { | ||
3161 | register: VolatileCell<u16>, | ||
3162 | } | ||
3163 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3164 | pub mod tcd22_biter_elinkno; | ||
3165 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3166 | pub struct TCD22_BITER_ELINKYES { | ||
3167 | register: VolatileCell<u16>, | ||
3168 | } | ||
3169 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3170 | pub mod tcd22_biter_elinkyes; | ||
3171 | #[doc = "TCD Source Address"] | ||
3172 | pub struct TCD23_SADDR { | ||
3173 | register: VolatileCell<u32>, | ||
3174 | } | ||
3175 | #[doc = "TCD Source Address"] | ||
3176 | pub mod tcd23_saddr; | ||
3177 | #[doc = "TCD Signed Source Address Offset"] | ||
3178 | pub struct TCD23_SOFF { | ||
3179 | register: VolatileCell<u16>, | ||
3180 | } | ||
3181 | #[doc = "TCD Signed Source Address Offset"] | ||
3182 | pub mod tcd23_soff; | ||
3183 | #[doc = "TCD Transfer Attributes"] | ||
3184 | pub struct TCD23_ATTR { | ||
3185 | register: VolatileCell<u16>, | ||
3186 | } | ||
3187 | #[doc = "TCD Transfer Attributes"] | ||
3188 | pub mod tcd23_attr; | ||
3189 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3190 | pub struct TCD23_NBYTES_MLNO { | ||
3191 | register: VolatileCell<u32>, | ||
3192 | } | ||
3193 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3194 | pub mod tcd23_nbytes_mlno; | ||
3195 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3196 | pub struct TCD23_NBYTES_MLOFFNO { | ||
3197 | register: VolatileCell<u32>, | ||
3198 | } | ||
3199 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3200 | pub mod tcd23_nbytes_mloffno; | ||
3201 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3202 | pub struct TCD23_NBYTES_MLOFFYES { | ||
3203 | register: VolatileCell<u32>, | ||
3204 | } | ||
3205 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3206 | pub mod tcd23_nbytes_mloffyes; | ||
3207 | #[doc = "TCD Last Source Address Adjustment"] | ||
3208 | pub struct TCD23_SLAST { | ||
3209 | register: VolatileCell<u32>, | ||
3210 | } | ||
3211 | #[doc = "TCD Last Source Address Adjustment"] | ||
3212 | pub mod tcd23_slast; | ||
3213 | #[doc = "TCD Destination Address"] | ||
3214 | pub struct TCD23_DADDR { | ||
3215 | register: VolatileCell<u32>, | ||
3216 | } | ||
3217 | #[doc = "TCD Destination Address"] | ||
3218 | pub mod tcd23_daddr; | ||
3219 | #[doc = "TCD Signed Destination Address Offset"] | ||
3220 | pub struct TCD23_DOFF { | ||
3221 | register: VolatileCell<u16>, | ||
3222 | } | ||
3223 | #[doc = "TCD Signed Destination Address Offset"] | ||
3224 | pub mod tcd23_doff; | ||
3225 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3226 | pub struct TCD23_CITER_ELINKNO { | ||
3227 | register: VolatileCell<u16>, | ||
3228 | } | ||
3229 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3230 | pub mod tcd23_citer_elinkno; | ||
3231 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3232 | pub struct TCD23_CITER_ELINKYES { | ||
3233 | register: VolatileCell<u16>, | ||
3234 | } | ||
3235 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3236 | pub mod tcd23_citer_elinkyes; | ||
3237 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3238 | pub struct TCD23_DLASTSGA { | ||
3239 | register: VolatileCell<u32>, | ||
3240 | } | ||
3241 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3242 | pub mod tcd23_dlastsga; | ||
3243 | #[doc = "TCD Control and Status"] | ||
3244 | pub struct TCD23_CSR { | ||
3245 | register: VolatileCell<u16>, | ||
3246 | } | ||
3247 | #[doc = "TCD Control and Status"] | ||
3248 | pub mod tcd23_csr; | ||
3249 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3250 | pub struct TCD23_BITER_ELINKNO { | ||
3251 | register: VolatileCell<u16>, | ||
3252 | } | ||
3253 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3254 | pub mod tcd23_biter_elinkno; | ||
3255 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3256 | pub struct TCD23_BITER_ELINKYES { | ||
3257 | register: VolatileCell<u16>, | ||
3258 | } | ||
3259 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3260 | pub mod tcd23_biter_elinkyes; | ||
3261 | #[doc = "TCD Source Address"] | ||
3262 | pub struct TCD24_SADDR { | ||
3263 | register: VolatileCell<u32>, | ||
3264 | } | ||
3265 | #[doc = "TCD Source Address"] | ||
3266 | pub mod tcd24_saddr; | ||
3267 | #[doc = "TCD Signed Source Address Offset"] | ||
3268 | pub struct TCD24_SOFF { | ||
3269 | register: VolatileCell<u16>, | ||
3270 | } | ||
3271 | #[doc = "TCD Signed Source Address Offset"] | ||
3272 | pub mod tcd24_soff; | ||
3273 | #[doc = "TCD Transfer Attributes"] | ||
3274 | pub struct TCD24_ATTR { | ||
3275 | register: VolatileCell<u16>, | ||
3276 | } | ||
3277 | #[doc = "TCD Transfer Attributes"] | ||
3278 | pub mod tcd24_attr; | ||
3279 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3280 | pub struct TCD24_NBYTES_MLNO { | ||
3281 | register: VolatileCell<u32>, | ||
3282 | } | ||
3283 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3284 | pub mod tcd24_nbytes_mlno; | ||
3285 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3286 | pub struct TCD24_NBYTES_MLOFFNO { | ||
3287 | register: VolatileCell<u32>, | ||
3288 | } | ||
3289 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3290 | pub mod tcd24_nbytes_mloffno; | ||
3291 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3292 | pub struct TCD24_NBYTES_MLOFFYES { | ||
3293 | register: VolatileCell<u32>, | ||
3294 | } | ||
3295 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3296 | pub mod tcd24_nbytes_mloffyes; | ||
3297 | #[doc = "TCD Last Source Address Adjustment"] | ||
3298 | pub struct TCD24_SLAST { | ||
3299 | register: VolatileCell<u32>, | ||
3300 | } | ||
3301 | #[doc = "TCD Last Source Address Adjustment"] | ||
3302 | pub mod tcd24_slast; | ||
3303 | #[doc = "TCD Destination Address"] | ||
3304 | pub struct TCD24_DADDR { | ||
3305 | register: VolatileCell<u32>, | ||
3306 | } | ||
3307 | #[doc = "TCD Destination Address"] | ||
3308 | pub mod tcd24_daddr; | ||
3309 | #[doc = "TCD Signed Destination Address Offset"] | ||
3310 | pub struct TCD24_DOFF { | ||
3311 | register: VolatileCell<u16>, | ||
3312 | } | ||
3313 | #[doc = "TCD Signed Destination Address Offset"] | ||
3314 | pub mod tcd24_doff; | ||
3315 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3316 | pub struct TCD24_CITER_ELINKNO { | ||
3317 | register: VolatileCell<u16>, | ||
3318 | } | ||
3319 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3320 | pub mod tcd24_citer_elinkno; | ||
3321 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3322 | pub struct TCD24_CITER_ELINKYES { | ||
3323 | register: VolatileCell<u16>, | ||
3324 | } | ||
3325 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3326 | pub mod tcd24_citer_elinkyes; | ||
3327 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3328 | pub struct TCD24_DLASTSGA { | ||
3329 | register: VolatileCell<u32>, | ||
3330 | } | ||
3331 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3332 | pub mod tcd24_dlastsga; | ||
3333 | #[doc = "TCD Control and Status"] | ||
3334 | pub struct TCD24_CSR { | ||
3335 | register: VolatileCell<u16>, | ||
3336 | } | ||
3337 | #[doc = "TCD Control and Status"] | ||
3338 | pub mod tcd24_csr; | ||
3339 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3340 | pub struct TCD24_BITER_ELINKNO { | ||
3341 | register: VolatileCell<u16>, | ||
3342 | } | ||
3343 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3344 | pub mod tcd24_biter_elinkno; | ||
3345 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3346 | pub struct TCD24_BITER_ELINKYES { | ||
3347 | register: VolatileCell<u16>, | ||
3348 | } | ||
3349 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3350 | pub mod tcd24_biter_elinkyes; | ||
3351 | #[doc = "TCD Source Address"] | ||
3352 | pub struct TCD25_SADDR { | ||
3353 | register: VolatileCell<u32>, | ||
3354 | } | ||
3355 | #[doc = "TCD Source Address"] | ||
3356 | pub mod tcd25_saddr; | ||
3357 | #[doc = "TCD Signed Source Address Offset"] | ||
3358 | pub struct TCD25_SOFF { | ||
3359 | register: VolatileCell<u16>, | ||
3360 | } | ||
3361 | #[doc = "TCD Signed Source Address Offset"] | ||
3362 | pub mod tcd25_soff; | ||
3363 | #[doc = "TCD Transfer Attributes"] | ||
3364 | pub struct TCD25_ATTR { | ||
3365 | register: VolatileCell<u16>, | ||
3366 | } | ||
3367 | #[doc = "TCD Transfer Attributes"] | ||
3368 | pub mod tcd25_attr; | ||
3369 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3370 | pub struct TCD25_NBYTES_MLNO { | ||
3371 | register: VolatileCell<u32>, | ||
3372 | } | ||
3373 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3374 | pub mod tcd25_nbytes_mlno; | ||
3375 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3376 | pub struct TCD25_NBYTES_MLOFFNO { | ||
3377 | register: VolatileCell<u32>, | ||
3378 | } | ||
3379 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3380 | pub mod tcd25_nbytes_mloffno; | ||
3381 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3382 | pub struct TCD25_NBYTES_MLOFFYES { | ||
3383 | register: VolatileCell<u32>, | ||
3384 | } | ||
3385 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3386 | pub mod tcd25_nbytes_mloffyes; | ||
3387 | #[doc = "TCD Last Source Address Adjustment"] | ||
3388 | pub struct TCD25_SLAST { | ||
3389 | register: VolatileCell<u32>, | ||
3390 | } | ||
3391 | #[doc = "TCD Last Source Address Adjustment"] | ||
3392 | pub mod tcd25_slast; | ||
3393 | #[doc = "TCD Destination Address"] | ||
3394 | pub struct TCD25_DADDR { | ||
3395 | register: VolatileCell<u32>, | ||
3396 | } | ||
3397 | #[doc = "TCD Destination Address"] | ||
3398 | pub mod tcd25_daddr; | ||
3399 | #[doc = "TCD Signed Destination Address Offset"] | ||
3400 | pub struct TCD25_DOFF { | ||
3401 | register: VolatileCell<u16>, | ||
3402 | } | ||
3403 | #[doc = "TCD Signed Destination Address Offset"] | ||
3404 | pub mod tcd25_doff; | ||
3405 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3406 | pub struct TCD25_CITER_ELINKNO { | ||
3407 | register: VolatileCell<u16>, | ||
3408 | } | ||
3409 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3410 | pub mod tcd25_citer_elinkno; | ||
3411 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3412 | pub struct TCD25_CITER_ELINKYES { | ||
3413 | register: VolatileCell<u16>, | ||
3414 | } | ||
3415 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3416 | pub mod tcd25_citer_elinkyes; | ||
3417 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3418 | pub struct TCD25_DLASTSGA { | ||
3419 | register: VolatileCell<u32>, | ||
3420 | } | ||
3421 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3422 | pub mod tcd25_dlastsga; | ||
3423 | #[doc = "TCD Control and Status"] | ||
3424 | pub struct TCD25_CSR { | ||
3425 | register: VolatileCell<u16>, | ||
3426 | } | ||
3427 | #[doc = "TCD Control and Status"] | ||
3428 | pub mod tcd25_csr; | ||
3429 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3430 | pub struct TCD25_BITER_ELINKNO { | ||
3431 | register: VolatileCell<u16>, | ||
3432 | } | ||
3433 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3434 | pub mod tcd25_biter_elinkno; | ||
3435 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3436 | pub struct TCD25_BITER_ELINKYES { | ||
3437 | register: VolatileCell<u16>, | ||
3438 | } | ||
3439 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3440 | pub mod tcd25_biter_elinkyes; | ||
3441 | #[doc = "TCD Source Address"] | ||
3442 | pub struct TCD26_SADDR { | ||
3443 | register: VolatileCell<u32>, | ||
3444 | } | ||
3445 | #[doc = "TCD Source Address"] | ||
3446 | pub mod tcd26_saddr; | ||
3447 | #[doc = "TCD Signed Source Address Offset"] | ||
3448 | pub struct TCD26_SOFF { | ||
3449 | register: VolatileCell<u16>, | ||
3450 | } | ||
3451 | #[doc = "TCD Signed Source Address Offset"] | ||
3452 | pub mod tcd26_soff; | ||
3453 | #[doc = "TCD Transfer Attributes"] | ||
3454 | pub struct TCD26_ATTR { | ||
3455 | register: VolatileCell<u16>, | ||
3456 | } | ||
3457 | #[doc = "TCD Transfer Attributes"] | ||
3458 | pub mod tcd26_attr; | ||
3459 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3460 | pub struct TCD26_NBYTES_MLNO { | ||
3461 | register: VolatileCell<u32>, | ||
3462 | } | ||
3463 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3464 | pub mod tcd26_nbytes_mlno; | ||
3465 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3466 | pub struct TCD26_NBYTES_MLOFFNO { | ||
3467 | register: VolatileCell<u32>, | ||
3468 | } | ||
3469 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3470 | pub mod tcd26_nbytes_mloffno; | ||
3471 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3472 | pub struct TCD26_NBYTES_MLOFFYES { | ||
3473 | register: VolatileCell<u32>, | ||
3474 | } | ||
3475 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3476 | pub mod tcd26_nbytes_mloffyes; | ||
3477 | #[doc = "TCD Last Source Address Adjustment"] | ||
3478 | pub struct TCD26_SLAST { | ||
3479 | register: VolatileCell<u32>, | ||
3480 | } | ||
3481 | #[doc = "TCD Last Source Address Adjustment"] | ||
3482 | pub mod tcd26_slast; | ||
3483 | #[doc = "TCD Destination Address"] | ||
3484 | pub struct TCD26_DADDR { | ||
3485 | register: VolatileCell<u32>, | ||
3486 | } | ||
3487 | #[doc = "TCD Destination Address"] | ||
3488 | pub mod tcd26_daddr; | ||
3489 | #[doc = "TCD Signed Destination Address Offset"] | ||
3490 | pub struct TCD26_DOFF { | ||
3491 | register: VolatileCell<u16>, | ||
3492 | } | ||
3493 | #[doc = "TCD Signed Destination Address Offset"] | ||
3494 | pub mod tcd26_doff; | ||
3495 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3496 | pub struct TCD26_CITER_ELINKNO { | ||
3497 | register: VolatileCell<u16>, | ||
3498 | } | ||
3499 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3500 | pub mod tcd26_citer_elinkno; | ||
3501 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3502 | pub struct TCD26_CITER_ELINKYES { | ||
3503 | register: VolatileCell<u16>, | ||
3504 | } | ||
3505 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3506 | pub mod tcd26_citer_elinkyes; | ||
3507 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3508 | pub struct TCD26_DLASTSGA { | ||
3509 | register: VolatileCell<u32>, | ||
3510 | } | ||
3511 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3512 | pub mod tcd26_dlastsga; | ||
3513 | #[doc = "TCD Control and Status"] | ||
3514 | pub struct TCD26_CSR { | ||
3515 | register: VolatileCell<u16>, | ||
3516 | } | ||
3517 | #[doc = "TCD Control and Status"] | ||
3518 | pub mod tcd26_csr; | ||
3519 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3520 | pub struct TCD26_BITER_ELINKNO { | ||
3521 | register: VolatileCell<u16>, | ||
3522 | } | ||
3523 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3524 | pub mod tcd26_biter_elinkno; | ||
3525 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3526 | pub struct TCD26_BITER_ELINKYES { | ||
3527 | register: VolatileCell<u16>, | ||
3528 | } | ||
3529 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3530 | pub mod tcd26_biter_elinkyes; | ||
3531 | #[doc = "TCD Source Address"] | ||
3532 | pub struct TCD27_SADDR { | ||
3533 | register: VolatileCell<u32>, | ||
3534 | } | ||
3535 | #[doc = "TCD Source Address"] | ||
3536 | pub mod tcd27_saddr; | ||
3537 | #[doc = "TCD Signed Source Address Offset"] | ||
3538 | pub struct TCD27_SOFF { | ||
3539 | register: VolatileCell<u16>, | ||
3540 | } | ||
3541 | #[doc = "TCD Signed Source Address Offset"] | ||
3542 | pub mod tcd27_soff; | ||
3543 | #[doc = "TCD Transfer Attributes"] | ||
3544 | pub struct TCD27_ATTR { | ||
3545 | register: VolatileCell<u16>, | ||
3546 | } | ||
3547 | #[doc = "TCD Transfer Attributes"] | ||
3548 | pub mod tcd27_attr; | ||
3549 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3550 | pub struct TCD27_NBYTES_MLNO { | ||
3551 | register: VolatileCell<u32>, | ||
3552 | } | ||
3553 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3554 | pub mod tcd27_nbytes_mlno; | ||
3555 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3556 | pub struct TCD27_NBYTES_MLOFFNO { | ||
3557 | register: VolatileCell<u32>, | ||
3558 | } | ||
3559 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3560 | pub mod tcd27_nbytes_mloffno; | ||
3561 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3562 | pub struct TCD27_NBYTES_MLOFFYES { | ||
3563 | register: VolatileCell<u32>, | ||
3564 | } | ||
3565 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3566 | pub mod tcd27_nbytes_mloffyes; | ||
3567 | #[doc = "TCD Last Source Address Adjustment"] | ||
3568 | pub struct TCD27_SLAST { | ||
3569 | register: VolatileCell<u32>, | ||
3570 | } | ||
3571 | #[doc = "TCD Last Source Address Adjustment"] | ||
3572 | pub mod tcd27_slast; | ||
3573 | #[doc = "TCD Destination Address"] | ||
3574 | pub struct TCD27_DADDR { | ||
3575 | register: VolatileCell<u32>, | ||
3576 | } | ||
3577 | #[doc = "TCD Destination Address"] | ||
3578 | pub mod tcd27_daddr; | ||
3579 | #[doc = "TCD Signed Destination Address Offset"] | ||
3580 | pub struct TCD27_DOFF { | ||
3581 | register: VolatileCell<u16>, | ||
3582 | } | ||
3583 | #[doc = "TCD Signed Destination Address Offset"] | ||
3584 | pub mod tcd27_doff; | ||
3585 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3586 | pub struct TCD27_CITER_ELINKNO { | ||
3587 | register: VolatileCell<u16>, | ||
3588 | } | ||
3589 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3590 | pub mod tcd27_citer_elinkno; | ||
3591 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3592 | pub struct TCD27_CITER_ELINKYES { | ||
3593 | register: VolatileCell<u16>, | ||
3594 | } | ||
3595 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3596 | pub mod tcd27_citer_elinkyes; | ||
3597 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3598 | pub struct TCD27_DLASTSGA { | ||
3599 | register: VolatileCell<u32>, | ||
3600 | } | ||
3601 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3602 | pub mod tcd27_dlastsga; | ||
3603 | #[doc = "TCD Control and Status"] | ||
3604 | pub struct TCD27_CSR { | ||
3605 | register: VolatileCell<u16>, | ||
3606 | } | ||
3607 | #[doc = "TCD Control and Status"] | ||
3608 | pub mod tcd27_csr; | ||
3609 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3610 | pub struct TCD27_BITER_ELINKNO { | ||
3611 | register: VolatileCell<u16>, | ||
3612 | } | ||
3613 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3614 | pub mod tcd27_biter_elinkno; | ||
3615 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3616 | pub struct TCD27_BITER_ELINKYES { | ||
3617 | register: VolatileCell<u16>, | ||
3618 | } | ||
3619 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3620 | pub mod tcd27_biter_elinkyes; | ||
3621 | #[doc = "TCD Source Address"] | ||
3622 | pub struct TCD28_SADDR { | ||
3623 | register: VolatileCell<u32>, | ||
3624 | } | ||
3625 | #[doc = "TCD Source Address"] | ||
3626 | pub mod tcd28_saddr; | ||
3627 | #[doc = "TCD Signed Source Address Offset"] | ||
3628 | pub struct TCD28_SOFF { | ||
3629 | register: VolatileCell<u16>, | ||
3630 | } | ||
3631 | #[doc = "TCD Signed Source Address Offset"] | ||
3632 | pub mod tcd28_soff; | ||
3633 | #[doc = "TCD Transfer Attributes"] | ||
3634 | pub struct TCD28_ATTR { | ||
3635 | register: VolatileCell<u16>, | ||
3636 | } | ||
3637 | #[doc = "TCD Transfer Attributes"] | ||
3638 | pub mod tcd28_attr; | ||
3639 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3640 | pub struct TCD28_NBYTES_MLNO { | ||
3641 | register: VolatileCell<u32>, | ||
3642 | } | ||
3643 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3644 | pub mod tcd28_nbytes_mlno; | ||
3645 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3646 | pub struct TCD28_NBYTES_MLOFFNO { | ||
3647 | register: VolatileCell<u32>, | ||
3648 | } | ||
3649 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3650 | pub mod tcd28_nbytes_mloffno; | ||
3651 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3652 | pub struct TCD28_NBYTES_MLOFFYES { | ||
3653 | register: VolatileCell<u32>, | ||
3654 | } | ||
3655 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3656 | pub mod tcd28_nbytes_mloffyes; | ||
3657 | #[doc = "TCD Last Source Address Adjustment"] | ||
3658 | pub struct TCD28_SLAST { | ||
3659 | register: VolatileCell<u32>, | ||
3660 | } | ||
3661 | #[doc = "TCD Last Source Address Adjustment"] | ||
3662 | pub mod tcd28_slast; | ||
3663 | #[doc = "TCD Destination Address"] | ||
3664 | pub struct TCD28_DADDR { | ||
3665 | register: VolatileCell<u32>, | ||
3666 | } | ||
3667 | #[doc = "TCD Destination Address"] | ||
3668 | pub mod tcd28_daddr; | ||
3669 | #[doc = "TCD Signed Destination Address Offset"] | ||
3670 | pub struct TCD28_DOFF { | ||
3671 | register: VolatileCell<u16>, | ||
3672 | } | ||
3673 | #[doc = "TCD Signed Destination Address Offset"] | ||
3674 | pub mod tcd28_doff; | ||
3675 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3676 | pub struct TCD28_CITER_ELINKNO { | ||
3677 | register: VolatileCell<u16>, | ||
3678 | } | ||
3679 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3680 | pub mod tcd28_citer_elinkno; | ||
3681 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3682 | pub struct TCD28_CITER_ELINKYES { | ||
3683 | register: VolatileCell<u16>, | ||
3684 | } | ||
3685 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3686 | pub mod tcd28_citer_elinkyes; | ||
3687 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3688 | pub struct TCD28_DLASTSGA { | ||
3689 | register: VolatileCell<u32>, | ||
3690 | } | ||
3691 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3692 | pub mod tcd28_dlastsga; | ||
3693 | #[doc = "TCD Control and Status"] | ||
3694 | pub struct TCD28_CSR { | ||
3695 | register: VolatileCell<u16>, | ||
3696 | } | ||
3697 | #[doc = "TCD Control and Status"] | ||
3698 | pub mod tcd28_csr; | ||
3699 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3700 | pub struct TCD28_BITER_ELINKNO { | ||
3701 | register: VolatileCell<u16>, | ||
3702 | } | ||
3703 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3704 | pub mod tcd28_biter_elinkno; | ||
3705 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3706 | pub struct TCD28_BITER_ELINKYES { | ||
3707 | register: VolatileCell<u16>, | ||
3708 | } | ||
3709 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3710 | pub mod tcd28_biter_elinkyes; | ||
3711 | #[doc = "TCD Source Address"] | ||
3712 | pub struct TCD29_SADDR { | ||
3713 | register: VolatileCell<u32>, | ||
3714 | } | ||
3715 | #[doc = "TCD Source Address"] | ||
3716 | pub mod tcd29_saddr; | ||
3717 | #[doc = "TCD Signed Source Address Offset"] | ||
3718 | pub struct TCD29_SOFF { | ||
3719 | register: VolatileCell<u16>, | ||
3720 | } | ||
3721 | #[doc = "TCD Signed Source Address Offset"] | ||
3722 | pub mod tcd29_soff; | ||
3723 | #[doc = "TCD Transfer Attributes"] | ||
3724 | pub struct TCD29_ATTR { | ||
3725 | register: VolatileCell<u16>, | ||
3726 | } | ||
3727 | #[doc = "TCD Transfer Attributes"] | ||
3728 | pub mod tcd29_attr; | ||
3729 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3730 | pub struct TCD29_NBYTES_MLNO { | ||
3731 | register: VolatileCell<u32>, | ||
3732 | } | ||
3733 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3734 | pub mod tcd29_nbytes_mlno; | ||
3735 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3736 | pub struct TCD29_NBYTES_MLOFFNO { | ||
3737 | register: VolatileCell<u32>, | ||
3738 | } | ||
3739 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3740 | pub mod tcd29_nbytes_mloffno; | ||
3741 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3742 | pub struct TCD29_NBYTES_MLOFFYES { | ||
3743 | register: VolatileCell<u32>, | ||
3744 | } | ||
3745 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3746 | pub mod tcd29_nbytes_mloffyes; | ||
3747 | #[doc = "TCD Last Source Address Adjustment"] | ||
3748 | pub struct TCD29_SLAST { | ||
3749 | register: VolatileCell<u32>, | ||
3750 | } | ||
3751 | #[doc = "TCD Last Source Address Adjustment"] | ||
3752 | pub mod tcd29_slast; | ||
3753 | #[doc = "TCD Destination Address"] | ||
3754 | pub struct TCD29_DADDR { | ||
3755 | register: VolatileCell<u32>, | ||
3756 | } | ||
3757 | #[doc = "TCD Destination Address"] | ||
3758 | pub mod tcd29_daddr; | ||
3759 | #[doc = "TCD Signed Destination Address Offset"] | ||
3760 | pub struct TCD29_DOFF { | ||
3761 | register: VolatileCell<u16>, | ||
3762 | } | ||
3763 | #[doc = "TCD Signed Destination Address Offset"] | ||
3764 | pub mod tcd29_doff; | ||
3765 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3766 | pub struct TCD29_CITER_ELINKNO { | ||
3767 | register: VolatileCell<u16>, | ||
3768 | } | ||
3769 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3770 | pub mod tcd29_citer_elinkno; | ||
3771 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3772 | pub struct TCD29_CITER_ELINKYES { | ||
3773 | register: VolatileCell<u16>, | ||
3774 | } | ||
3775 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3776 | pub mod tcd29_citer_elinkyes; | ||
3777 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3778 | pub struct TCD29_DLASTSGA { | ||
3779 | register: VolatileCell<u32>, | ||
3780 | } | ||
3781 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3782 | pub mod tcd29_dlastsga; | ||
3783 | #[doc = "TCD Control and Status"] | ||
3784 | pub struct TCD29_CSR { | ||
3785 | register: VolatileCell<u16>, | ||
3786 | } | ||
3787 | #[doc = "TCD Control and Status"] | ||
3788 | pub mod tcd29_csr; | ||
3789 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3790 | pub struct TCD29_BITER_ELINKNO { | ||
3791 | register: VolatileCell<u16>, | ||
3792 | } | ||
3793 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3794 | pub mod tcd29_biter_elinkno; | ||
3795 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3796 | pub struct TCD29_BITER_ELINKYES { | ||
3797 | register: VolatileCell<u16>, | ||
3798 | } | ||
3799 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3800 | pub mod tcd29_biter_elinkyes; | ||
3801 | #[doc = "TCD Source Address"] | ||
3802 | pub struct TCD30_SADDR { | ||
3803 | register: VolatileCell<u32>, | ||
3804 | } | ||
3805 | #[doc = "TCD Source Address"] | ||
3806 | pub mod tcd30_saddr; | ||
3807 | #[doc = "TCD Signed Source Address Offset"] | ||
3808 | pub struct TCD30_SOFF { | ||
3809 | register: VolatileCell<u16>, | ||
3810 | } | ||
3811 | #[doc = "TCD Signed Source Address Offset"] | ||
3812 | pub mod tcd30_soff; | ||
3813 | #[doc = "TCD Transfer Attributes"] | ||
3814 | pub struct TCD30_ATTR { | ||
3815 | register: VolatileCell<u16>, | ||
3816 | } | ||
3817 | #[doc = "TCD Transfer Attributes"] | ||
3818 | pub mod tcd30_attr; | ||
3819 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3820 | pub struct TCD30_NBYTES_MLNO { | ||
3821 | register: VolatileCell<u32>, | ||
3822 | } | ||
3823 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3824 | pub mod tcd30_nbytes_mlno; | ||
3825 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3826 | pub struct TCD30_NBYTES_MLOFFNO { | ||
3827 | register: VolatileCell<u32>, | ||
3828 | } | ||
3829 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3830 | pub mod tcd30_nbytes_mloffno; | ||
3831 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3832 | pub struct TCD30_NBYTES_MLOFFYES { | ||
3833 | register: VolatileCell<u32>, | ||
3834 | } | ||
3835 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3836 | pub mod tcd30_nbytes_mloffyes; | ||
3837 | #[doc = "TCD Last Source Address Adjustment"] | ||
3838 | pub struct TCD30_SLAST { | ||
3839 | register: VolatileCell<u32>, | ||
3840 | } | ||
3841 | #[doc = "TCD Last Source Address Adjustment"] | ||
3842 | pub mod tcd30_slast; | ||
3843 | #[doc = "TCD Destination Address"] | ||
3844 | pub struct TCD30_DADDR { | ||
3845 | register: VolatileCellz<u32>, | ||
3846 | } | ||
3847 | #[doc = "TCD Destination Address"] | ||
3848 | pub mod tcd30_daddr; | ||
3849 | #[doc = "TCD Signed Destination Address Offset"] | ||
3850 | pub struct TCD30_DOFF { | ||
3851 | register: VolatileCell<u16>, | ||
3852 | } | ||
3853 | #[doc = "TCD Signed Destination Address Offset"] | ||
3854 | pub mod tcd30_doff; | ||
3855 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3856 | pub struct TCD30_CITER_ELINKNO { | ||
3857 | register: VolatileCell<u16>, | ||
3858 | } | ||
3859 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3860 | pub mod tcd30_citer_elinkno; | ||
3861 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3862 | pub struct TCD30_CITER_ELINKYES { | ||
3863 | register: VolatileCell<u16>, | ||
3864 | } | ||
3865 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3866 | pub mod tcd30_citer_elinkyes; | ||
3867 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3868 | pub struct TCD30_DLASTSGA { | ||
3869 | register: VolatileCell<u32>, | ||
3870 | } | ||
3871 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3872 | pub mod tcd30_dlastsga; | ||
3873 | #[doc = "TCD Control and Status"] | ||
3874 | pub struct TCD30_CSR { | ||
3875 | register: VolatileCell<u16>, | ||
3876 | } | ||
3877 | #[doc = "TCD Control and Status"] | ||
3878 | pub mod tcd30_csr; | ||
3879 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3880 | pub struct TCD30_BITER_ELINKNO { | ||
3881 | register: VolatileCell<u16>, | ||
3882 | } | ||
3883 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3884 | pub mod tcd30_biter_elinkno; | ||
3885 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3886 | pub struct TCD30_BITER_ELINKYES { | ||
3887 | register: VolatileCell<u16>, | ||
3888 | } | ||
3889 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3890 | pub mod tcd30_biter_elinkyes; | ||
3891 | #[doc = "TCD Source Address"] | ||
3892 | pub struct TCD31_SADDR { | ||
3893 | register: VolatileCell<u32>, | ||
3894 | } | ||
3895 | #[doc = "TCD Source Address"] | ||
3896 | pub mod tcd31_saddr; | ||
3897 | #[doc = "TCD Signed Source Address Offset"] | ||
3898 | pub struct TCD31_SOFF { | ||
3899 | register: VolatileCell<u16>, | ||
3900 | } | ||
3901 | #[doc = "TCD Signed Source Address Offset"] | ||
3902 | pub mod tcd31_soff; | ||
3903 | #[doc = "TCD Transfer Attributes"] | ||
3904 | pub struct TCD31_ATTR { | ||
3905 | register: VolatileCell<u16>, | ||
3906 | } | ||
3907 | #[doc = "TCD Transfer Attributes"] | ||
3908 | pub mod tcd31_attr; | ||
3909 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3910 | pub struct TCD31_NBYTES_MLNO { | ||
3911 | register: VolatileCell<u32>, | ||
3912 | } | ||
3913 | #[doc = "TCD Minor Byte Count (Minor Loop Mapping Disabled)"] | ||
3914 | pub mod tcd31_nbytes_mlno; | ||
3915 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3916 | pub struct TCD31_NBYTES_MLOFFNO { | ||
3917 | register: VolatileCell<u32>, | ||
3918 | } | ||
3919 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"] | ||
3920 | pub mod tcd31_nbytes_mloffno; | ||
3921 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3922 | pub struct TCD31_NBYTES_MLOFFYES { | ||
3923 | register: VolatileCell<u32>, | ||
3924 | } | ||
3925 | #[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping and Offset Enabled)"] | ||
3926 | pub mod tcd31_nbytes_mloffyes; | ||
3927 | #[doc = "TCD Last Source Address Adjustment"] | ||
3928 | pub struct TCD31_SLAST { | ||
3929 | register: VolatileCell<u32>, | ||
3930 | } | ||
3931 | #[doc = "TCD Last Source Address Adjustment"] | ||
3932 | pub mod tcd31_slast; | ||
3933 | #[doc = "TCD Destination Address"] | ||
3934 | pub struct TCD31_DADDR { | ||
3935 | register: VolatileCell<u32>, | ||
3936 | } | ||
3937 | #[doc = "TCD Destination Address"] | ||
3938 | pub mod tcd31_daddr; | ||
3939 | #[doc = "TCD Signed Destination Address Offset"] | ||
3940 | pub struct TCD31_DOFF { | ||
3941 | register: VolatileCell<u16>, | ||
3942 | } | ||
3943 | #[doc = "TCD Signed Destination Address Offset"] | ||
3944 | pub mod tcd31_doff; | ||
3945 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3946 | pub struct TCD31_CITER_ELINKNO { | ||
3947 | register: VolatileCell<u16>, | ||
3948 | } | ||
3949 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3950 | pub mod tcd31_citer_elinkno; | ||
3951 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3952 | pub struct TCD31_CITER_ELINKYES { | ||
3953 | register: VolatileCell<u16>, | ||
3954 | } | ||
3955 | #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3956 | pub mod tcd31_citer_elinkyes; | ||
3957 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3958 | pub struct TCD31_DLASTSGA { | ||
3959 | register: VolatileCell<u32>, | ||
3960 | } | ||
3961 | #[doc = "TCD Last Destination Address Adjustment/Scatter Gather Address"] | ||
3962 | pub mod tcd31_dlastsga; | ||
3963 | #[doc = "TCD Control and Status"] | ||
3964 | pub struct TCD31_CSR { | ||
3965 | register: VolatileCell<u32>, | ||
3966 | } | ||
3967 | #[doc = "TCD Control and Status"] | ||
3968 | pub mod tcd31_csr; | ||
3969 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3970 | pub struct TCD31_BITER_ELINKNO { | ||
3971 | register: VolatileCell<u16>, | ||
3972 | } | ||
3973 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled)"] | ||
3974 | pub mod tcd31_biter_elinkno; | ||
3975 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3976 | pub struct TCD31_BITER_ELINKYES { | ||
3977 | register: VolatileCell<u16>, | ||
3978 | } | ||
3979 | #[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] | ||
3980 | pub mod tcd31_biter_elinkyes; | ||
diff --git a/editors/code/icon.png b/editors/code/icon.png index 992aee4bd..072090c6f 100644 --- a/editors/code/icon.png +++ b/editors/code/icon.png | |||
Binary files differ | |||
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index 746dd4bc3..05c57c7ff 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json | |||
@@ -889,32 +889,32 @@ | |||
889 | } | 889 | } |
890 | }, | 890 | }, |
891 | "vscode-jsonrpc": { | 891 | "vscode-jsonrpc": { |
892 | "version": "5.0.0-next.7", | 892 | "version": "5.0.0", |
893 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.0-next.7.tgz", | 893 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.0.tgz", |
894 | "integrity": "sha512-DZuEyxaWuA0srFh9kKu2fudVG6d5CJhte3OW2ILM8lZqpHjI+/D2byrowFd0YmEbyQB2nh0yqg0sa1mhxOtivA==" | 894 | "integrity": "sha512-QeAniC/xTWauVQgyNgEqNJ0Qm/Jw8QySGRQhRFPwb8c4FPp9k6QNgJp0ayXWws5qhdaHkiXkGPlzjOPZFQQKLw==" |
895 | }, | 895 | }, |
896 | "vscode-languageclient": { | 896 | "vscode-languageclient": { |
897 | "version": "6.0.0-next.10", | 897 | "version": "6.0.0", |
898 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-6.0.0-next.10.tgz", | 898 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-6.0.0.tgz", |
899 | "integrity": "sha512-xJ9KNJnHfGIMz7ewuXijtUTje1Tc2fpuyYS/DHZI/MBwYRLp7L38KnivvYJmUICdPnrQTSvPSWKbjlwWhMlKwQ==", | 899 | "integrity": "sha512-6MDksAP79GRbcHFsXS6ndo12s0m/h7eNdS/IanRgWxaezqB4a4KzHIHrE0bE+nSFB+snaSToGs1bxnPeKdO5fQ==", |
900 | "requires": { | 900 | "requires": { |
901 | "semver": "^6.3.0", | 901 | "semver": "^6.3.0", |
902 | "vscode-languageserver-protocol": "^3.15.0-next.15" | 902 | "vscode-languageserver-protocol": "^3.15.0" |
903 | } | 903 | } |
904 | }, | 904 | }, |
905 | "vscode-languageserver-protocol": { | 905 | "vscode-languageserver-protocol": { |
906 | "version": "3.15.0-next.15", | 906 | "version": "3.15.0", |
907 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.15.tgz", | 907 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0.tgz", |
908 | "integrity": "sha512-c1f47pxAtUE+gYTGLoySVA+nBUbPtz8NMOLOB69RiTBQobSJBO1XXKB8TXz8BSxpG5T8qRXeEm2vXrM/eepYKg==", | 908 | "integrity": "sha512-PZEopQzHR3Lo422HeDxCpGN0sYz+kReO+du3F/AcFT1cCPunoVsDJv7ikEolFRKEn+hEIZiAaIX4yoSZ+ip5Nw==", |
909 | "requires": { | 909 | "requires": { |
910 | "vscode-jsonrpc": "^5.0.0-next.7", | 910 | "vscode-jsonrpc": "^5.0.0", |
911 | "vscode-languageserver-types": "^3.15.0-next.10" | 911 | "vscode-languageserver-types": "3.15.0" |
912 | } | 912 | } |
913 | }, | 913 | }, |
914 | "vscode-languageserver-types": { | 914 | "vscode-languageserver-types": { |
915 | "version": "3.15.0-next.10", | 915 | "version": "3.15.0", |
916 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.10.tgz", | 916 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0.tgz", |
917 | "integrity": "sha512-s9Psd+0sQVkH4o1U7hwTNJRuXQQgFvGVZIim7Wb44tcq54rZou3kJKCtdFEm0aHUuYxIrMPYrzuh1jlqCbRegw==" | 917 | "integrity": "sha512-AXteNagMhBWnZ6gNN0UB4HTiD/7TajgfHl6jaM6O7qz3zDJw0H3Jf83w05phihnBRCML+K6Ockh8f8bL0OObPw==" |
918 | }, | 918 | }, |
919 | "wrappy": { | 919 | "wrappy": { |
920 | "version": "1.0.2", | 920 | "version": "1.0.2", |
diff --git a/editors/code/package.json b/editors/code/package.json index fe2948861..d4c310734 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -25,7 +25,7 @@ | |||
25 | "dependencies": { | 25 | "dependencies": { |
26 | "jsonc-parser": "^2.1.0", | 26 | "jsonc-parser": "^2.1.0", |
27 | "seedrandom": "^3.0.5", | 27 | "seedrandom": "^3.0.5", |
28 | "vscode-languageclient": "^6.0.0-next.10" | 28 | "vscode-languageclient": "^6.0.0" |
29 | }, | 29 | }, |
30 | "devDependencies": { | 30 | "devDependencies": { |
31 | "@rollup/plugin-commonjs": "^11.0.0", | 31 | "@rollup/plugin-commonjs": "^11.0.0", |
@@ -228,7 +228,7 @@ | |||
228 | "rust-analyzer.displayInlayHints": { | 228 | "rust-analyzer.displayInlayHints": { |
229 | "type": "boolean", | 229 | "type": "boolean", |
230 | "default": true, | 230 | "default": true, |
231 | "description": "Display additional type information in the editor" | 231 | "description": "Display additional type and parameter information in the editor" |
232 | }, | 232 | }, |
233 | "rust-analyzer.maxInlayHintLength": { | 233 | "rust-analyzer.maxInlayHintLength": { |
234 | "type": "number", | 234 | "type": "number", |
diff --git a/editors/code/rollup.config.js b/editors/code/rollup.config.js index 14fb9e085..de6a3b2b7 100644 --- a/editors/code/rollup.config.js +++ b/editors/code/rollup.config.js | |||
@@ -13,7 +13,7 @@ export default { | |||
13 | commonjs({ | 13 | commonjs({ |
14 | namedExports: { | 14 | namedExports: { |
15 | // squelch missing import warnings | 15 | // squelch missing import warnings |
16 | 'vscode-languageclient': ['CreateFile', 'RenameFile', 'ErrorCodes'] | 16 | 'vscode-languageclient': ['CreateFile', 'RenameFile', 'ErrorCodes', 'WorkDoneProgress', 'WorkDoneProgressBegin', 'WorkDoneProgressReport', 'WorkDoneProgressEnd'] |
17 | } | 17 | } |
18 | }) | 18 | }) |
19 | ], | 19 | ], |
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index 9a1697dcb..dc075aa82 100644 --- a/editors/code/src/commands/index.ts +++ b/editors/code/src/commands/index.ts | |||
@@ -39,6 +39,18 @@ function applySourceChange(ctx: Ctx): Cmd { | |||
39 | }; | 39 | }; |
40 | } | 40 | } |
41 | 41 | ||
42 | function selectAndApplySourceChange(ctx: Ctx): Cmd { | ||
43 | return async (changes: sourceChange.SourceChange[]) => { | ||
44 | if (changes.length === 1) { | ||
45 | await sourceChange.applySourceChange(ctx, changes[0]); | ||
46 | } else if (changes.length > 0) { | ||
47 | const selectedChange = await vscode.window.showQuickPick(changes); | ||
48 | if (!selectedChange) return; | ||
49 | await sourceChange.applySourceChange(ctx, selectedChange); | ||
50 | } | ||
51 | }; | ||
52 | } | ||
53 | |||
42 | function reload(ctx: Ctx): Cmd { | 54 | function reload(ctx: Ctx): Cmd { |
43 | return async () => { | 55 | return async () => { |
44 | vscode.window.showInformationMessage('Reloading rust-analyzer...'); | 56 | vscode.window.showInformationMessage('Reloading rust-analyzer...'); |
@@ -59,5 +71,6 @@ export { | |||
59 | runSingle, | 71 | runSingle, |
60 | showReferences, | 72 | showReferences, |
61 | applySourceChange, | 73 | applySourceChange, |
74 | selectAndApplySourceChange, | ||
62 | reload | 75 | reload |
63 | }; | 76 | }; |
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index ec2790b63..fc21c8813 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -42,6 +42,7 @@ export class Config { | |||
42 | 42 | ||
43 | private prevEnhancedTyping: null | boolean = null; | 43 | private prevEnhancedTyping: null | boolean = null; |
44 | private prevCargoFeatures: null | CargoFeatures = null; | 44 | private prevCargoFeatures: null | CargoFeatures = null; |
45 | private prevCargoWatchOptions: null | CargoWatchOptions = null; | ||
45 | 46 | ||
46 | constructor(ctx: vscode.ExtensionContext) { | 47 | constructor(ctx: vscode.ExtensionContext) { |
47 | vscode.workspace.onDidChangeConfiguration(_ => this.refresh(), ctx.subscriptions); | 48 | vscode.workspace.onDidChangeConfiguration(_ => this.refresh(), ctx.subscriptions); |
@@ -174,6 +175,21 @@ export class Config { | |||
174 | } | 175 | } |
175 | this.prevCargoFeatures = { ...this.cargoFeatures }; | 176 | this.prevCargoFeatures = { ...this.cargoFeatures }; |
176 | 177 | ||
178 | if (this.prevCargoWatchOptions !== null) { | ||
179 | const changed = | ||
180 | this.cargoWatchOptions.enable !== this.prevCargoWatchOptions.enable || | ||
181 | this.cargoWatchOptions.command !== this.prevCargoWatchOptions.command || | ||
182 | this.cargoWatchOptions.allTargets !== this.prevCargoWatchOptions.allTargets || | ||
183 | this.cargoWatchOptions.arguments.length !== this.prevCargoWatchOptions.arguments.length || | ||
184 | this.cargoWatchOptions.arguments.some( | ||
185 | (v, i) => v !== this.prevCargoWatchOptions!.arguments[i], | ||
186 | ); | ||
187 | if (changed) { | ||
188 | requireReloadMessage = 'Changing cargo-watch options requires a reload'; | ||
189 | } | ||
190 | } | ||
191 | this.prevCargoWatchOptions = { ...this.cargoWatchOptions }; | ||
192 | |||
177 | if (requireReloadMessage !== null) { | 193 | if (requireReloadMessage !== null) { |
178 | const reloadAction = 'Reload now'; | 194 | const reloadAction = 'Reload now'; |
179 | vscode.window | 195 | vscode.window |
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index 078d18f0f..6357e44f1 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts | |||
@@ -38,6 +38,12 @@ const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ | |||
38 | }, | 38 | }, |
39 | }); | 39 | }); |
40 | 40 | ||
41 | const parameterHintDecorationType = vscode.window.createTextEditorDecorationType({ | ||
42 | before: { | ||
43 | color: new vscode.ThemeColor('rust_analyzer.inlayHint'), | ||
44 | } | ||
45 | }); | ||
46 | |||
41 | class HintsUpdater { | 47 | class HintsUpdater { |
42 | private pending: Map<string, vscode.CancellationTokenSource> = new Map(); | 48 | private pending: Map<string, vscode.CancellationTokenSource> = new Map(); |
43 | private ctx: Ctx; | 49 | private ctx: Ctx; |
@@ -55,7 +61,10 @@ class HintsUpdater { | |||
55 | if (this.enabled) { | 61 | if (this.enabled) { |
56 | await this.refresh(); | 62 | await this.refresh(); |
57 | } else { | 63 | } else { |
58 | this.allEditors.forEach(it => this.setDecorations(it, [])); | 64 | this.allEditors.forEach(it => { |
65 | this.setTypeDecorations(it, []); | ||
66 | this.setParameterDecorations(it, []); | ||
67 | }); | ||
59 | } | 68 | } |
60 | } | 69 | } |
61 | 70 | ||
@@ -68,15 +77,27 @@ class HintsUpdater { | |||
68 | private async refreshEditor(editor: vscode.TextEditor): Promise<void> { | 77 | private async refreshEditor(editor: vscode.TextEditor): Promise<void> { |
69 | const newHints = await this.queryHints(editor.document.uri.toString()); | 78 | const newHints = await this.queryHints(editor.document.uri.toString()); |
70 | if (newHints == null) return; | 79 | if (newHints == null) return; |
71 | const newDecorations = newHints.map(hint => ({ | 80 | const newTypeDecorations = newHints.filter(hint => hint.kind === 'TypeHint') |
72 | range: hint.range, | 81 | .map(hint => ({ |
73 | renderOptions: { | 82 | range: hint.range, |
74 | after: { | 83 | renderOptions: { |
75 | contentText: `: ${hint.label}`, | 84 | after: { |
85 | contentText: `: ${hint.label}`, | ||
86 | }, | ||
76 | }, | 87 | }, |
77 | }, | 88 | })); |
78 | })); | 89 | this.setTypeDecorations(editor, newTypeDecorations); |
79 | this.setDecorations(editor, newDecorations); | 90 | |
91 | const newParameterDecorations = newHints.filter(hint => hint.kind === 'ParameterHint') | ||
92 | .map(hint => ({ | ||
93 | range: hint.range, | ||
94 | renderOptions: { | ||
95 | before: { | ||
96 | contentText: `${hint.label}: `, | ||
97 | }, | ||
98 | }, | ||
99 | })); | ||
100 | this.setParameterDecorations(editor, newParameterDecorations); | ||
80 | } | 101 | } |
81 | 102 | ||
82 | private get allEditors(): vscode.TextEditor[] { | 103 | private get allEditors(): vscode.TextEditor[] { |
@@ -85,7 +106,7 @@ class HintsUpdater { | |||
85 | ); | 106 | ); |
86 | } | 107 | } |
87 | 108 | ||
88 | private setDecorations( | 109 | private setTypeDecorations( |
89 | editor: vscode.TextEditor, | 110 | editor: vscode.TextEditor, |
90 | decorations: vscode.DecorationOptions[], | 111 | decorations: vscode.DecorationOptions[], |
91 | ) { | 112 | ) { |
@@ -95,6 +116,16 @@ class HintsUpdater { | |||
95 | ); | 116 | ); |
96 | } | 117 | } |
97 | 118 | ||
119 | private setParameterDecorations( | ||
120 | editor: vscode.TextEditor, | ||
121 | decorations: vscode.DecorationOptions[], | ||
122 | ) { | ||
123 | editor.setDecorations( | ||
124 | parameterHintDecorationType, | ||
125 | this.enabled ? decorations : [], | ||
126 | ); | ||
127 | } | ||
128 | |||
98 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { | 129 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { |
99 | let client = this.ctx.client; | 130 | let client = this.ctx.client; |
100 | if (!client) return null; | 131 | if (!client) return null; |
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 430ad31b4..0494ccf63 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -26,6 +26,7 @@ export async function activate(context: vscode.ExtensionContext) { | |||
26 | ctx.registerCommand('runSingle', commands.runSingle); | 26 | ctx.registerCommand('runSingle', commands.runSingle); |
27 | ctx.registerCommand('showReferences', commands.showReferences); | 27 | ctx.registerCommand('showReferences', commands.showReferences); |
28 | ctx.registerCommand('applySourceChange', commands.applySourceChange); | 28 | ctx.registerCommand('applySourceChange', commands.applySourceChange); |
29 | ctx.registerCommand('selectAndApplySourceChange', commands.selectAndApplySourceChange); | ||
29 | 30 | ||
30 | if (ctx.config.enableEnhancedTyping) { | 31 | if (ctx.config.enableEnhancedTyping) { |
31 | ctx.overrideCommand('type', commands.onEnter); | 32 | ctx.overrideCommand('type', commands.onEnter); |
diff --git a/editors/code/src/status_display.ts b/editors/code/src/status_display.ts index 371a2f3bb..c75fddf9d 100644 --- a/editors/code/src/status_display.ts +++ b/editors/code/src/status_display.ts | |||
@@ -1,5 +1,7 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | 2 | ||
3 | import { WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressReport, WorkDoneProgressEnd } from 'vscode-languageclient'; | ||
4 | |||
3 | import { Ctx } from './ctx'; | 5 | import { Ctx } from './ctx'; |
4 | 6 | ||
5 | const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']; | 7 | const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']; |
@@ -8,7 +10,7 @@ export function activateStatusDisplay(ctx: Ctx) { | |||
8 | const statusDisplay = new StatusDisplay(ctx.config.cargoWatchOptions.command); | 10 | const statusDisplay = new StatusDisplay(ctx.config.cargoWatchOptions.command); |
9 | ctx.pushCleanup(statusDisplay); | 11 | ctx.pushCleanup(statusDisplay); |
10 | ctx.onDidRestart(client => { | 12 | ctx.onDidRestart(client => { |
11 | client.onNotification('$/progress', params => statusDisplay.handleProgressNotification(params)); | 13 | client.onProgress(WorkDoneProgress.type, 'rustAnalyzer/cargoWatcher', params => statusDisplay.handleProgressNotification(params)); |
12 | }); | 14 | }); |
13 | } | 15 | } |
14 | 16 | ||
@@ -63,20 +65,15 @@ class StatusDisplay implements vscode.Disposable { | |||
63 | this.statusBarItem.dispose(); | 65 | this.statusBarItem.dispose(); |
64 | } | 66 | } |
65 | 67 | ||
66 | handleProgressNotification(params: ProgressParams) { | 68 | handleProgressNotification(params: WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd) { |
67 | const { token, value } = params; | 69 | switch (params.kind) { |
68 | if (token !== 'rustAnalyzer/cargoWatcher') { | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | switch (value.kind) { | ||
73 | case 'begin': | 70 | case 'begin': |
74 | this.show(); | 71 | this.show(); |
75 | break; | 72 | break; |
76 | 73 | ||
77 | case 'report': | 74 | case 'report': |
78 | if (value.message) { | 75 | if (params.message) { |
79 | this.packageName = value.message; | 76 | this.packageName = params.message; |
80 | } | 77 | } |
81 | break; | 78 | break; |
82 | 79 | ||
@@ -90,22 +87,3 @@ class StatusDisplay implements vscode.Disposable { | |||
90 | return spinnerFrames[(this.i = ++this.i % spinnerFrames.length)]; | 87 | return spinnerFrames[(this.i = ++this.i % spinnerFrames.length)]; |
91 | } | 88 | } |
92 | } | 89 | } |
93 | |||
94 | // FIXME: Replace this once vscode-languageclient is updated to LSP 3.15 | ||
95 | interface ProgressParams { | ||
96 | token: string; | ||
97 | value: WorkDoneProgress; | ||
98 | } | ||
99 | |||
100 | enum WorkDoneProgressKind { | ||
101 | Begin = 'begin', | ||
102 | Report = 'report', | ||
103 | End = 'end', | ||
104 | } | ||
105 | |||
106 | interface WorkDoneProgress { | ||
107 | kind: WorkDoneProgressKind; | ||
108 | message?: string; | ||
109 | cancelable?: boolean; | ||
110 | percentage?: string; | ||
111 | } | ||