cordx56/rustowl

'Decorations' empty

Closed this issue · 5 comments

Hi,

I've tried setting up this plugin in neovim using lazy and the install script. As far as I can tell the setup/request works, however, the response to request never contains any decorations. Concretely, when I print the result variable in response handler it contains the following:

{
  decorations = {},
  is_analyzed = true,
  path = "/home/chriswe/.local/share/nvim/lazy/rustowl/example/all.rs"
}

regardless of which token I hover over.

This was with an "empty" rust project (create with cargo new)
Is there any additional setup required?

Thanks you and best!

Thanks for your comment!

This may happen if the target file is not part of a workspace created by Cargo. In your log, it refers to a single source file, so it cannot visualize properly, meaning it may not work.

Additionally, if there are any syntax or type errors, the result will be the same.

I'm having the same issue (with the v0.1.4 release).
The path refers to a single source file, but :lua =vim.lsp.get_clients({ name = "rustowl" })[1] shows the correct workspece_folders, indicating that the cargo workspace has been detected correctly.

Various causes are possible, but the following are common:

  • The .rs file is not included in the workspace
  • RustOwl cannot visualize when there are syntax or type errors

It's the main.rs created by cargo init and the content is the example in the readme:

fn main() {
    let s = string::from("s");
    let mut r = &s;
    if s == "a" {
        let s2 = string::from("a");
        r = &mut s2;
    }
    println!("{r}");
}

Are there any other reasons?
Could it be because my test project isn't using the same toolchain as the one that was used to build rustowl?

🤖 Bot: Issue has not seen activity in 30 days and will therefore be marked as stale. It will be closed in 7 days if no further response is found.