mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
repl: do not crash when tab-completing import errors
File not found while importing is not currently caught by the tab-completion handler. Original bug report: https://git.lix.systems/lix-project/lix/issues/340 Fix has been adapted from https://gerrit.lix.systems/c/lix/+/1189 Example crash: $ cat /tmp/foo.nix { someImport = import ./this_file_does_not_exist; } $ ./src/nix/nix repl --file /tmp/foo.nix warning: unknown experimental feature 'repl-flake' Nix 2.23.0pre20240517_dirty Type :? for help. Loading installable ''... Added 1 variables. nix-repl> someImport.<TAB>
This commit is contained in:
parent
f97da4b11c
commit
ffe6ba69d6
1 changed files with 2 additions and 0 deletions
|
@ -304,6 +304,8 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
|
||||||
// Quietly ignore evaluation errors.
|
// Quietly ignore evaluation errors.
|
||||||
} catch (BadURL & e) {
|
} catch (BadURL & e) {
|
||||||
// Quietly ignore BadURL flake-related errors.
|
// Quietly ignore BadURL flake-related errors.
|
||||||
|
} catch (FileNotFound & e) {
|
||||||
|
// Quietly ignore non-existent file beeing `import`-ed.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue