You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# foo.ncl
let dir_trees = import "dir_tree.ncl" in
{
my_fhs = {
inputs = {
root = "/tmp",
user = "suimong",
}
} & dir_trees.fhs,
call_site = my_fhs.features.userScopeBin # plus some simple transformation, evaluates to "/tmp/home/suimong/.local/bin"
}
It's possible to model the directory tree in a way that explicitly encodes the schema, e.g. the format of tree -J. However if one only cares about the directory path, then it's really tempting to model it as above, because the kv pairs under the "features" key is manually defined (arguably one of the purpose of doing the whole thing), and it's really nice to have the LSP telling you what's available next after each ".", a nicety that's lost if done the tree -J way.
While I don't think it's possible at the moment, I wonder if it's achievable through extending the symbolic string mechanism, i.e. the record that the symbolic string desugars to includes a new field (e.g. raw_reference) that has the value of the original "string".
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First, apologies for the terrible title. It's hard to precisely summarize something that you have lots of questions about.
What I mean is the following:
would evaluate to a string
"record.a.b"
.Here's the use case. I'm trying to model a directory tree in Nickel, let's say the FHS:
And used like this:
It's possible to model the directory tree in a way that explicitly encodes the schema, e.g. the format of
tree -J
. However if one only cares about the directory path, then it's really tempting to model it as above, because the kv pairs under the "features" key is manually defined (arguably one of the purpose of doing the whole thing), and it's really nice to have the LSP telling you what's available next after each ".", a nicety that's lost if done thetree -J
way.While I don't think it's possible at the moment, I wonder if it's achievable through extending the symbolic string mechanism, i.e. the record that the symbolic string desugars to includes a new field (e.g.
raw_reference
) that has the value of the original "string".Beta Was this translation helpful? Give feedback.
All reactions