Skip to content

Commit 2aaa1e2

Browse files
committed
refactor: make mypy happy
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent 54973bc commit 2aaa1e2

1 file changed

Lines changed: 22 additions & 28 deletions

File tree

plugin/commands.py

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -285,20 +285,18 @@ def _on_result_conversation_preconditions(
285285
"hideText": False,
286286
"warnings": [],
287287
})
288+
req_params: dict[str, Any] = {
289+
"turns": [{"request": msg}],
290+
"capabilities": {
291+
"allSkills": True,
292+
"skills": [],
293+
},
294+
"workDoneToken": f"copilot_chat://{window.id()}",
295+
"computeSuggestions": True,
296+
"source": "panel",
297+
}
288298
session.send_request(
289-
Request(
290-
REQ_CONVERSATION_CREATE,
291-
{
292-
"turns": [{"request": msg}],
293-
"capabilities": {
294-
"allSkills": True,
295-
"skills": [],
296-
},
297-
"workDoneToken": f"copilot_chat://{window.id()}",
298-
"computeSuggestions": True,
299-
"source": "panel",
300-
},
301-
),
299+
Request(REQ_CONVERSATION_CREATE, req_params),
302300
lambda msg: self._on_result_conversation_create(plugin, session, msg),
303301
)
304302
wcm.is_waiting = True
@@ -417,14 +415,12 @@ def run(self, plugin: CopilotPlugin, session: Session, _: sublime.Edit, conversa
417415
status_message("Failed to find window or conversation.")
418416
return
419417

418+
req_params: dict[str, Any] = {
419+
"conversationId": conversation_id,
420+
"options": {},
421+
}
420422
session.send_request(
421-
Request(
422-
REQ_CONVERSATION_DESTROY,
423-
{
424-
"conversationId": conversation_id,
425-
"options": {},
426-
},
427-
),
423+
Request(REQ_CONVERSATION_DESTROY, req_params),
428424
self._on_result_conversation_destroy,
429425
)
430426

@@ -494,15 +490,13 @@ def run(
494490
return
495491
retrieved_turn_id = wcm.conversation[index]["turnId"]
496492

493+
req_params: dict[str, Any] = {
494+
"conversationId": conversation_id,
495+
"turnId": retrieved_turn_id,
496+
"options": {},
497+
}
497498
session.send_request(
498-
Request(
499-
REQ_CONVERSATION_TURN_DELETE,
500-
{
501-
"conversationId": conversation_id,
502-
"turnId": retrieved_turn_id,
503-
"options": {},
504-
},
505-
),
499+
Request(REQ_CONVERSATION_TURN_DELETE, req_params),
506500
lambda x: self._on_result_conversation_turn_delete(window_id, conversation_id, turn_id, x),
507501
)
508502

0 commit comments

Comments
 (0)