Skip to content

Commit 533f178

Browse files
committed
minor: Access parser internals through ide_db for ide crates
1 parent a7d440e commit 533f178

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ide_assists/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ itertools = "0.10.0"
1616
either = "1.6.1"
1717

1818
stdx = { path = "../stdx", version = "0.0.0" }
19-
parser = { path = "../parser", version = "0.0.0" }
2019
syntax = { path = "../syntax", version = "0.0.0" }
2120
text_edit = { path = "../text_edit", version = "0.0.0" }
2221
profile = { path = "../profile", version = "0.0.0" }

crates/ide_assists/src/handlers/extract_module.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use ide_db::{
77
defs::{Definition, NameClass, NameRefClass},
88
search::{FileReference, SearchScope},
99
};
10-
use parser::SyntaxKind::WHITESPACE;
1110
use stdx::format_to;
1211
use syntax::{
1312
algo::find_node_at_range,
@@ -16,7 +15,9 @@ use syntax::{
1615
edit::{AstNodeEdit, IndentLevel},
1716
make, HasName, HasVisibility,
1817
},
19-
match_ast, ted, AstNode, SourceFile, SyntaxNode, TextRange,
18+
match_ast, ted, AstNode, SourceFile,
19+
SyntaxKind::WHITESPACE,
20+
SyntaxNode, TextRange,
2021
};
2122

2223
use crate::{AssistContext, Assists};

crates/ide_assists/src/utils/suggest_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn normalize(name: &str) -> Option<String> {
135135
}
136136

137137
fn is_valid_name(name: &str) -> bool {
138-
match parser::LexedStr::single_token(name) {
138+
match ide_db::syntax_helpers::LexedStr::single_token(name) {
139139
Some((syntax::SyntaxKind::IDENT, _error)) => true,
140140
_ => false,
141141
}

crates/ide_db/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub mod syntax_helpers {
3535
pub mod node_ext;
3636
pub mod insert_whitespace_into_node;
3737
pub mod format_string;
38+
39+
pub use parser::LexedStr;
3840
}
3941

4042
use std::{fmt, mem::ManuallyDrop, sync::Arc};

0 commit comments

Comments
 (0)