Skip to content

Can't analyze properly inside tokio::select! #19857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zongben opened this issue May 24, 2025 · 0 comments
Open

Can't analyze properly inside tokio::select! #19857

zongben opened this issue May 24, 2025 · 0 comments
Labels
C-bug Category: bug

Comments

@zongben
Copy link

zongben commented May 24, 2025

rust-analyzer version: 2025-05-19

rustc version: rustc 1.87.0 (17067e9ac 2025-05-09)

editor or extension: Neovim

relevant settings: all default

repository link (if public, optional): none

code snippet to reproduce:

// different code to the video, but same problem within tokio::select!
use crossterm::{
    event::{self, Event},
    terminal::enable_raw_mode,
};

pub struct KeyEventListener {}

impl KeyEventListener {
    pub fn new() -> Self {
        KeyEventListener {}
    }

    pub async fn run(self) -> anyhow::Result<()> {
        enable_raw_mode()?;
        loop {
            tokio::select! {
                Ok(event) = tokio::task::spawn_blocking(|| event::read()) => {
                    match event {
                        Ok(Event::Key(key_event)) => {
                        }
                        _ => {}
                    }
                }
            }
        }
    }
}

fn main() {}

here is record about wired problem inside tokio::select! I think ?

2025-05-24.13-48-41.mp4
@zongben zongben added the C-bug Category: bug label May 24, 2025
@zongben zongben changed the title Can't not analyze properly inside tokio::select! Can't analyze properly inside tokio::select! May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

1 participant