Skip to content

Commit c93eee0

Browse files
committed
Allows custom plugins to pop in completion with standalone projects
1 parent 292e080 commit c93eee0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/internal/complete

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ [email protected]_top_level_commands() {
66
[email protected]_builtin 'commands'
77
else
88
printf 'help\n'
9-
[email protected]_builtin 'commands' "$_GO_SCRIPTS_DIR"
9+
10+
local plugins_paths
11+
printf -v plugins_paths '%s:' "${_GO_PLUGINS_PATHS[@]}"
12+
scripts_paths="${plugins_paths%:}"
13+
[email protected]_builtin 'commands' "$_GO_SCRIPTS_DIR:$plugins_paths"
1014
fi
1115
}
1216

tests/complete.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ teardown() {
4545
assert_failure ''
4646
}
4747

48-
@test "$SUITE: _GO_STANDALONE only completes 'help' and project scripts" {
48+
@test "$SUITE: _GO_STANDALONE only completes 'help' and custom scripts/plugins" {
4949
@go.create_test_command_script 'foo'
5050
@go.create_test_command_script 'bar'
5151
@go.create_test_command_script 'plugins/baz/bin/baz'
5252

5353
_GO_STANDALONE='true' run "$TEST_GO_SCRIPT" complete 0
54-
assert_success 'help' 'bar' 'foo'
54+
assert_success 'help' 'bar' 'baz' 'foo'
5555
}
5656

5757
@test "$SUITE: cd and pushd complete directories" {

0 commit comments

Comments
 (0)