nova-rust icon indicating copy to clipboard operation
nova-rust copied to clipboard

Show suggestions from out of scope

Open laralove143 opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. When using an out-of-scope items, we have to type it out, press cmd+shift+a, select the item we want to import and then continue coding. This comes up very frequently that other IDEs have added features for this.

Describe the solution you'd like Items out-of-scope (from std and added crates) are shown in the completions, upon selection they are imported.

laralove143 avatar Apr 10 '23 20:04 laralove143

Unfortunately, this isn't supported yet by Nova 😔 I asked for this LSP feature to be added a year ago, but have not heard of any plans to add it. I might bump that request again.

kilbd avatar Apr 11 '23 13:04 kilbd

It'd be awesome if everyone reading this could bump (Add heart reaction to or reply to) the feature request to Nova @kilbd made! We need this feature, come on Rustaceans!!!!

laralove143 avatar Apr 13 '23 15:04 laralove143

Screenshot 2023-04-16 at 5 07 07 AM

this is how the typescript extension does it, i haven't gotten to testing it yet but it's a possible approach

laralove143 avatar Apr 16 '23 02:04 laralove143

I haven't found yet where this functionality is implemented, but I assume it's helped by the fact that extensions are written in JavaScript and can potentially load in modules and inspect their exports. To implement something similar in Rust I'd need to roll my own Rust parser, which is too much of a commitment and unlikely to be done well.

I also noticed that the TypeScript extension's solution has issues.

The real solution for this and other language extensions is for Nova to continue improving its LSP support. That, or relax its grip on LSP messages, and possibly let extension developers opt into handling some of the messages.

kilbd avatar Apr 21 '23 01:04 kilbd