mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00
[red-knot] Reload notebook on file change (#12361)
This commit is contained in:
parent
6e0cbe0f35
commit
79b535587b
3 changed files with 27 additions and 10 deletions
|
@ -21,7 +21,7 @@ pub fn source_text(db: &dyn Db, file: File) -> SourceText {
|
|||
PySourceType::try_from_extension(extension) == Some(PySourceType::Ipynb)
|
||||
}) {
|
||||
// TODO(micha): Proper error handling and emit a diagnostic. Tackle it together with `source_text`.
|
||||
let notebook = db.system().read_to_notebook(path).unwrap_or_else(|error| {
|
||||
let notebook = file.read_to_notebook(db).unwrap_or_else(|error| {
|
||||
tracing::error!("Failed to load notebook: {error}");
|
||||
Notebook::empty()
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue