mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-13 00:17:15 +00:00
Do not reparse token tree when it is not delimited by braces
This commit is contained in:
parent
64d07c1bd4
commit
d0cfeb4f16
2 changed files with 6 additions and 1 deletions
|
@ -149,7 +149,7 @@ fn find_reparsable_node(node: SyntaxNodeRef, range: TextRange) -> Option<(Syntax
|
|||
MATCH_ARM_LIST => grammar::match_arm_list,
|
||||
USE_TREE_LIST => grammar::use_tree_list,
|
||||
EXTERN_ITEM_LIST => grammar::extern_item_list,
|
||||
TOKEN_TREE => grammar::token_tree,
|
||||
TOKEN_TREE if node.first_child().unwrap().kind() == L_CURLY => grammar::token_tree,
|
||||
ITEM_LIST => {
|
||||
let parent = node.parent().unwrap();
|
||||
match parent.kind() {
|
||||
|
|
|
@ -85,6 +85,11 @@ pub enum A {
|
|||
foo!{a, b<|><|> d}
|
||||
", ", c[3]");
|
||||
do_check(r"
|
||||
fn foo() {
|
||||
vec![<|><|>]
|
||||
}
|
||||
", "123");
|
||||
do_check(r"
|
||||
extern {
|
||||
fn<|>;<|>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue