diff --git a/libnixt/include/nixt/Value.h b/libnixt/include/nixt/Value.h index 5e5ec02b2..bbcc58893 100644 --- a/libnixt/include/nixt/Value.h +++ b/libnixt/include/nixt/Value.h @@ -42,12 +42,12 @@ nix::Value &selectAttrPath(nix::EvalState &State, nix::Value &V, std::vector::const_iterator End); /// \brief Select the option declaration list, \p V, dive into "submodules". -nix::Value &selectOptions(nix::EvalState &State, nix::Value &V, - std::vector::const_iterator Begin, - std::vector::const_iterator End); +nix::Value selectOptions(nix::EvalState &State, nix::Value &V, + std::vector::const_iterator Begin, + std::vector::const_iterator End); -inline nix::Value &selectOptions(nix::EvalState &State, nix::Value &V, - const std::vector &AttrPath) { +inline nix::Value selectOptions(nix::EvalState &State, nix::Value &V, + const std::vector &AttrPath) { return selectOptions(State, V, AttrPath.begin(), AttrPath.end()); } diff --git a/libnixt/lib/Value.cpp b/libnixt/lib/Value.cpp index b776507a5..2c3de3934 100644 --- a/libnixt/lib/Value.cpp +++ b/libnixt/lib/Value.cpp @@ -110,9 +110,9 @@ nix::Value &nixt::selectAttrPath(nix::EvalState &State, nix::Value &V, return selectAttrPath(State, Nested, ++Begin, End); } -nix::Value &nixt::selectOptions(nix::EvalState &State, nix::Value &V, - std::vector::const_iterator Begin, - std::vector::const_iterator End) { +nix::Value nixt::selectOptions(nix::EvalState &State, nix::Value &V, + std::vector::const_iterator Begin, + std::vector::const_iterator End) { if (Begin == End) return V; diff --git a/nixd/lib/Eval/AttrSetProvider.cpp b/nixd/lib/Eval/AttrSetProvider.cpp index 2397c6f1d..9ae8cd635 100644 --- a/nixd/lib/Eval/AttrSetProvider.cpp +++ b/nixd/lib/Eval/AttrSetProvider.cpp @@ -232,7 +232,7 @@ void AttrSetProvider::onOptionInfo( return; } - nix::Value &Option = nixt::selectOptions( + nix::Value Option = nixt::selectOptions( state(), Nixpkgs, nixt::toSymbols(state().symbols, AttrPath)); OptionInfoResponse R; @@ -254,7 +254,7 @@ void AttrSetProvider::onOptionComplete( const AttrPathCompleteParams &Params, lspserver::Callback Reply) { try { - nix::Value &Scope = nixt::selectOptions( + nix::Value Scope = nixt::selectOptions( state(), Nixpkgs, nixt::toSymbols(state().symbols, Params.Scope)); state().forceValue(Scope, nix::noPos);