feat: add GitHub Copilot support with rewritten inline suggestion architecture#850
Merged
feat: add GitHub Copilot support with rewritten inline suggestion architecture#850
Conversation
17d7287 to
e50815a
Compare
…hitecture Copilot integration: - LSP infrastructure: JSON-RPC 2.0 transport, typed client, document manager - Binary download from npm with SHA-512 integrity verification - OAuth device flow authentication - Inline suggestions via textDocument/inlineCompletion with schema context - Chat via conversation/create, conversation/turn, $/progress streaming - Real model list from copilot/models endpoint - Conversation lifecycle: destroy on clear, turnDelete on regenerate Inline suggestion rewrite: - InlineSuggestionSource protocol with dynamic resolver - GhostTextRenderer with CATextLayer and scroll-aware repositioning - AIChatInlineSource for AI provider fallback - CopilotInlineSource with preamble offset handling - Unified provider picker (Off/Copilot/AI) in Editor settings AI provider registry: - AIProviderDescriptor with capabilities and factory closures - AIProviderRegistry wired into AIProviderFactory (replaces hardcoded switch) - AIProviderRegistration registers all built-in providers at launch Settings and UX: - Copilot settings tab with status, auth, telemetry - Copilot chat toggle in AI settings with auth guard - Confirmation dialogs for clear conversations and delete provider - Cancel button for Copilot sign-in flow - Connection policy preserved (Always Allow/Ask/Never)
3c5f997 to
677569b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #754
Adds GitHub Copilot support to TablePro with a complete rewrite of the inline suggestion architecture and a new AI provider registry pattern.
Inline Suggestion Architecture Rewrite
InlineSuggestionManagerinto a clean, protocol-based systemInlineSuggestionSourceprotocol for pluggable suggestion sourcesGhostTextRendererfor CATextLayer ghost text displayAIChatInlineSourcefor existing AI provider path (Claude, OpenAI, etc.)Generic LSP Client
Core/LSP/withLSPTransport(stdio JSON-RPC 2.0),LSPClient(typed methods),LSPTypes,LSPDocumentManagerGitHub Copilot Integration
CopilotService: language server lifecycle, OAuth device flow auth, exponential backoff restartCopilotBinaryManager: download native binary from npm with SHA1 integrity verificationCopilotInlineSource: inline completions viatextDocument/inlineCompletionwith proper ghost text rendering and replacement range handlingCopilotDocumentSync: editor text changes synced to LSP with server-restart awarenessCopilotSchemaContext: database schema preamble (table names, columns, types) prepended to document for schema-aware suggestionsCopilotChatProvider: chat viaconversation/create+conversation/turnLSP protocol with streamingAI Provider Registry
AIProviderDescriptor+AIProviderRegistry+AIProviderRegistrationfor extensible provider registrationAIProviderFactorytries registry first, hardcoded switch as fallbackUnified Settings
InlineSuggestionProviderpicker in Editor settings (Off / GitHub Copilot / AI Provider)Architecture
Files (36 changed)
New (18):
Core/LSP/— LSPTypes, LSPTransport, LSPClient, LSPDocumentManagerCore/AI/InlineSuggestion/— InlineSuggestionSource, GhostTextRenderer, AIChatInlineSource, InlineSuggestionManagerCore/AI/Copilot/— CopilotService, CopilotAuthManager, CopilotBinaryManager, CopilotDocumentSync, CopilotInlineSource, CopilotSchemaContext, CopilotChatProviderCore/AI/Registry/— AIProviderDescriptor, AIProviderRegistry, AIProviderRegistrationModels/AI/CopilotSettings.swift,Views/Settings/CopilotSettingsView.swiftModified (8): AIModels, AIProviderFactory, SQLEditorCoordinator, SQLEditorView, EditorSettings, EditorSettingsView, AISettingsView, AppSettingsManager, AppSettingsStorage, SettingsView, TableProApp
Deleted (1):
Core/AI/InlineSuggestionManager.swift(replaced by decomposed files)Test plan
InlineSuggestionManagerFocusTestspass (12/12)AISettingsTestspass (3/3)