vscode-scope-bar icon indicating copy to clipboard operation
vscode-scope-bar copied to clipboard

Doesn't work for Rust

Open peter-lyons-kehl opened this issue 2 years ago • 2 comments

Thank you for VSCode Scope Bar.

Most of the time it shows only "Global Scope" for (a large) Rust project. image

I have (current) VS Code with rust-analyzer extension, which is the only mainstream language provider for Rust. (There exists "RLS" = Rust Language Support, which is obsolete and unmaintained.)

rust-analyzer feeds inferred type annotations, breadcrumbs... I don't know if rust-analyzer is registered/good enough with documentSymbolProvider.

peter-lyons-kehl avatar Jan 10 '23 21:01 peter-lyons-kehl

in scope.ts you have to add:

const ScopeSymbolKind = [
...
    SymbolKind.Struct,
    SymbolKind.Object
]

Then, it works great with rust :)

yoavst avatar Sep 28 '23 19:09 yoavst

Wow: When I loaded this extension from the current GIT master (https://github.com/amos402/vscode-scope-bar/commit/1b554919a8bac5489dbe3ae309567bc952705a30) in VS Code with Ctrl+Shift+P and then I choose "Developer: Install extension from location...", it doesn't work at all. It doesn't even show any scope, not even "Global" scope. Regardless of the above two additions to ScopeSymbolKind:

image The above is when I modified the extension locally as per above, and I've changed its version to 0.2.2.

Then I reverted back to current GIT version, but still no scope.

When I run Ctrl+Shift+P and then ShowScopeSymbols, I get this error: image. (Of course, I've restarted VS Code many times though this.) Rust-analyzer is working fine.

When I uninstall the GIT/local version, and I install it from the Marketplace (Xtrl+Shift+X > scope bar), it works pretty well now. Not only "Global" scope, but struct/enum and method/function scopes.

Anyway, for now I may keep using the breadcrumb. You can see the breadcrumb near the top right of my first screenshot (in this comment).

peter-lyons-kehl avatar Sep 29 '23 05:09 peter-lyons-kehl