chore(vscode-ide-companion): refactor directory structure

This commit is contained in:
yiliang114
2025-12-08 00:54:26 +08:00
parent e47263f7c9
commit be71976a1f
81 changed files with 409 additions and 1540 deletions

View File

@@ -73,7 +73,9 @@ export const useMessageHandling = () => {
const appendStreamChunk = useCallback(
(chunk: string) => {
// Ignore late chunks after user cancelled streaming (until next streamStart)
if (!isStreaming) return;
if (!isStreaming) {
return;
}
setMessages((prev) => {
let idx = streamingMessageIndexRef.current;
@@ -157,7 +159,9 @@ export const useMessageHandling = () => {
// Thought handling
appendThinkingChunk: (chunk: string) => {
// Ignore late thoughts after user cancelled streaming
if (!isStreaming) return;
if (!isStreaming) {
return;
}
setMessages((prev) => {
let idx = thinkingMessageIndexRef.current;
const next = prev.slice();

View File

@@ -59,7 +59,9 @@ export const useSessionManagement = (vscode: VSCodeAPI) => {
}, [vscode]);
const handleLoadMoreSessions = useCallback(() => {
if (!hasMore || isLoading || nextCursor === undefined) return;
if (!hasMore || isLoading || nextCursor === undefined) {
return;
}
setIsLoading(true);
vscode.postMessage({
type: 'getQwenSessions',

View File

@@ -6,7 +6,7 @@
import type { RefObject } from 'react';
import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
import type { CompletionItem } from '../types/CompletionTypes.js';
import type { CompletionItem } from '../../types/completionItemTypes.js';
interface CompletionTriggerState {
isOpen: boolean;

View File

@@ -5,8 +5,8 @@
*/
import { useState, useCallback } from 'react';
import type { ToolCallData } from '../components/ToolCall.js';
import type { ToolCallUpdate } from '../types/toolCall.js';
import type { ToolCallData } from '../components/messages/toolcalls/ToolCall.js';
import type { ToolCallUpdate } from '../../types/qwenTypes.js';
/**
* Tool call management Hook

View File

@@ -6,13 +6,13 @@
import { useEffect, useRef, useCallback } from 'react';
import { useVSCode } from './useVSCode.js';
import type { Conversation } from '../../storage/conversationStore.js';
import type { Conversation } from '../../services/conversationStore.js';
import type {
PermissionOption,
ToolCall as PermissionToolCall,
} from '../components/PermissionDrawer/PermissionRequest.js';
import type { ToolCallUpdate, EditMode } from '../types/toolCall.js';
import type { PlanEntry } from '../../agents/qwenTypes.js';
import type { ToolCallUpdate, EditMode } from '../../types/qwenTypes.js';
import type { PlanEntry } from '../../types/qwenTypes.js';
interface UseWebViewMessagesProps {
// Session management