kilbd / nova-rust

A Rust extension for the Nova text editor, using the Rust Analyzer language server.
MIT License
29 stars 5 forks source link

Fix null method call blocking install #36

Closed nlydv closed 1 year ago

nlydv commented 1 year ago

Just updated to check out the latest update, but I immediately ran into a wall on clean install:

Screen Shot 2022-10-17 at 12 37 49 AM

Added a single ?, reload, and...

Screen Shot 2022-10-17 at 12 39 38 AM

good to go!

Something, something, rewrite it in Rust 🦀

Also, I've been using a barebones, unpublished fork of this extension for sometime which finds and uses a rustup installed RA component in either nightly or stable (now that it's available on stable) according to whichever toolchain I use on a per-project basis. Would be happy to put together another PR if you're interested in adding something along those lines.

kilbd commented 1 year ago

Thanks for bringing up this issue! I made the poor assumption that the 'empty' value for a string array preference would be an empty array, but it looks like it's null instead. I obviously neglected to test the case of no preferences.

I'm going to accept this PR, but I'll likely also try to fix the issue before it gets to this function – either where this function is called or where the preference is resolved. Thanks!

kilbd commented 1 year ago

About the other PR you have in mind, I'd appreciate hearing more about what you want to do. Feel free to open an issue for some discussion. My initial reaction is that I prefer to be hands-off with users' Rust installations, but I'm open to strong use cases.

nlydv commented 1 year ago

I made the poor assumption that the 'empty' value for a string array preference would be an empty array, but it looks like it's null instead.

Yeah for sure, if the error trace didn't say it was null I probably wouldn't have thought that string[] could be nullish.

nlydv commented 1 year ago

I'll definitely get around to opening an issue before a PR for that feature. I assume there'd be a non-trivial amount of refactoring needed for something like that anyways.