mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +00:00
Merge #11671
11671: minor: Access parser internals through ide_db for ide crates r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
356c507357
5 changed files with 6 additions and 5 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -632,7 +632,6 @@ dependencies = [
|
|||
"hir",
|
||||
"ide_db",
|
||||
"itertools",
|
||||
"parser",
|
||||
"profile",
|
||||
"rustc-hash",
|
||||
"sourcegen",
|
||||
|
|
|
@ -16,7 +16,6 @@ itertools = "0.10.0"
|
|||
either = "1.6.1"
|
||||
|
||||
stdx = { path = "../stdx", version = "0.0.0" }
|
||||
parser = { path = "../parser", version = "0.0.0" }
|
||||
syntax = { path = "../syntax", version = "0.0.0" }
|
||||
text_edit = { path = "../text_edit", version = "0.0.0" }
|
||||
profile = { path = "../profile", version = "0.0.0" }
|
||||
|
|
|
@ -7,7 +7,6 @@ use ide_db::{
|
|||
defs::{Definition, NameClass, NameRefClass},
|
||||
search::{FileReference, SearchScope},
|
||||
};
|
||||
use parser::SyntaxKind::WHITESPACE;
|
||||
use stdx::format_to;
|
||||
use syntax::{
|
||||
algo::find_node_at_range,
|
||||
|
@ -16,7 +15,9 @@ use syntax::{
|
|||
edit::{AstNodeEdit, IndentLevel},
|
||||
make, HasName, HasVisibility,
|
||||
},
|
||||
match_ast, ted, AstNode, SourceFile, SyntaxNode, TextRange,
|
||||
match_ast, ted, AstNode, SourceFile,
|
||||
SyntaxKind::WHITESPACE,
|
||||
SyntaxNode, TextRange,
|
||||
};
|
||||
|
||||
use crate::{AssistContext, Assists};
|
||||
|
|
|
@ -135,7 +135,7 @@ fn normalize(name: &str) -> Option<String> {
|
|||
}
|
||||
|
||||
fn is_valid_name(name: &str) -> bool {
|
||||
match parser::LexedStr::single_token(name) {
|
||||
match ide_db::syntax_helpers::LexedStr::single_token(name) {
|
||||
Some((syntax::SyntaxKind::IDENT, _error)) => true,
|
||||
_ => false,
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ pub mod syntax_helpers {
|
|||
pub mod node_ext;
|
||||
pub mod insert_whitespace_into_node;
|
||||
pub mod format_string;
|
||||
|
||||
pub use parser::LexedStr;
|
||||
}
|
||||
|
||||
use std::{fmt, mem::ManuallyDrop, sync::Arc};
|
||||
|
|
Loading…
Reference in a new issue