polarmutex/beancount-language-server

Unhelpful `unwrap()` errors

bspeice opened this issue · 0 comments

I've been attempting to use this as part of a Neovim/Mason setup, but some uses of unwrap() without any context. First, it seems to be that this server attempts to use bean-check:

After reading through the code here, I realized that I hadn't actually installed beancount.

In addition, there's an unwrap() that appears to be hitting an error condition, but I can't figure out what URL is being referred to:

[ERROR][2023-11-21 11:42:30] .../vim/lsp/rpc.lua:734	"rpc"	"C:\\Users\\%USER%\\AppData\\Roaming\\nvim-data\\mason\\bin\\beancount-language-server.CMD"	"stderr"	"thread '<unnamed>' panicked at C:\\Users\\%USER%\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\beancount-language-server-1.3.1\\src\\providers\\diagnostics.rs:62:73:\ncalled `Result::unwrap()` on an `Err` value: ()\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n"

let file_url = lsp_types::Url::from_file_path(&caps[1]).unwrap();

It's not necessarily that panicking is the problem, but I have no idea what URL is problematic or what I can do to resolve this.