You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a scratch buffer it is not possible to use :lang or :set-language as it refreshes the language server which assumes that there's a document URL, which results in a panic.
// from Editor::launch_language_server
tokio::spawn(language_server.text_document_did_open(
doc.url().unwrap(),// <--
doc.version(),
doc.text(),
language_id,));
note: It's partially my fault as I haven't checked this when I implemented #1866, but I've come across it today as I was trying to just grab a snippet and highlight it to make sense of it...
Reproduction Steps
I tried this:
hx
type some code to the scratch buffer
:lang rust
I expected this to happen:
Highlight the code and reload the language server.
Instead, this happened:
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', helix-view/src/editor.rs:479:31
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Summary
When using a scratch buffer it is not possible to use
:lang
or:set-language
as it refreshes the language server which assumes that there's a document URL, which results in a panic.note: It's partially my fault as I haven't checked this when I implemented #1866, but I've come across it today as I was trying to just grab a snippet and highlight it to make sense of it...
Reproduction Steps
I tried this:
hx
:lang rust
I expected this to happen:
Highlight the code and reload the language server.
Instead, this happened:
Helix log
No response
Platform
FreeBSD
Terminal Emulator
alacritty
Helix Version
helix 22.05-dev (b03421a)
Edit: originally said "assumes that there's a document id", changed "id" to "URL".
The text was updated successfully, but these errors were encountered: