mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Convert code to text-size
This commit is contained in:
parent
27a7718880
commit
b1d5817dd1
75 changed files with 438 additions and 456 deletions
|
@ -2,7 +2,7 @@
|
|||
use crate::db::AstDatabase;
|
||||
use crate::{
|
||||
ast::{self, AstToken, HasStringValue},
|
||||
name, AstId, CrateId, MacroDefId, MacroDefKind, TextUnit,
|
||||
name, AstId, CrateId, MacroDefId, MacroDefKind, TextSize,
|
||||
};
|
||||
|
||||
use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId};
|
||||
|
@ -127,7 +127,7 @@ fn stringify_expand(
|
|||
let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?;
|
||||
let macro_args = arg;
|
||||
let text = macro_args.text();
|
||||
let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')');
|
||||
let without_parens = TextSize::of('(')..text.len() - TextSize::of(')');
|
||||
text.slice(without_parens).to_string()
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue