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
5 changes: 3 additions & 2 deletions TablePro/Core/MCP/MCPToolHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ final class MCPToolHandler: Sendable {
private func handleExecuteQuery(_ args: JSONValue?, sessionId: String) async throws -> MCPToolResult {
let connectionId = try requireUUID(args, key: "connection_id")
let query = try requireString(args, key: "query")
let maxRows = optionalInt(args, key: "max_rows", default: 500, clamp: 1...10_000)
let timeoutSeconds = optionalInt(args, key: "timeout_seconds", default: 30, clamp: 1...300)
let mcpSettings = await MainActor.run { AppSettingsManager.shared.mcp }
let maxRows = optionalInt(args, key: "max_rows", default: mcpSettings.defaultRowLimit, clamp: 1...mcpSettings.maxRowLimit)
let timeoutSeconds = optionalInt(args, key: "timeout_seconds", default: mcpSettings.queryTimeoutSeconds, clamp: 1...300)
let database = optionalString(args, key: "database")
let schema = optionalString(args, key: "schema")

Expand Down
3 changes: 1 addition & 2 deletions TablePro/Core/Storage/AppSettingsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class AppSettingsManager {
highlightCurrentLine: editor.highlightCurrentLine,
showLineNumbers: editor.showLineNumbers,
tabWidth: editor.clampedTabWidth,
autoIndent: editor.autoIndent,

wordWrap: editor.wordWrap
)
notifyChange(.editorSettingsDidChange)
Expand Down Expand Up @@ -201,7 +201,6 @@ final class AppSettingsManager {
highlightCurrentLine: editor.highlightCurrentLine,
showLineNumbers: editor.showLineNumbers,
tabWidth: editor.clampedTabWidth,
autoIndent: editor.autoIndent,
wordWrap: editor.wordWrap
)

Expand Down
5 changes: 0 additions & 5 deletions TablePro/Models/Settings/EditorSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ struct EditorSettings: Codable, Equatable {
var showLineNumbers: Bool
var highlightCurrentLine: Bool
var tabWidth: Int // 2, 4, or 8 spaces
var autoIndent: Bool
var wordWrap: Bool
var vimModeEnabled: Bool
var uppercaseKeywords: Bool
Expand All @@ -75,7 +74,6 @@ struct EditorSettings: Codable, Equatable {
showLineNumbers: true,
highlightCurrentLine: true,
tabWidth: 4,
autoIndent: true,
wordWrap: false,
vimModeEnabled: false,
uppercaseKeywords: false
Expand All @@ -85,15 +83,13 @@ struct EditorSettings: Codable, Equatable {
showLineNumbers: Bool = true,
highlightCurrentLine: Bool = true,
tabWidth: Int = 4,
autoIndent: Bool = true,
wordWrap: Bool = false,
vimModeEnabled: Bool = false,
uppercaseKeywords: Bool = false
) {
self.showLineNumbers = showLineNumbers
self.highlightCurrentLine = highlightCurrentLine
self.tabWidth = tabWidth
self.autoIndent = autoIndent
self.wordWrap = wordWrap
self.vimModeEnabled = vimModeEnabled
self.uppercaseKeywords = uppercaseKeywords
Expand All @@ -105,7 +101,6 @@ struct EditorSettings: Codable, Equatable {
showLineNumbers = try container.decodeIfPresent(Bool.self, forKey: .showLineNumbers) ?? true
highlightCurrentLine = try container.decodeIfPresent(Bool.self, forKey: .highlightCurrentLine) ?? true
tabWidth = try container.decodeIfPresent(Int.self, forKey: .tabWidth) ?? 4
autoIndent = try container.decodeIfPresent(Bool.self, forKey: .autoIndent) ?? true
wordWrap = try container.decodeIfPresent(Bool.self, forKey: .wordWrap) ?? false
vimModeEnabled = try container.decodeIfPresent(Bool.self, forKey: .vimModeEnabled) ?? false
uppercaseKeywords = try container.decodeIfPresent(Bool.self, forKey: .uppercaseKeywords) ?? false
Expand Down
Loading
Loading