mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +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
|
@ -1,6 +1,6 @@
|
|||
use ra_syntax::{
|
||||
ast::{self, AstNode},
|
||||
SyntaxKind, SyntaxNode, TextUnit,
|
||||
SyntaxKind, SyntaxNode, TextSize,
|
||||
};
|
||||
|
||||
use crate::{Assist, AssistCtx, AssistFile, AssistId};
|
||||
|
@ -69,8 +69,8 @@ pub(crate) fn add_function(ctx: AssistCtx) -> Option<Assist> {
|
|||
}
|
||||
|
||||
struct FunctionTemplate {
|
||||
insert_offset: TextUnit,
|
||||
cursor_offset: TextUnit,
|
||||
insert_offset: TextSize,
|
||||
cursor_offset: TextSize,
|
||||
fn_def: ast::SourceFile,
|
||||
file: AssistFile,
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ impl FunctionBuilder {
|
|||
let fn_def = indent_once.increase_indent(fn_def);
|
||||
let fn_def = ast::make::add_trailing_newlines(1, fn_def);
|
||||
let fn_def = indent.increase_indent(fn_def);
|
||||
(fn_def, it.syntax().text_range().start() + TextUnit::from_usize(1))
|
||||
(fn_def, it.syntax().text_range().start() + TextSize::from_usize(1))
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue