Re-implement rust string highlighting via tool attribute

This commit is contained in:
Lukas Wirth 2025-01-10 13:49:35 +01:00
parent 897f7e579e
commit bf669dab84
72 changed files with 386 additions and 173 deletions

View file

@ -692,7 +692,9 @@ mod tests {
use crate::RootDatabase;
/// Creates analysis from a multi-file fixture, returns positions marked with $0.
pub(crate) fn position(ra_fixture: &str) -> (RootDatabase, FilePosition) {
pub(crate) fn position(
#[rust_analyzer::rust_fixture] ra_fixture: &str,
) -> (RootDatabase, FilePosition) {
let change_fixture = ChangeFixture::parse(ra_fixture);
let mut database = RootDatabase::default();
database.apply_change(change_fixture.change);
@ -703,7 +705,7 @@ mod tests {
}
#[track_caller]
fn check(ra_fixture: &str, expect: Expect) {
fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect) {
let fixture = format!(
r#"
//- minicore: sized, fn