mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Add unit tests for CLI modules and fix ESLint issues
- Add comprehensive unit tests for all CLI-related modules: - CliContextManager - CliVersionManager - cliDetector - CliInstaller - Fix ESLint issues by replacing @ts-ignore with @ts-expect-error - Fix any type issues in test files - Add tests for diff-manager functionality - Improve loading messages random selection stability 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { JSONRPC_VERSION } from '../shared/acpTypes.js';
|
||||
import { JSONRPC_VERSION } from '../constants/acpTypes.js';
|
||||
import type {
|
||||
AcpBackend,
|
||||
AcpMessage,
|
||||
AcpPermissionRequest,
|
||||
AcpResponse,
|
||||
AcpSessionUpdate,
|
||||
} from '../shared/acpTypes.js';
|
||||
} from '../constants/acpTypes.js';
|
||||
import type { ChildProcess, SpawnOptions } from 'child_process';
|
||||
import { spawn } from 'child_process';
|
||||
import type {
|
||||
|
||||
@@ -17,7 +17,7 @@ import type {
|
||||
AcpResponse,
|
||||
AcpSessionUpdate,
|
||||
AcpPermissionRequest,
|
||||
} from '../shared/acpTypes.js';
|
||||
} from '../constants/acpTypes.js';
|
||||
import { CLIENT_METHODS } from './schema.js';
|
||||
import type {
|
||||
PendingRequest,
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
* Responsible for managing ACP protocol session operations, including initialization, authentication, session creation, and switching
|
||||
*/
|
||||
|
||||
import { JSONRPC_VERSION } from '../shared/acpTypes.js';
|
||||
import { JSONRPC_VERSION } from '../constants/acpTypes.js';
|
||||
import type {
|
||||
AcpRequest,
|
||||
AcpNotification,
|
||||
AcpResponse,
|
||||
} from '../shared/acpTypes.js';
|
||||
} from '../constants/acpTypes.js';
|
||||
import { AGENT_METHODS, CUSTOM_METHODS } from './schema.js';
|
||||
import type { PendingRequest } from './connectionTypes.js';
|
||||
import type { ChildProcess } from 'child_process';
|
||||
|
||||
@@ -14,7 +14,7 @@ import type { ChildProcess } from 'child_process';
|
||||
import type {
|
||||
AcpSessionUpdate,
|
||||
AcpPermissionRequest,
|
||||
} from '../shared/acpTypes.js';
|
||||
} from '../constants/acpTypes.js';
|
||||
|
||||
/**
|
||||
* Pending Request Information
|
||||
|
||||
@@ -8,7 +8,7 @@ import { AcpConnection } from '../acp/acpConnection.js';
|
||||
import type {
|
||||
AcpSessionUpdate,
|
||||
AcpPermissionRequest,
|
||||
} from '../shared/acpTypes.js';
|
||||
} from '../constants/acpTypes.js';
|
||||
import {
|
||||
QwenSessionReader,
|
||||
type QwenSession,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Handles session updates from ACP and dispatches them to appropriate callbacks
|
||||
*/
|
||||
|
||||
import type { AcpSessionUpdate } from '../shared/acpTypes.js';
|
||||
import type { AcpSessionUpdate } from '../constants/acpTypes.js';
|
||||
import type { QwenAgentCallbacks } from './qwenTypes.js';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,14 +3,7 @@
|
||||
* Copyright 2025 Qwen Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Qwen Agent Manager Type Definitions
|
||||
*
|
||||
* Contains all related interfaces and type definitions
|
||||
*/
|
||||
|
||||
import type { AcpPermissionRequest } from '../shared/acpTypes.js';
|
||||
import type { AcpPermissionRequest } from '../constants/acpTypes.js';
|
||||
|
||||
/**
|
||||
* Chat Message
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { getFileName } from '../utils/webviewUtils.js';
|
||||
import { getFileName } from './utils/webviewUtils.js';
|
||||
|
||||
/**
|
||||
* File Operations Handler
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { escapeHtml } from '../utils/webviewUtils.js';
|
||||
import { escapeHtml } from './utils/webviewUtils.js';
|
||||
|
||||
/**
|
||||
* WebView HTML Content Generator
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { QwenAgentManager } from '../agents/qwenAgentManager.js';
|
||||
import { ConversationStore } from '../storage/conversationStore.js';
|
||||
import type { AcpPermissionRequest } from '../shared/acpTypes.js';
|
||||
import type { AcpPermissionRequest } from '../constants/acpTypes.js';
|
||||
import { CliDetector } from '../utils/cliDetector.js';
|
||||
import { AuthStateManager } from '../auth/authStateManager.js';
|
||||
import { PanelManager } from './PanelManager.js';
|
||||
import { MessageHandler } from './MessageHandler.js';
|
||||
import { WebViewContent } from './WebViewContent.js';
|
||||
import { CliInstaller } from '../utils/CliInstaller.js';
|
||||
import { getFileName } from '../utils/webviewUtils.js';
|
||||
import { getFileName } from './utils/webviewUtils.js';
|
||||
|
||||
export class WebViewProvider {
|
||||
private panelManager: PanelManager;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { BaseMessageHandler } from './BaseMessageHandler.js';
|
||||
import { getFileName } from '../../utils/webviewUtils.js';
|
||||
import { getFileName } from '../utils/webviewUtils.js';
|
||||
|
||||
/**
|
||||
* Editor message handler
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { BaseMessageHandler } from './BaseMessageHandler.js';
|
||||
import { getFileName } from '../../utils/webviewUtils.js';
|
||||
import { getFileName } from '../utils/webviewUtils.js';
|
||||
|
||||
/**
|
||||
* File message handler
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import type { VSCodeAPI } from './useVSCode.js';
|
||||
import { getRandomLoadingMessage } from '../constants/loadingMessages.js';
|
||||
import { getRandomLoadingMessage } from '../../constants/loadingMessages.js';
|
||||
|
||||
interface UseMessageSubmitProps {
|
||||
vscode: VSCodeAPI;
|
||||
|
||||
Reference in New Issue
Block a user