mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Sync upstream Gemini-CLI v0.8.2 (#838)
This commit is contained in:
@@ -4,11 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type DetectedIde, getIdeInfo } from '@qwen-code/qwen-code-core';
|
||||
import type { IdeInfo } from '@qwen-code/qwen-code-core';
|
||||
import { Box, Text } from 'ink';
|
||||
import type { RadioSelectItem } from './components/shared/RadioButtonSelect.js';
|
||||
import { RadioButtonSelect } from './components/shared/RadioButtonSelect.js';
|
||||
import { useKeypress } from './hooks/useKeypress.js';
|
||||
import { theme } from './semantic-colors.js';
|
||||
|
||||
export type IdeIntegrationNudgeResult = {
|
||||
userSelection: 'yes' | 'no' | 'dismiss';
|
||||
@@ -16,7 +17,7 @@ export type IdeIntegrationNudgeResult = {
|
||||
};
|
||||
|
||||
interface IdeIntegrationNudgeProps {
|
||||
ide: DetectedIde;
|
||||
ide: IdeInfo;
|
||||
onComplete: (result: IdeIntegrationNudgeResult) => void;
|
||||
}
|
||||
|
||||
@@ -36,7 +37,7 @@ export function IdeIntegrationNudge({
|
||||
{ isActive: true },
|
||||
);
|
||||
|
||||
const { displayName: ideName } = getIdeInfo(ide);
|
||||
const { displayName: ideName } = ide;
|
||||
// Assume extension is already installed if the env variables are set.
|
||||
const isExtensionPreInstalled =
|
||||
!!process.env['QWEN_CODE_IDE_SERVER_PORT'] &&
|
||||
@@ -49,6 +50,7 @@ export function IdeIntegrationNudge({
|
||||
userSelection: 'yes',
|
||||
isExtensionPreInstalled,
|
||||
},
|
||||
key: 'Yes',
|
||||
},
|
||||
{
|
||||
label: 'No (esc)',
|
||||
@@ -56,6 +58,7 @@ export function IdeIntegrationNudge({
|
||||
userSelection: 'no',
|
||||
isExtensionPreInstalled,
|
||||
},
|
||||
key: 'No (esc)',
|
||||
},
|
||||
{
|
||||
label: "No, don't ask again",
|
||||
@@ -63,6 +66,7 @@ export function IdeIntegrationNudge({
|
||||
userSelection: 'dismiss',
|
||||
isExtensionPreInstalled,
|
||||
},
|
||||
key: "No, don't ask again",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -78,17 +82,17 @@ export function IdeIntegrationNudge({
|
||||
<Box
|
||||
flexDirection="column"
|
||||
borderStyle="round"
|
||||
borderColor="yellow"
|
||||
borderColor={theme.status.warning}
|
||||
padding={1}
|
||||
width="100%"
|
||||
marginLeft={1}
|
||||
>
|
||||
<Box marginBottom={1} flexDirection="column">
|
||||
<Text>
|
||||
<Text color="yellow">{'> '}</Text>
|
||||
<Text color={theme.status.warning}>{'> '}</Text>
|
||||
{`Do you want to connect ${ideName ?? 'your editor'} to Qwen Code?`}
|
||||
</Text>
|
||||
<Text dimColor>{installText}</Text>
|
||||
<Text color={theme.text.secondary}>{installText}</Text>
|
||||
</Box>
|
||||
<RadioButtonSelect items={OPTIONS} onSelect={onComplete} />
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user