mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Fix literal support in token tree to ast item list
This commit is contained in:
parent
be9a44e9ba
commit
1ab78d6056
4 changed files with 45 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
use ra_parser::{TokenSource, TreeSink, ParseError};
|
||||
use ra_syntax::{
|
||||
AstNode, SyntaxNode, TextRange, SyntaxKind, SmolStr, SyntaxTreeBuilder, TreeArc, SyntaxElement,
|
||||
ast, SyntaxKind::*, TextUnit
|
||||
ast, SyntaxKind::*, TextUnit, next_token
|
||||
};
|
||||
|
||||
/// Maps `tt::TokenId` to the relative range of the original token.
|
||||
|
@ -189,7 +189,7 @@ impl TtTokenSource {
|
|||
{
|
||||
let tok = match token {
|
||||
tt::Leaf::Literal(l) => TtToken {
|
||||
kind: SyntaxKind::INT_NUMBER, // FIXME
|
||||
kind: next_token(&l.text).kind,
|
||||
is_joint_to_next: false,
|
||||
text: l.text.clone(),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue