From 8f7d42687f9c5043fa779c4191e772720eb7b9b9 Mon Sep 17 00:00:00 2001 From: "Zi Chen (from Dev Box)" Date: Wed, 28 May 2025 10:56:28 -0700 Subject: [PATCH] Add instructions for Copilot --- .github/copilot-instructions.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..4bc4b25 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,9 @@ +ScriptDom is a library for parsing and generating T-SQL scripts. It is primarily used by DacFx to build database projects, perform schema comparisons, and generate scripts for deployment. + +T-SQL syntax definitions are defined in the .g files in SqlScriptDom/Parser/TSql/. The file names map to SQL Server versions, e.g. TSql170.g corresponds to the syntax definitions for SQL Server 2025, TSql160.g to SQL Server 2022, etc. Syntax for Azure SQL Database should always be based on the latest SQL Server version. + +The grammar files are in ANTLR v2 format. C# code is generated from these grammar files as part of the build process. + +For each new syntax definition, ScriptDom needs to be able to parse it successfully, and roundtrip back to the original script via the script generator. + +Changes need to have accompanying tests in Only170SyntaxTests.cs or the one for its respective version. The test framework should already verify the parser and script generator; you just need to add the test scripts to TestScripts and corresponding Baselines folder. Older syntaxes should be supported unless explicitly stated otherwise. \ No newline at end of file