mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Rename File -> SourceFileNode
This commit is contained in:
parent
2119fe2143
commit
f8b36bbc3b
23 changed files with 117 additions and 102 deletions
|
@ -5,7 +5,7 @@ use arrayvec::ArrayString;
|
|||
use crate::{
|
||||
algo::visit::{visitor_ctx, VisitorCtx},
|
||||
ast::{self, AstNode},
|
||||
File,
|
||||
SourceFileNode,
|
||||
string_lexing::{self, CharComponentKind},
|
||||
yellow::{
|
||||
SyntaxError,
|
||||
|
@ -13,7 +13,7 @@ use crate::{
|
|||
},
|
||||
};
|
||||
|
||||
pub(crate) fn validate(file: &File) -> Vec<SyntaxError> {
|
||||
pub(crate) fn validate(file: &SourceFileNode) -> Vec<SyntaxError> {
|
||||
let mut errors = Vec::new();
|
||||
for node in file.syntax().descendants() {
|
||||
let _ = visitor_ctx(&mut errors)
|
||||
|
@ -155,11 +155,11 @@ fn is_ascii_escape(code: char) -> bool {
|
|||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::File;
|
||||
use crate::SourceFileNode;
|
||||
|
||||
fn build_file(literal: &str) -> File {
|
||||
fn build_file(literal: &str) -> SourceFileNode {
|
||||
let src = format!("const C: char = '{}';", literal);
|
||||
File::parse(&src)
|
||||
SourceFileNode::parse(&src)
|
||||
}
|
||||
|
||||
fn assert_valid_char(literal: &str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue