mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
Partially translate names.md
This commit is contained in:
parent
55ad236ac7
commit
e66b315c94
@ -1,5 +1,9 @@
|
||||
# `names` command
|
||||
|
||||
```ucm
|
||||
scratch/main> builtins.merge lib.builtins
|
||||
```
|
||||
|
||||
Example uses of the `names` command and output
|
||||
|
||||
```unison
|
||||
@ -13,7 +17,7 @@ somewhere.y = 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
.> add
|
||||
scratch/main> add
|
||||
```
|
||||
|
||||
|
||||
@ -21,22 +25,21 @@ somewhere.y = 2
|
||||
|
||||
```ucm
|
||||
-- We can search by suffix and find all definitions named 'x', and each of their aliases respectively.
|
||||
-- But we don't see somewhere.z which is has the same value but is out of our namespace
|
||||
.some> names x
|
||||
scratch/main> names x
|
||||
-- We can search by hash, and see all aliases of that hash
|
||||
.some> names #gjmq673r1v
|
||||
-- If the query is absolute, treat it as a `names.global`
|
||||
.some> names .some.place.x
|
||||
scratch/main> names #gjmq673r1v
|
||||
-- Works with global names too
|
||||
scratch/main> names .some.place.x
|
||||
```
|
||||
|
||||
`names.global` searches from the root, and absolutely qualifies results
|
||||
|
||||
|
||||
```ucm
|
||||
-- We can search by suffix and find all definitions in the codebase named 'x', and each of their aliases respectively.
|
||||
.some> names.global x
|
||||
-- We can search from a different branch and find all names in the codebase named 'x', and each of their aliases respectively.
|
||||
scratch/other> names.global x
|
||||
-- We can search by hash, and see all aliases of that hash in the codebase
|
||||
.some> names.global #gjmq673r1v
|
||||
scratch/other> names.global #gjmq673r1v
|
||||
-- We can search using an absolute name
|
||||
.some> names.global .some.place.x
|
||||
scratch/other> names.global .some.place.x
|
||||
```
|
||||
|
@ -1,5 +1,9 @@
|
||||
# `names` command
|
||||
|
||||
```ucm
|
||||
scratch/main> builtins.merge lib.builtins
|
||||
```
|
||||
|
||||
Example uses of the `names` command and output
|
||||
|
||||
```unison
|
||||
@ -19,9 +23,9 @@ somewhere.y = 2
|
||||
I found and typechecked these definitions in scratch.u. If you
|
||||
do an `add` or `update`, here's how your codebase would
|
||||
change:
|
||||
|
||||
|
||||
⍟ These new definitions are ok to `add`:
|
||||
|
||||
|
||||
some.otherplace.x : ##Nat
|
||||
some.otherplace.y : ##Nat
|
||||
some.place.x : ##Nat
|
||||
@ -30,10 +34,10 @@ somewhere.y = 2
|
||||
|
||||
```
|
||||
```ucm
|
||||
.> add
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
||||
|
||||
some.otherplace.x : ##Nat
|
||||
some.otherplace.y : ##Nat
|
||||
some.place.x : ##Nat
|
||||
@ -51,10 +55,10 @@ somewhere.y = 2
|
||||
Terms
|
||||
Hash: #gjmq673r1v
|
||||
Names: otherplace.y place.x
|
||||
|
||||
|
||||
Hash: #pi25gcdv0o
|
||||
Names: otherplace.x
|
||||
|
||||
|
||||
Tip: Use `names.global` to see more results.
|
||||
|
||||
-- We can search by hash, and see all aliases of that hash
|
||||
@ -63,7 +67,7 @@ somewhere.y = 2
|
||||
Term
|
||||
Hash: #gjmq673r1v
|
||||
Names: otherplace.y place.x
|
||||
|
||||
|
||||
Tip: Use `names.global` to see more results.
|
||||
|
||||
-- If the query is absolute, treat it as a `names.global`
|
||||
@ -72,7 +76,7 @@ somewhere.y = 2
|
||||
Term
|
||||
Hash: #gjmq673r1v
|
||||
Names: .some.otherplace.y .some.place.x .somewhere.z
|
||||
|
||||
|
||||
Tip: Use `names.global` to see more results.
|
||||
|
||||
```
|
||||
@ -86,7 +90,7 @@ somewhere.y = 2
|
||||
Terms
|
||||
Hash: #gjmq673r1v
|
||||
Names: .some.otherplace.y .some.place.x .somewhere.z
|
||||
|
||||
|
||||
Hash: #pi25gcdv0o
|
||||
Names: .some.otherplace.x
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user