Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixd/tools/nixd-attrset-eval: support completion for "builtins" #620

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

inclyc
Copy link
Member

@inclyc inclyc commented Nov 19, 2024

Basic support for option completion on the worker process. This is the premise for doing this in LSP.

Link: #507

Basic support for option completion on the worker process.
This is the premise for doing this in LSP.
@inclyc inclyc requested a review from Mic92 November 19, 2024 08:45
@Mic92
Copy link
Member

Mic92 commented Nov 19, 2024

@inclyc did you request my review for something specific or more for a general review?

@inclyc
Copy link
Member Author

inclyc commented Nov 19, 2024

@inclyc did you request my review for something specific or more for a general review?

A specific review for C++ nix IPC:

This pull request introduces the ability to query builtins information. Do you think the methodology is correct, or does it need refinement?

Very appreciated if you can take a look :)

@Mic92
Copy link
Member

Mic92 commented Nov 19, 2024

It looks reasonable to me and similar to what the nix repl does for completing. However I would prefer if @roberth would have a look as well.

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
@@ -70,4 +70,9 @@ selectStringViews(nix::EvalState &State, nix::Value &V,
return selectSymbols(State, V, toSymbols(State.symbols, AttrPath));
}

/// \brief Get nix's `builtins` constant
inline nix::Value &getBuiltins(const nix::EvalState &State) {
return *State.baseEnv.values[0];
Copy link
Member

@Mic92 Mic92 Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do add a TODO now that this could use the proper api in the next nix version.

@inclyc inclyc marked this pull request as draft November 21, 2024 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants