|
30 | 30 | REQ_CONVERSATION_TURN, |
31 | 31 | REQ_CONVERSATION_TURN_DELETE, |
32 | 32 | REQ_COPILOT_MODELS, |
| 33 | + REQ_COPILOT_SET_MODEL_POLICY, |
33 | 34 | REQ_FILE_CHECK_STATUS, |
34 | 35 | REQ_GET_PANEL_COMPLETIONS, |
35 | 36 | REQ_GET_PROMPT, |
36 | 37 | REQ_GET_VERSION, |
37 | 38 | REQ_NOTIFY_ACCEPTED, |
38 | 39 | REQ_NOTIFY_REJECTED, |
39 | | - REQ_SET_MODEL_POLICY, |
40 | 40 | REQ_SIGN_IN_CONFIRM, |
41 | 41 | REQ_SIGN_IN_INITIATE, |
42 | 42 | REQ_SIGN_IN_WITH_GITHUB_TOKEN, |
@@ -600,15 +600,23 @@ def _on_result_copilot_models(self, payload: list[CopilotModel]) -> None: |
600 | 600 | if not (window := self.view.window()): |
601 | 601 | return |
602 | 602 | window.show_quick_panel( |
603 | | - [[item["modelFamily"], item["modelName"], ", ".join(item["scopes"])] for item in payload], lambda _: None |
| 603 | + [ |
| 604 | + sublime.QuickPanelItem( |
| 605 | + trigger=item["modelFamily"], |
| 606 | + details=item["modelName"], |
| 607 | + annotation=", ".join(item["scopes"]), |
| 608 | + ) |
| 609 | + for item in payload |
| 610 | + ], |
| 611 | + lambda _: None, # @todo implement model switching callback |
604 | 612 | ) |
605 | 613 |
|
606 | 614 |
|
607 | 615 | class CopilotSetModelPolicyCommand(CopilotTextCommand): |
608 | 616 | @_provide_plugin_session() |
609 | 617 | def run(self, plugin: CopilotPlugin, session: Session, _: sublime.Edit, model_name: str, enabled: str) -> None: |
610 | 618 | session.send_request( |
611 | | - Request(REQ_SET_MODEL_POLICY, {"modelFamily": model_name, "enabled": enabled}), |
| 619 | + Request(REQ_COPILOT_SET_MODEL_POLICY, {"modelFamily": model_name, "enabled": enabled}), |
612 | 620 | lambda _: None, |
613 | 621 | ) |
614 | 622 |
|
|
0 commit comments