Skip to content
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

'Decorations' empty #30

Open
CHr15W3 opened this issue Feb 16, 2025 · 4 comments
Open

'Decorations' empty #30

CHr15W3 opened this issue Feb 16, 2025 · 4 comments

Comments

@CHr15W3
Copy link

CHr15W3 commented Feb 16, 2025

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!

@cordx56
Copy link
Owner

cordx56 commented Feb 16, 2025

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.

@mrcjkb
Copy link

mrcjkb commented Feb 24, 2025

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.

@cordx56
Copy link
Owner

cordx56 commented Feb 24, 2025

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

@mrcjkb
Copy link

mrcjkb commented Feb 25, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants