Skip to content

Autocompletion problems inside closures when in rsx! macro #1889

@dylanblokhuis

Description

@dylanblokhuis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    rsxRelated to rsx or the dioxus-rsx cratetweakSmall changes to improve experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions