Skip to content

Commit dbc2c3b

Browse files
committed
working Code Review
1 parent ed57ffc commit dbc2c3b

File tree

10 files changed

+620
-87
lines changed

10 files changed

+620
-87
lines changed

Main.sublime-commands

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
"caption": "Copilot: Chat",
44
"command": "copilot_conversation_chat"
55
},
6+
{
7+
"caption": "Copilot: Code Review",
8+
"command": "copilot_code_review"
9+
},
10+
{
11+
"caption": "Copilot: Generate Commit Message",
12+
"command": "copilot_git_commit_generate"
13+
},
14+
{
15+
"caption": "Copilot: Edit Conversation",
16+
"command": "copilot_edit_conversation_create"
17+
},
618
{
719
"caption": "Copilot: Explain",
820
"command": "copilot_conversation_chat",
@@ -74,6 +86,11 @@
7486
"caption": "Copilot: Conversation Templates",
7587
"command": "copilot_conversation_templates",
7688
},
89+
{
90+
// Debug Command
91+
"caption": "Copilot: Register Conversation Tools",
92+
"command": "copilot_register_conversation_tools",
93+
},
7794
{
7895
"caption": "Copilot: Check Status",
7996
"command": "copilot_check_status"

language-server/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

language-server/package-lock.json

Lines changed: 7 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

language-server/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"private": true,
3-
"dependencies": {
4-
"@github/copilot-language-server": "^1.319.0"
5-
},
6-
"version": "0.0.0"
2+
"private": true,
3+
"dependencies": {
4+
"@github/copilot-language-server": "^1.323.0"
5+
},
6+
"version": "0.0.0"
77
}

plugin/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
CopilotCheckStatusCommand,
1111
CopilotClosePanelCompletionCommand,
1212
CopilotConversationAgentsCommand,
13+
CopilotCodeReviewCommand,
1314
CopilotConversationChatCommand,
1415
CopilotConversationChatShimCommand,
16+
CopilotEditConversationCreateCommand,
1517
CopilotConversationCloseCommand,
1618
CopilotConversationCopyCodeCommand,
1719
CopilotConversationDebugCommand,
@@ -55,6 +57,8 @@
5557
"CopilotAskCompletionsCommand",
5658
"CopilotCheckFileStatusCommand",
5759
"CopilotCheckStatusCommand",
60+
"CopilotCodeReviewCommand",
61+
"CopilotEditConversationCreateCommand",
5862
"CopilotClosePanelCompletionCommand",
5963
"CopilotConversationAgentsCommand",
6064
"CopilotConversationChatCommand",

plugin/client.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
REQ_GET_COMPLETIONS_CYCLING,
2929
REQ_GET_VERSION,
3030
REQ_SET_EDITOR_INFO,
31+
REQ_CONTEXT_REGISTER_PROVIDERS,
3132
)
3233
from .helpers import (
3334
ActivityIndicator,
@@ -37,7 +38,7 @@
3738
preprocess_completions,
3839
preprocess_panel_completions,
3940
)
40-
from .log import log_warning
41+
from .log import log_warning, log_info
4142
from .template import load_string_template
4243
from .types import (
4344
AccountStatus,
@@ -189,9 +190,31 @@ def _on_check_status(result: CopilotPayloadSignInConfirm, failed: bool) -> None:
189190
authorized=result["status"] == "OK",
190191
user=user,
191192
)
193+
194+
def _on_register_providers(response: Any, failed: bool) -> None:
195+
if failed:
196+
log_warning("Failed to register context providers")
197+
else:
198+
log_info("Successfully registered context providers")
192199

193200
api.send_request(REQ_GET_VERSION, {}, _on_get_version)
194201
api.send_request(REQ_CHECK_STATUS, {}, _on_check_status)
202+
203+
# Register context providers
204+
api.send_request(
205+
REQ_CONTEXT_REGISTER_PROVIDERS,
206+
{
207+
"providers": [
208+
{
209+
"id": "sublime-text-editor",
210+
"name": "Sublime Text Editor",
211+
"fullName": "Sublime Text Editor Context Provider",
212+
"description": "Provides access to the Sublime Text editor context"
213+
}
214+
]
215+
},
216+
_on_register_providers
217+
)
195218

196219
def on_settings_changed(self, settings: DottedDict) -> None:
197220
def parse_proxy(proxy: str) -> NetworkProxy | None:

0 commit comments

Comments
 (0)