nix-community / vscode-nix-ide

Nix language support for VSCode editor [maintainer: @jnoortheen]
https://marketplace.visualstudio.com/items?itemName=jnoortheen.nix-ide
MIT License
273 stars 20 forks source link

Request textDocument/hover failed (with Nil) #328

Closed MaxDaten closed 1 year ago

MaxDaten commented 1 year ago

On hover on anything in a nix flake file in VSC I receive this error:

image

My Nix IDE settings:

  "nix.enableLanguageServer": true, // Enable LSP.
  "nix.serverPath": "nil", // The path to the LSP server executable.
  "nix.serverSettings": {
    "nil": {
      "formatting": { "command": ["alejandra"] }
    }
  }
$ nil --version
nil 2023-02-03
Output thread 'Worker' panicked at 'no value set for FlakeGraphQuery(())', /private/tmp/nix-build-nil-2023-02-03.drv-0/nil-2023-02-03-vendor.tar.gz/salsa/src/input.rs:106:32 stack backtrace: 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: as salsa::plumbing::QueryStorageOps>::try_fetch 3: ::flake_graph::__shim 4: ::execute 5: salsa::runtime::Runtime::execute_query_implementation 6: salsa::derived::slot::Slot::read_upgrade 7: salsa::derived::slot::Slot::read 8: as salsa::plumbing::QueryStorageOps>::try_fetch 9: ::source_root_flake_info::__shim 10: ::execute 11: salsa::runtime::Runtime::execute_query_implementation 12: salsa::derived::slot::Slot::read_upgrade 13: salsa::derived::slot::Slot::read 14: as salsa::plumbing::QueryStorageOps>::try_fetch 15: ::module_kind::__shim 16: ::execute 17: salsa::runtime::Runtime::execute_query_implementation 18: salsa::derived::slot::Slot::read_upgrade 19: salsa::derived::slot::Slot::read 20: as salsa::plumbing::QueryStorageOps>::try_fetch 21: ::module_expected_ty::__shim 22: ide::ty::infer::infer_query 23: salsa::runtime::Runtime::execute_query_implementation 24: salsa::derived::slot::Slot::read_upgrade 25: salsa::derived::slot::Slot::read 26: as salsa::plumbing::QueryStorageOps>::try_fetch 27: ::infer::__shim 28: ide::ide::hover::hover 29: ide::ide::Analysis::hover 30: nil::handler::hover 31: std::panicking::try 32: core::ops::function::FnOnce::call_once{{vtable.shim}} 33: nil::server::Server::worker note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. 2023-03-04T01:48:39.305034Z ERROR nil::server: Panicked in textDocument/hover: no value set for FlakeGraphQuery(()) Location: /private/tmp/nix-build-nil-2023-02-03.drv-0/nil-2023-02-03-vendor.tar.gz/salsa/src/input.rs:106:32 Backtrace: 0: 0x105243d54 - std::backtrace::Backtrace::create::h21e81d81bdd55ba7 1: 0x10504f670 - nil::server::with_catch_unwind::{{closure}}::{{closure}}::h0106fd83172da2c7 2: 0x10521b988 - std::panicking::rust_panic_with_hook::h4fd621c91a468c7f 3: 0x105221f80 - std::panicking::begin_panic_handler::{{closure}}::he01d096e07de0ad7 4: 0x105221acc - std::sys_common::backtrace::__rust_end_short_backtrace::h9ae8acbb3142fca8 5: 0x10521b4d8 - _rust_begin_unwind 6: 0x10527baf8 - core::panicking::panic_fmt::h57ba5f760604e990 7: 0x10516ab5c - as salsa::plumbing::QueryStorageOps>::try_fetch::h5aced266cb1723fa 8: 0x10513dae4 - ::flake_graph::__shim::h1c745908acf363ba 9: 0x10513dd1c - ::execute::h900db813d7235463 10: 0x10511ad90 - salsa::runtime::Runtime::execute_query_implementation::h4d2cdb3dd9a8f261 11: 0x1050f1f1c - salsa::derived::slot::Slot::read_upgrade::h0e1ee44308bfa9ba 12: 0x10510c22c - salsa::derived::slot::Slot::read::hc4854ee782a42d46 13: 0x105154388 - as salsa::plumbing::QueryStorageOps>::try_fetch::ha43b54a75b6f52d4 14: 0x10513d938 - ::source_root_flake_info::__shim::hcd8eb6024dd49888 15: 0x10513f4e8 - ::execute::hc3ac4c15077acbfb 16: 0x10511ba70 - salsa::runtime::Runtime::execute_query_implementation::hd487263aefc4afa4 17: 0x1050fdb8c - salsa::derived::slot::Slot::read_upgrade::he4053e2a02704a43 18: 0x10510cbe8 - salsa::derived::slot::Slot::read::hdcc73f4f21548ae8 19: 0x1051533c0 - as salsa::plumbing::QueryStorageOps>::try_fetch::h996247433401e59f 20: 0x10513e738 - ::module_kind::__shim::had42e7488ca744ad 21: 0x10517d49c - ::execute::h22ea1b7789e4fe17 22: 0x10511a9a4 - salsa::runtime::Runtime::execute_query_implementation::h375b324eae29cc6d 23: 0x1050f4a90 - salsa::derived::slot::Slot::read_upgrade::h2d4489be5bccd836 24: 0x10510863c - salsa::derived::slot::Slot::read::h16fe165762438542 25: 0x105150b88 - as salsa::plumbing::QueryStorageOps>::try_fetch::h4d7c486d8584cb19 26: 0x10517d300 - ::module_expected_ty::__shim::h3935a77d38110fbd 27: 0x10513a5fc - ide::ty::infer::infer_query::hae5e7fe49551563c 28: 0x10511b138 - salsa::runtime::Runtime::execute_query_implementation::h68ce30569bee21da 29: 0x1050f7724 - salsa::derived::slot::Slot::read_upgrade::h36d29e4de67a7eca 30: 0x105109050 - salsa::derived::slot::Slot::read::h27a7ae1922f542c4 31: 0x105153ba4 - as salsa::plumbing::QueryStorageOps>::try_fetch::h9dd925e35d15b1c1 32: 0x10517d3e4 - ::infer::__shim::h340e15f1b650b184 33: 0x10517a67c - ide::ide::hover::hover::h5e35b300829e66db 34: 0x10516cda4 - ide::ide::Analysis::hover::h6cf21156b2908ef4 35: 0x105072114 - nil::handler::hover::h81cec957d584c3fe 36: 0x1050540a8 - std::panicking::try::h1812a2daeacfc2e8 37: 0x10503f5e8 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4e17771df77439b5 38: 0x105048070 - nil::server::Server::worker::hafad0785ea22951b 39: 0x105029288 - std::sys_common::backtrace::__rust_begin_short_backtrace::h37336cd76b47ad2f 40: 0x105055f44 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h05197e50149f44d6 41: 0x105232358 - std::sys::unix::thread::Thread::new::thread_start::hb3139456ed8bbfa5 42: 0x195b3606c - __pthread_deallocate [Error - 02:48:39] Request textDocument/hover failed. Message: Panicked in textDocument/hover: no value set for FlakeGraphQuery(()) Location: /private/tmp/nix-build-nil-2023-02-03.drv-0/nil-2023-02-03-vendor.tar.gz/salsa/src/input.rs:106:32 Backtrace: 0: 0x105243d54 - std::backtrace::Backtrace::create::h21e81d81bdd55ba7 1: 0x10504f670 - nil::server::with_catch_unwind::{{closure}}::{{closure}}::h0106fd83172da2c7 2: 0x10521b988 - std::panicking::rust_panic_with_hook::h4fd621c91a468c7f 3: 0x105221f80 - std::panicking::begin_panic_handler::{{closure}}::he01d096e07de0ad7 4: 0x105221acc - std::sys_common::backtrace::__rust_end_short_backtrace::h9ae8acbb3142fca8 5: 0x10521b4d8 - _rust_begin_unwind 6: 0x10527baf8 - core::panicking::panic_fmt::h57ba5f760604e990 7: 0x10516ab5c - as salsa::plumbing::QueryStorageOps>::try_fetch::h5aced266cb1723fa 8: 0x10513dae4 - ::flake_graph::__shim::h1c745908acf363ba 9: 0x10513dd1c - ::execute::h900db813d7235463 10: 0x10511ad90 - salsa::runtime::Runtime::execute_query_implementation::h4d2cdb3dd9a8f261 11: 0x1050f1f1c - salsa::derived::slot::Slot::read_upgrade::h0e1ee44308bfa9ba 12: 0x10510c22c - salsa::derived::slot::Slot::read::hc4854ee782a42d46 13: 0x105154388 - as salsa::plumbing::QueryStorageOps>::try_fetch::ha43b54a75b6f52d4 14: 0x10513d938 - ::source_root_flake_info::__shim::hcd8eb6024dd49888 15: 0x10513f4e8 - ::execute::hc3ac4c15077acbfb 16: 0x10511ba70 - salsa::runtime::Runtime::execute_query_implementation::hd487263aefc4afa4 17: 0x1050fdb8c - salsa::derived::slot::Slot::read_upgrade::he4053e2a02704a43 18: 0x10510cbe8 - salsa::derived::slot::Slot::read::hdcc73f4f21548ae8 19: 0x1051533c0 - as salsa::plumbing::QueryStorageOps>::try_fetch::h996247433401e59f 20: 0x10513e738 - ::module_kind::__shim::had42e7488ca744ad 21: 0x10517d49c - ::execute::h22ea1b7789e4fe17 22: 0x10511a9a4 - salsa::runtime::Runtime::execute_query_implementation::h375b324eae29cc6d 23: 0x1050f4a90 - salsa::derived::slot::Slot::read_upgrade::h2d4489be5bccd836 24: 0x10510863c - salsa::derived::slot::Slot::read::h16fe165762438542 25: 0x105150b88 - as salsa::plumbing::QueryStorageOps>::try_fetch::h4d7c486d8584cb19 26: 0x10517d300 - ::module_expected_ty::__shim::h3935a77d38110fbd 27: 0x10513a5fc - ide::ty::infer::infer_query::hae5e7fe49551563c 28: 0x10511b138 - salsa::runtime::Runtime::execute_query_implementation::h68ce30569bee21da 29: 0x1050f7724 - salsa::derived::slot::Slot::read_upgrade::h36d29e4de67a7eca 30: 0x105109050 - salsa::derived::slot::Slot::read::h27a7ae1922f542c4 31: 0x105153ba4 - as salsa::plumbing::QueryStorageOps>::try_fetch::h9dd925e35d15b1c1 32: 0x10517d3e4 - ::infer::__shim::h340e15f1b650b184 33: 0x10517a67c - ide::ide::hover::hover::h5e35b300829e66db 34: 0x10516cda4 - ide::ide::Analysis::hover::h6cf21156b2908ef4 35: 0x105072114 - nil::handler::hover::h81cec957d584c3fe 36: 0x1050540a8 - std::panicking::try::h1812a2daeacfc2e8 37: 0x10503f5e8 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4e17771df77439b5 38: 0x105048070 - nil::server::Server::worker::hafad0785ea22951b 39: 0x105029288 - std::sys_common::backtrace::__rust_begin_short_backtrace::h37336cd76b47ad2f 40: 0x105055f44 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h05197e50149f44d6 41: 0x105232358 - std::sys::unix::thread::Thread::new::thread_start::hb3139456ed8bbfa5 42: 0x195b3606c - __pthread_deallocate Code: -32603
MaxDaten commented 1 year ago

Okay fixed it by using the main of nil, missed the error on project load:

"failed to resolve flake inputs from lock file"

Related: https://github.com/oxalica/nil/issues/56