Skip to content

Commit 8f76e41

Browse files
committed
Enable attribte macros in ide fixtures
1 parent bb946f7 commit 8f76e41

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/ide/src/fixture.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::{Analysis, AnalysisHost, FileId, FilePosition, FileRange};
99
pub(crate) fn file(ra_fixture: &str) -> (Analysis, FileId) {
1010
let mut host = AnalysisHost::default();
1111
let change_fixture = ChangeFixture::parse(ra_fixture);
12+
host.db.set_enable_proc_attr_macros(true);
1213
host.db.apply_change(change_fixture.change);
1314
(host.analysis(), change_fixture.files[0])
1415
}
@@ -17,6 +18,7 @@ pub(crate) fn file(ra_fixture: &str) -> (Analysis, FileId) {
1718
pub(crate) fn position(ra_fixture: &str) -> (Analysis, FilePosition) {
1819
let mut host = AnalysisHost::default();
1920
let change_fixture = ChangeFixture::parse(ra_fixture);
21+
host.db.set_enable_proc_attr_macros(true);
2022
host.db.apply_change(change_fixture.change);
2123
let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)");
2224
let offset = range_or_offset.expect_offset();
@@ -27,6 +29,7 @@ pub(crate) fn position(ra_fixture: &str) -> (Analysis, FilePosition) {
2729
pub(crate) fn range(ra_fixture: &str) -> (Analysis, FileRange) {
2830
let mut host = AnalysisHost::default();
2931
let change_fixture = ChangeFixture::parse(ra_fixture);
32+
host.db.set_enable_proc_attr_macros(true);
3033
host.db.apply_change(change_fixture.change);
3134
let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)");
3235
let range = range_or_offset.expect_range();
@@ -37,6 +40,7 @@ pub(crate) fn range(ra_fixture: &str) -> (Analysis, FileRange) {
3740
pub(crate) fn range_or_position(ra_fixture: &str) -> (Analysis, FileId, RangeOrOffset) {
3841
let mut host = AnalysisHost::default();
3942
let change_fixture = ChangeFixture::parse(ra_fixture);
43+
host.db.set_enable_proc_attr_macros(true);
4044
host.db.apply_change(change_fixture.change);
4145
let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)");
4246
(host.analysis(), file_id, range_or_offset)
@@ -45,8 +49,8 @@ pub(crate) fn range_or_position(ra_fixture: &str) -> (Analysis, FileId, RangeOrO
4549
/// Creates analysis from a multi-file fixture, returns positions marked with $0.
4650
pub(crate) fn annotations(ra_fixture: &str) -> (Analysis, FilePosition, Vec<(FileRange, String)>) {
4751
let mut host = AnalysisHost::default();
48-
host.db.set_enable_proc_attr_macros(true);
4952
let change_fixture = ChangeFixture::parse(ra_fixture);
53+
host.db.set_enable_proc_attr_macros(true);
5054
host.db.apply_change(change_fixture.change);
5155
let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)");
5256
let offset = range_or_offset.expect_offset();

0 commit comments

Comments
 (0)