Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Plugins/KafkaDriverPlugin/KafkaConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ actor KafkaConnection {
}

enum KafkaClientInfo {
static let version = "1.0.0"
static let version = Bundle(for: KafkaPlugin.self)
.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0"
static let clientId = "tablepro"
}
12 changes: 2 additions & 10 deletions Plugins/SnowflakeDriverPlugin/SnowflakeConnection.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
//
// SnowflakeConnection.swift
// SnowflakeDriverPlugin
//
// Implements the Snowflake connector REST protocol (session login + query
// execution) used by the official Snowflake drivers. Supports password,
// key-pair JWT, OAuth token, and external-browser SSO authentication.
//

import AppKit
import Compression
import Foundation
Expand Down Expand Up @@ -73,7 +64,8 @@ final class SnowflakeConnection: @unchecked Sendable {

private static let logger = Logger(subsystem: "com.TablePro", category: "SnowflakeConnection")
private static let appName = "TablePro"
private static let appVersion = "1.0.0"
private static let appVersion = Bundle(for: SnowflakeConnection.self)
.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0"
static let defaultConnectTimeoutMilliseconds = 120_000
private static let requestTimeout: TimeInterval = 120

Expand Down
3 changes: 2 additions & 1 deletion TablePro/Core/AI/Copilot/CopilotService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import os
final class CopilotService: ObservableObject {
nonisolated private static let logger = Logger(subsystem: "com.TablePro", category: "CopilotService")
static let shared = CopilotService()
nonisolated static let editorPluginInfo = LSPClientInfo(name: "tablepro-copilot", version: Bundle.main.appVersion)

enum Status: Sendable, Equatable {
case stopped
Expand Down Expand Up @@ -109,7 +110,7 @@ final class CopilotService: ObservableObject {
let client = LSPClient(transport: launched)
_ = try await client.initialize(
clientInfo: LSPClientInfo(name: "TablePro", version: Bundle.main.appVersion),
editorPluginInfo: LSPClientInfo(name: "tablepro-copilot", version: "1.0.0"),
editorPluginInfo: Self.editorPluginInfo,
processId: Int(ProcessInfo.processInfo.processIdentifier)
)
await client.initialized()
Expand Down
10 changes: 5 additions & 5 deletions TableProTests/Core/AI/CopilotLifecycleTests.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
//
// CopilotLifecycleTests.swift
// TableProTests
//

import Foundation
@testable import TablePro
import Testing
Expand All @@ -12,6 +7,11 @@ struct CopilotLifecycleTests {
private let copilot = AIProviderConfig(name: "Copilot", type: .copilot)
private let claude = AIProviderConfig(name: "Claude", type: .claude)

@Test("The language server is told the running TablePro version")
func pluginInfoCarriesTheAppVersion() {
#expect(CopilotService.editorPluginInfo == LSPClientInfo(name: "tablepro-copilot", version: Bundle.main.appVersion))
}

@Test("Runs only while AI is on and a Copilot provider exists")
func allowsRunning() {
#expect(CopilotLifecycle.allowsRunning(AISettings(enabled: true, providers: [copilot])))
Expand Down
1 change: 1 addition & 0 deletions changelog.d/3517.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Snowflake, Kafka and GitHub Copilot saw every TablePro build as version 1.0.0.
Loading