dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Autocompletion problems inside closures when in rsx! macro

Open dylanblokhuis opened this issue 1 year ago • 0 comments

Problem

Whenever you want to add an event handler, you would often assign them inline like this:

fn app(cx: Scope) -> Element {
    render! {
        button { 
            onclick: move |_| {
               // ... code here
            },
        }
    }
}

rust-analyzer works fine to add autocompletion for a variable or function, but whenever you want to dig deeper into a struct or method, the autocompletion stops working.

Example of the autocompletion working for just a function:

image

Example of the autocompletion not working when trying to find methods:

image

This doesn't seem to be an issue with rust-analyzer itself, since Leptos doesn't have this issue:

image

Steps To Reproduce

Steps to reproduce the behavior:

  • Download Rust-Analyzer for VSCode
  • Setup a dioxus project using the latest git version
  • Try the first code snippet and see if the autocompletion does work

Expected behavior

The autocompletion to work on methods and properties of structs

Environment:

  • Dioxus version: master
  • Rust version: 1.77.0-nightly
  • OS info: macOS

dylanblokhuis avatar Feb 01 '24 15:02 dylanblokhuis