mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 20:50:34 +00:00
# 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483)
Some checks are pending
Qwen Code CI / Lint (GitHub Actions) (push) Waiting to run
Qwen Code CI / Lint (Javascript) (push) Waiting to run
Qwen Code CI / Lint (Shell) (push) Waiting to run
Qwen Code CI / Lint (YAML) (push) Waiting to run
Qwen Code CI / Lint (push) Blocked by required conditions
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
Some checks are pending
Qwen Code CI / Lint (GitHub Actions) (push) Waiting to run
Qwen Code CI / Lint (Javascript) (push) Waiting to run
Qwen Code CI / Lint (Shell) (push) Waiting to run
Qwen Code CI / Lint (YAML) (push) Waiting to run
Qwen Code CI / Lint (push) Blocked by required conditions
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
This commit is contained in:
parent
1610c1586e
commit
2572faf726
292 changed files with 19401 additions and 5941 deletions
|
|
@ -8,7 +8,6 @@ import { useCallback, useMemo, useEffect, useState } from 'react';
|
|||
import { type PartListUnion } from '@google/genai';
|
||||
import process from 'node:process';
|
||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||
import { useStateAndRef } from './useStateAndRef.js';
|
||||
import {
|
||||
Config,
|
||||
GitService,
|
||||
|
|
@ -93,16 +92,16 @@ export const useSlashCommandProcessor = (
|
|||
return l;
|
||||
}, [config]);
|
||||
|
||||
const [pendingCompressionItemRef, setPendingCompressionItem] =
|
||||
useStateAndRef<HistoryItemWithoutId | null>(null);
|
||||
const [pendingCompressionItem, setPendingCompressionItem] =
|
||||
useState<HistoryItemWithoutId | null>(null);
|
||||
|
||||
const pendingHistoryItems = useMemo(() => {
|
||||
const items: HistoryItemWithoutId[] = [];
|
||||
if (pendingCompressionItemRef.current != null) {
|
||||
items.push(pendingCompressionItemRef.current);
|
||||
if (pendingCompressionItem != null) {
|
||||
items.push(pendingCompressionItem);
|
||||
}
|
||||
return items;
|
||||
}, [pendingCompressionItemRef]);
|
||||
}, [pendingCompressionItem]);
|
||||
|
||||
const addMessage = useCallback(
|
||||
(message: Message) => {
|
||||
|
|
@ -117,6 +116,7 @@ export const useSlashCommandProcessor = (
|
|||
modelVersion: message.modelVersion,
|
||||
selectedAuthType: message.selectedAuthType,
|
||||
gcpProject: message.gcpProject,
|
||||
ideClient: message.ideClient,
|
||||
};
|
||||
} else if (message.type === MessageType.HELP) {
|
||||
historyItemContent = {
|
||||
|
|
@ -173,7 +173,7 @@ export const useSlashCommandProcessor = (
|
|||
},
|
||||
loadHistory,
|
||||
setDebugMessage: onDebugMessage,
|
||||
pendingItem: pendingCompressionItemRef.current,
|
||||
pendingItem: pendingCompressionItem,
|
||||
setPendingItem: setPendingCompressionItem,
|
||||
toggleCorgiMode,
|
||||
toggleVimEnabled,
|
||||
|
|
@ -183,7 +183,6 @@ export const useSlashCommandProcessor = (
|
|||
session: {
|
||||
stats: session.stats,
|
||||
sessionShellAllowlist,
|
||||
resetSession: session.resetSession,
|
||||
},
|
||||
}),
|
||||
[
|
||||
|
|
@ -196,9 +195,8 @@ export const useSlashCommandProcessor = (
|
|||
clearItems,
|
||||
refreshStatic,
|
||||
session.stats,
|
||||
session.resetSession,
|
||||
onDebugMessage,
|
||||
pendingCompressionItemRef,
|
||||
pendingCompressionItem,
|
||||
setPendingCompressionItem,
|
||||
toggleCorgiMode,
|
||||
toggleVimEnabled,
|
||||
|
|
@ -208,7 +206,22 @@ export const useSlashCommandProcessor = (
|
|||
],
|
||||
);
|
||||
|
||||
const ideMode = config?.getIdeMode();
|
||||
useEffect(() => {
|
||||
if (!config) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ideClient = config.getIdeClient();
|
||||
const listener = () => {
|
||||
reloadCommands();
|
||||
};
|
||||
|
||||
ideClient.addStatusChangeListener(listener);
|
||||
|
||||
return () => {
|
||||
ideClient.removeStatusChangeListener(listener);
|
||||
};
|
||||
}, [config, reloadCommands]);
|
||||
|
||||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
|
|
@ -230,7 +243,7 @@ export const useSlashCommandProcessor = (
|
|||
return () => {
|
||||
controller.abort();
|
||||
};
|
||||
}, [config, ideMode, reloadTrigger]);
|
||||
}, [config, reloadTrigger]);
|
||||
|
||||
const handleSlashCommand = useCallback(
|
||||
async (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue