Skip to content

feat: add T-SQL formatter extension with profile management and forma…#1

Merged
JoelMiller74 merged 22 commits intomainfrom
initial-commit
Dec 6, 2025
Merged

feat: add T-SQL formatter extension with profile management and forma…#1
JoelMiller74 merged 22 commits intomainfrom
initial-commit

Conversation

@JoelMiller74
Copy link
Owner

…tting features

  • Implemented core formatting logic for T-SQL in src/formatter/engine.ts.
  • Added extension activation and command registration in src/extension.ts.
  • Created profile management functions for saving, loading, exporting, and importing profiles in src/profiles/profileManager.ts.
  • Added SQL sample query for testing in samples/sample.sql.
  • Developed unit tests for formatter functionality in src/test/formatter.test.ts and src/test/formatter.vitest.ts.
  • Configured TypeScript settings in tsconfig.json and Vitest configuration in vitest.config.ts.
  • Updated extension documentation in vsc-extension-quickstart.md.

…tting features

- Implemented core formatting logic for T-SQL in `src/formatter/engine.ts`.
- Added extension activation and command registration in `src/extension.ts`.
- Created profile management functions for saving, loading, exporting, and importing profiles in `src/profiles/profileManager.ts`.
- Added SQL sample query for testing in `samples/sample.sql`.
- Developed unit tests for formatter functionality in `src/test/formatter.test.ts` and `src/test/formatter.vitest.ts`.
- Configured TypeScript settings in `tsconfig.json` and Vitest configuration in `vitest.config.ts`.
- Updated extension documentation in `vsc-extension-quickstart.md`.
@JoelMiller74 JoelMiller74 self-assigned this Dec 5, 2025
Copilot AI review requested due to automatic review settings December 5, 2025 03:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a T-SQL formatter extension for VS Code with comprehensive formatting options and profile management capabilities. The extension provides a document formatter for SQL files with extensive configuration options for keyword casing, indentation, line breaks, and SQL-specific formatting rules like JOIN alignment and CTE formatting.

Key changes:

  • Implements core T-SQL formatting engine with 30+ configuration options for keyword casing, indentation, operator spacing, parenthesis handling, and SQL clause formatting
  • Adds profile management system allowing users to save, load, export, and import formatting profiles as JSON files
  • Includes comprehensive test coverage using both Mocha (for VS Code integration tests) and Vitest (for unit tests)

Reviewed changes

Copilot reviewed 29 out of 32 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/extension.ts Extension activation with document formatter registration and profile management commands
src/formatter/engine.ts Core T-SQL formatting logic implementing keyword casing, indentation, and SQL-specific formatting rules
src/profiles/profileManager.ts Profile management functions for saving, loading, exporting, and importing formatter profiles
src/test/extension.test.ts Basic extension test suite with placeholder tests (contains critical syntax error)
src/test/formatter.test.ts Mocha-based unit tests for formatter functionality covering various formatting options
src/test/formatter.vitest.ts Vitest-based unit tests mirroring the Mocha tests for dual test framework support
package.json Extension manifest with configuration schema, commands, and build/test scripts
.github/workflows/ci.yml CI/CD workflow for linting, building, and testing (contains YAML structure error)
tsconfig.json TypeScript compiler configuration with strict mode enabled
vitest.config.ts Vitest configuration for unit tests
README.md Extension documentation with feature descriptions and usage examples (contains documentation inconsistencies)
PROFILES.md Profile management documentation and example configurations (contains command name inconsistencies)
CONFIG.md Comprehensive configuration reference for all available settings
samples/sample.sql Sample SQL file for testing formatter functionality
vsc-extension-quickstart.md Quick start guide for extension development (contains typo)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

assert.strictEqual(-1, [1, 2, 3].indexOf(5));
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
});
const cfg = vscode.workspace.getConfiguration('tsqlformatter');
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is incomplete and will cause a syntax error. It appears to be leftover code that should either be removed or completed as part of a test case. The variable cfg is declared but never used.

Suggested change
const cfg = vscode.workspace.getConfiguration('tsqlformatter');

Copilot uses AI. Check for mistakes.
JoelMiller74 and others added 6 commits December 4, 2025 23:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 5, 2025

@JoelMiller74 I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Repository owner deleted a comment from Copilot AI Dec 5, 2025
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@JoelMiller74 JoelMiller74 merged commit 18db3da into main Dec 6, 2025
3 checks passed
@JoelMiller74 JoelMiller74 deleted the initial-commit branch December 6, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants