Conversation
|
I am also in favor or just returning the content without Rendering it. Maybe as a function on the C-abi. |
libnixt/include/nixt/Value.h
Outdated
|
|
||
| /// TODO: use https://github.com/NixOS/nix/pull/11914 on nix version bump | ||
| /// \brief Get nix's `builtins` constant | ||
| inline nix::Value &getBuiltins(const nix::EvalState &State) { |
There was a problem hiding this comment.
maybe remove, not used in this PR
| constexpr inline std::string_view AttrPathComplete = "attrset/attrpathComplete"; | ||
| constexpr inline std::string_view OptionInfo = "attrset/optionInfo"; | ||
| constexpr inline std::string_view OptionComplete = "attrset/optionComplete"; | ||
|
|
nixd/lib/Eval/AttrSetProvider.cpp
Outdated
|
|
||
| std::optional<ValueDescription> describeValue(nix::EvalState &State, | ||
| nix::Value &V) { | ||
| const auto Doc = State.getDoc(V); |
There was a problem hiding this comment.
nix::EvalState::getDoc() is invoked here
| } | ||
|
|
||
| static std::string mkValueMarkdown(const ValueDescription &ValueDesc) { | ||
| return ValueDesc.Doc; |
There was a problem hiding this comment.
here, the documentation is replied directly without any formatting/tokenization.
|
kindly ping @roberth, can we have a structured helper function exposed from nix-expr? |
|
Hey @inclyc, sorry for the delay. Happy to help if I can, but it's not quite clear to me what needs to be done in nix-expr. |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
ed5029e to
6707401
Compare
This PR introduces
nix-repl's:doccommand to nixd.Since NixOS/nix#11072, we can utilize the API exposed by
nix::EvalState::getDoc. (i.e. to provide hover/completions(todo) from nixpkgs's doc comments).Current status:
:doccommand innix-replAlso CC @roberth (author of nix implementation), @hsjobeki (author of doc-comments RFC). How can we co-operate to make these stuff more fancy? (It looks very ugly so far, 😆 )
I see there are some information for "definition" here, generally this information is separated from "hover-ed documentation" in LSP, can we have a new API to get a structured output?