2022-08-17 00:01:46 +03:00
|
|
|
# Tab Completion
|
|
|
|
|
|
|
|
Test that tab completion works as expected.
|
|
|
|
|
|
|
|
## Tab Complete Command Names
|
|
|
|
|
|
|
|
```ucm
|
|
|
|
.> debug.tab-complete vi
|
|
|
|
.> debug.tab-complete delete.
|
|
|
|
```
|
|
|
|
|
|
|
|
## Tab complete terms & types
|
|
|
|
|
|
|
|
```unison
|
|
|
|
subnamespace.someName = 1
|
|
|
|
subnamespace.someOtherName = 2
|
2022-09-10 18:53:05 +03:00
|
|
|
subnamespace2.thing = 3
|
|
|
|
othernamespace.someName = 4
|
2022-08-17 00:01:46 +03:00
|
|
|
|
|
|
|
unique type subnamespace.AType = A | B
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm:hide
|
|
|
|
.> add
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
|
|
|
-- Should tab complete namespaces since they may contain terms/types
|
|
|
|
.> debug.tab-complete view sub
|
2022-09-10 18:53:05 +03:00
|
|
|
-- Should not complete things from child namespaces of the current query if there are other completions at this level
|
2022-08-17 00:01:46 +03:00
|
|
|
.> debug.tab-complete view subnamespace
|
2022-09-10 18:53:05 +03:00
|
|
|
-- Should complete things from child namespaces of the current query if it's dot-suffixed
|
2022-08-17 00:01:46 +03:00
|
|
|
.> debug.tab-complete view subnamespace.
|
2022-09-10 18:53:05 +03:00
|
|
|
-- Should complete things from child namespaces of the current query if there are no more completions at this level.
|
|
|
|
.> debug.tab-complete view subnamespace2
|
2022-08-17 00:01:46 +03:00
|
|
|
-- Should prefix-filter by query suffix
|
|
|
|
.> debug.tab-complete view subnamespace.some
|
|
|
|
.> debug.tab-complete view subnamespace.someOther
|
|
|
|
-- Should tab complete absolute names
|
|
|
|
.othernamespace> debug.tab-complete view .subnamespace.some
|
|
|
|
```
|
|
|
|
|
|
|
|
## Tab complete namespaces
|
|
|
|
|
|
|
|
```ucm
|
|
|
|
-- Should tab complete namespaces
|
|
|
|
.> debug.tab-complete cd sub
|
|
|
|
.> debug.tab-complete cd subnamespace
|
|
|
|
.> debug.tab-complete cd subnamespace.
|
2022-09-15 17:56:14 +03:00
|
|
|
.> debug.tab-complete io.test sub
|
|
|
|
.> debug.tab-complete io.test subnamespace
|
|
|
|
.> debug.tab-complete io.test subnamespace.
|
2022-08-17 00:01:46 +03:00
|
|
|
```
|
2023-10-09 22:59:01 +03:00
|
|
|
|
|
|
|
Tab Complete Delete Subcommands
|
|
|
|
|
|
|
|
```unison
|
|
|
|
unique type Foo = A | B
|
|
|
|
add : a -> a
|
|
|
|
add b = b
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2023-11-08 19:54:50 +03:00
|
|
|
.> update.old
|
2023-10-09 22:59:01 +03:00
|
|
|
.> debug.tab-complete delete.type Foo
|
2023-10-09 23:04:55 +03:00
|
|
|
.> debug.tab-complete delete.term add
|
2023-10-09 22:59:01 +03:00
|
|
|
```
|