Skip to content

Add configurable T-SQL parser version and General settings tab#123

Open
alex-bochkov wants to merge 1 commit into
mainfrom
codex/add-general-settings-page-in-ui
Open

Add configurable T-SQL parser version and General settings tab#123
alex-bochkov wants to merge 1 commit into
mainfrom
codex/add-general-settings-page-in-ui

Conversation

@alex-bochkov

Copy link
Copy Markdown
Contributor

Motivation

  • Introduce a first Settings page "General" to let users choose the T-SQL/SQL Server version for ScriptDom parsing and generation.
  • Ensure all places that instantiate TSqlParser or Sql*ScriptGenerator use the configured parser version instead of hard-coded TSql170Parser/Sql170ScriptGenerator.

Description

  • Add a new General tab to the settings UI with a ComboBox (SqlVersion) and Save button to select and persist the parser version.
  • Add TSqlParserVersion enum and helper methods GetTSqlParserVersion(), SaveTSqlParserVersion() and GetTSqlParserVersionDisplayName() in SettingsManager to store and present the option.
  • Add a central TSqlParserFactory that exposes Create(bool initialQuotedIdentifiers) and CreateScriptGenerator() to return the correct TSqlParser and SqlScriptGenerator for the configured version.
  • Replace local hard-coded usages of TSql170Parser/Sql170ScriptGenerator with calls to TSqlParserFactory.Create(...) and TSqlParserFactory.CreateScriptGenerator() in formatter, comment interleaver, object scripting, selection, and block-comment code paths, and add the new file to the project (AxialSqlTools.csproj).

Testing

  • Ran git diff --check which passed without errors.
  • Verified repository-wide replacements with rg searches to ensure parser/generator usages were switched to TSqlParserFactory and no remaining hard-coded TSql170Parser/Sql170ScriptGenerator instances remain in updated files.
  • Attempted to build with msbuild and dotnet build but both tools were not available in the environment so full compilation could not be executed here.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant