feat(ui): 实现 LSP UI 集成

- 添加 LSP 相关类型定义 (LSPServer, FileDiagnostic, DiagnosticsResponse)
- 添加 LSP API 函数 (listLSPServers, installLSPServer, startLSPServer 等)
- 创建 LSPPanel 组件: 语言服务器管理面板
- 创建 DiagnosticsPanel 组件: 诊断详情面板 (含搜索过滤)
- 创建 DiagnosticsIndicator 组件: 状态栏指示器
- 集成到 Web 模块 (App.tsx, Chat.tsx)
This commit is contained in:
2025-12-17 11:17:00 +08:00
parent c5b92e740c
commit 1019ba7c9c
8 changed files with 1673 additions and 1 deletions
+15 -1
View File
@@ -14,6 +14,7 @@ import {
PermissionDialog,
ContextUsage,
SubagentProgress,
DiagnosticsIndicator,
} from '@ai-assistant/ui';
interface ChatPageProps {
@@ -30,6 +31,8 @@ interface ChatPageProps {
onOpenAgents?: () => void;
onOpenCheckpoints?: () => void;
onOpenProviders?: () => void;
onOpenLSP?: () => void;
onOpenDiagnostics?: () => void;
// Working Directory
workingDirectory?: string;
}
@@ -47,6 +50,8 @@ export function ChatPage({
onOpenAgents,
onOpenCheckpoints,
onOpenProviders,
onOpenLSP,
onOpenDiagnostics,
workingDirectory,
}: ChatPageProps) {
const {
@@ -184,8 +189,17 @@ export function ChatPage({
<ConnectionStatus />
{/* 工具栏按钮 */}
{(onToggleFileBrowser || onOpenCommands || onOpenMCP || onOpenHooks || onOpenAgents || onOpenCheckpoints || onOpenProviders) && (
{(onToggleFileBrowser || onOpenCommands || onOpenMCP || onOpenHooks || onOpenAgents || onOpenCheckpoints || onOpenProviders || onOpenLSP || onOpenDiagnostics) && (
<div className="flex items-center gap-1.5 border-l border-line-muted pl-3">
{/* LSP 诊断指示器 */}
{(onOpenLSP || onOpenDiagnostics) && (
<DiagnosticsIndicator
onClickDiagnostics={onOpenDiagnostics}
onClickLSP={onOpenLSP}
refreshInterval={30000}
/>
)}
{/* Checkpoints 按钮 */}
{onOpenCheckpoints && (
<motion.button