Skip to content

Commit 8cfbb5a

Browse files
committed
feat: add support for Copilot panel toggle command
fixes 241
1 parent 6af0699 commit 8cfbb5a

File tree

4 files changed

+117
-1
lines changed

4 files changed

+117
-1
lines changed

plugin/copilot.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local completion_store = {
22
[""] = { "auth", "attach", "detach", "disable", "enable", "panel", "status", "suggestion", "toggle", "version" },
33
auth = { "signin", "signout", "info" },
4-
panel = { "accept", "jump_next", "jump_prev", "open", "refresh" },
4+
panel = { "accept", "jump_next", "jump_prev", "open", "refresh", "toggle" },
55
suggestion = { "accept", "accept_line", "accept_word", "dismiss", "next", "prev", "toggle_auto_trigger" },
66
workspace = { "add" },
77
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--|---------|---------|---------|---------|---------|---------|---------|---------|
2+
01|
3+
02|~
4+
03|~
5+
04|~
6+
05|~
7+
06|~
8+
07|~
9+
08|~
10+
09|~
11+
10|~
12+
11|~
13+
12|~
14+
13|~
15+
14|~
16+
15|~
17+
16|~
18+
17|~
19+
18|~
20+
19|~
21+
20|~
22+
21|~
23+
22|~
24+
23|[No Name] 0,0-1 All
25+
24|
26+
27+
--|---------|---------|---------|---------|---------|---------|---------|---------|
28+
01|00000000000000000000000000000000000000000000000000000000000000000000000000000000
29+
02|11111111111111111111111111111111111111111111111111111111111111111111111111111111
30+
03|11111111111111111111111111111111111111111111111111111111111111111111111111111111
31+
04|11111111111111111111111111111111111111111111111111111111111111111111111111111111
32+
05|11111111111111111111111111111111111111111111111111111111111111111111111111111111
33+
06|11111111111111111111111111111111111111111111111111111111111111111111111111111111
34+
07|11111111111111111111111111111111111111111111111111111111111111111111111111111111
35+
08|11111111111111111111111111111111111111111111111111111111111111111111111111111111
36+
09|11111111111111111111111111111111111111111111111111111111111111111111111111111111
37+
10|11111111111111111111111111111111111111111111111111111111111111111111111111111111
38+
11|11111111111111111111111111111111111111111111111111111111111111111111111111111111
39+
12|11111111111111111111111111111111111111111111111111111111111111111111111111111111
40+
13|11111111111111111111111111111111111111111111111111111111111111111111111111111111
41+
14|11111111111111111111111111111111111111111111111111111111111111111111111111111111
42+
15|11111111111111111111111111111111111111111111111111111111111111111111111111111111
43+
16|11111111111111111111111111111111111111111111111111111111111111111111111111111111
44+
17|11111111111111111111111111111111111111111111111111111111111111111111111111111111
45+
18|11111111111111111111111111111111111111111111111111111111111111111111111111111111
46+
19|11111111111111111111111111111111111111111111111111111111111111111111111111111111
47+
20|11111111111111111111111111111111111111111111111111111111111111111111111111111111
48+
21|11111111111111111111111111111111111111111111111111111111111111111111111111111111
49+
22|11111111111111111111111111111111111111111111111111111111111111111111111111111111
50+
23|22222222222222222222222222222222222222222222222222222222222222222222222222222222
51+
24|33333333333333333333333333333333333333333333333333333333333333333333333333333333
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--|---------|---------|---------|---------|---------|---------|---------|---------|
2+
01|
3+
02|~
4+
03|~
5+
04|~
6+
05|~
7+
06|~
8+
07|~
9+
08|~
10+
09|~
11+
10|~
12+
11|~
13+
12|~
14+
13|~
15+
14|[No Name] 0,0-1 All
16+
15|
17+
16|
18+
17|
19+
18|
20+
19|
21+
20|
22+
21|
23+
22|
24+
23|copilot://// [RO] 1,0-1 All
25+
24|
26+
27+
--|---------|---------|---------|---------|---------|---------|---------|---------|
28+
01|00000000000000000000000000000000000000000000000000000000000000000000000000000000
29+
02|11111111111111111111111111111111111111111111111111111111111111111111111111111111
30+
03|11111111111111111111111111111111111111111111111111111111111111111111111111111111
31+
04|11111111111111111111111111111111111111111111111111111111111111111111111111111111
32+
05|11111111111111111111111111111111111111111111111111111111111111111111111111111111
33+
06|11111111111111111111111111111111111111111111111111111111111111111111111111111111
34+
07|11111111111111111111111111111111111111111111111111111111111111111111111111111111
35+
08|11111111111111111111111111111111111111111111111111111111111111111111111111111111
36+
09|11111111111111111111111111111111111111111111111111111111111111111111111111111111
37+
10|11111111111111111111111111111111111111111111111111111111111111111111111111111111
38+
11|11111111111111111111111111111111111111111111111111111111111111111111111111111111
39+
12|11111111111111111111111111111111111111111111111111111111111111111111111111111111
40+
13|11111111111111111111111111111111111111111111111111111111111111111111111111111111
41+
14|22222222222222222222222222222222222222222222222222222222222222222222222222222222
42+
15|00000000000000000000000000000000000000000000000000000000000000000000000000000000
43+
16|00000000000000000000000000000000000000000000000000000000000000000000000000000000
44+
17|11111111111111111111111111111111111111111111111111111111111111111111111111111111
45+
18|11111111111111111111111111111111111111111111111111111111111111111111111111111111
46+
19|11111111111111111111111111111111111111111111111111111111111111111111111111111111
47+
20|11111111111111111111111111111111111111111111111111111111111111111111111111111111
48+
21|11111111111111111111111111111111111111111111111111111111111111111111111111111111
49+
22|11111111111111111111111111111111111111111111111111111111111111111111111111111111
50+
23|33333333333333333333333333333333333333333333333333333333333333333333333333333333
51+
24|44444444444444444444444444444444444444444444444444444444444444444444444444444444

tests/test_command.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local child_helper = require("tests.child_helper")
22
local child = child_helper.new_child_neovim("test_suggestion")
33
local u = require("tests.utils")
4+
local reference_screenshot = MiniTest.expect.reference_screenshot
45

56
local T = MiniTest.new_set({
67
hooks = {
@@ -22,4 +23,17 @@ T["command()"]["version works"] = function()
2223
u.expect_match(result, ".*copilot language server.*copilot%.lua.*Node%.js.*language%-server%.js.*")
2324
end
2425

26+
T["command()"]["panel toggle - open works"] = function()
27+
child.configure_copilot()
28+
child.cmd("Copilot panel toggle")
29+
reference_screenshot(child.get_screenshot())
30+
end
31+
32+
T["command()"]["panel toggle - close works"] = function()
33+
child.configure_copilot()
34+
child.cmd("Copilot panel toggle")
35+
child.cmd("Copilot panel toggle")
36+
reference_screenshot(child.get_screenshot())
37+
end
38+
2539
return T

0 commit comments

Comments
 (0)