-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
libexpr: support :doc
for nixpkgs lambdas
#9054
Conversation
}); | ||
} | ||
|
||
\/\*([^*]|\*+[^*/])*\*+\/ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc-comments per rfc145 start with /** */, but this is nice though for testing against nixpkgs.lib
@@ -35,6 +37,8 @@ namespace nix { | |||
SourcePath basePath; | |||
PosTable::Origin origin; | |||
std::optional<ErrorInfo> error; | |||
std::vector<Comment> comments; | |||
std::map<nix::Expr *, Comment> attachedComments; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Comments is a vector, does this mean there can be multiple comments attached to one expr?
We could simplify here because doc-comments are multiline comments only und thus only this is a one-to-one relation
8055ecd
to
dcef056
Compare
dcef056
to
049aaba
Compare
Note: this PR is not ready to merge but I want to let the nix team review this approach. It is attaching expressions in the semantic action to Currently we have many POC impls of NixOS/rfcs#145.
We need to access the buffer if it is needed to check whitespaces, the RFC specified that there are only whitespaces allowed between comments & expression. What is the correct way to do such thing? Footnotes
|
Motivation
This is a proof-of-conecpt PR that implements NixOS/rfcs#145. (lambdas only, but we can easily add more types.)
Currently it can display functions like
lib.isList
,lib.id
Context
Related-to: #5527 #1652
Fixes: #3904
Link: NixOS/rfcs#145
Priorities
Add 👍 to pull requests you find important.