repl: Improve kernelspec discoverability (#15886)
<img width="862" alt="image" src="https://github.com/user-attachments/assets/ae8c479d-d9f9-4c46-bb1a-be411ab07876"> Release Notes: - Added additional context about available to kernel sessions - Fixed bug in kernelspec launch choosing first available kernel matching the language rather than selected name --------- Co-authored-by: Jason <jason@zed.dev>
This commit is contained in:
parent
a54e16b7ea
commit
6065db174a
3 changed files with 97 additions and 30 deletions
|
@ -37,7 +37,7 @@ pub fn run(editor: WeakView<Editor>, move_down: bool, cx: &mut WindowContext) ->
|
|||
|
||||
let kernel_specification = store.update(cx, |store, cx| {
|
||||
store
|
||||
.kernelspec(&language, cx)
|
||||
.kernelspec(language.code_fence_block_name().as_ref(), cx)
|
||||
.with_context(|| format!("No kernel found for language: {}", language.name()))
|
||||
})?;
|
||||
|
||||
|
@ -114,7 +114,9 @@ pub fn session(editor: WeakView<Editor>, cx: &mut AppContext) -> SessionSupport
|
|||
let Some(language) = get_language(editor, cx) else {
|
||||
return SessionSupport::Unsupported;
|
||||
};
|
||||
let kernelspec = store.update(cx, |store, cx| store.kernelspec(&language, cx));
|
||||
let kernelspec = store.update(cx, |store, cx| {
|
||||
store.kernelspec(language.code_fence_block_name().as_ref(), cx)
|
||||
});
|
||||
|
||||
match kernelspec {
|
||||
Some(kernelspec) => SessionSupport::Inactive(Box::new(kernelspec)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue