Skip to content

Commit 9e1c6ec

Browse files
kirit93johnnygreco
andauthored
feat: Add Phase 1 languages (Bash, C, C++, C#, COBOL) to CodeLang (#271)
Add support for five high-priority programming languages to Data Designer's code generation capabilities: - **Bash**: Universal DevOps and automation scripting - **C, C++, C#**: Systems programming and enterprise development - **COBOL**: Legacy mainframe systems and modernization These languages address critical enterprise use cases including legacy code maintenance, systems programming, and infrastructure automation. Changes: - Add new CodeLang enum values for bash, c, cpp, csharp, cobol - Update code_lang_to_syntax_lexer() with Pygments lexer mappings - Update documentation to reflect new supported languages - Update tests to account for 21 total supported languages (up from 16) Co-authored-by: Johnny Greco <jogreco@nvidia.com>
1 parent fe5a1ec commit 9e1c6ec

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

docs/concepts/columns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Use **Jinja2 templating** in prompts to reference other columns. Data Designer a
4545

4646
LLM-Code columns generate code in specific programming languages. They handle the prompting and parsing necessary to extract clean code from the LLM's response—automatically detecting and extracting code from markdown blocks. You provide the prompt and choose the model; the column handles the extraction.
4747

48-
Supported languages: **Python, JavaScript, TypeScript, Java, Kotlin, Go, Rust, Ruby, Scala, Swift**, plus **SQL** dialects (SQLite, PostgreSQL, MySQL, T-SQL, BigQuery, ANSI SQL).
48+
Supported languages: **Bash, C, C++, C#, COBOL, Go, Java, JavaScript, Kotlin, Python, Ruby, Rust, Scala, Swift, TypeScript**, plus **SQL** dialects (SQLite, PostgreSQL, MySQL, T-SQL, BigQuery, ANSI SQL).
4949

5050
### 🗂️ LLM-Structured Columns
5151

packages/data-designer-config/src/data_designer/config/utils/code_lang.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77

88

99
class CodeLang(str, Enum):
10+
BASH = "bash"
11+
C = "c"
12+
COBOL = "cobol"
13+
CPP = "cpp"
14+
CSHARP = "csharp"
1015
GO = "go"
11-
JAVASCRIPT = "javascript"
1216
JAVA = "java"
17+
JAVASCRIPT = "javascript"
1318
KOTLIN = "kotlin"
1419
PYTHON = "python"
1520
RUBY = "ruby"
@@ -63,15 +68,21 @@ def code_lang_to_syntax_lexer(code_lang: CodeLang | str) -> str:
6368
Reference: https://pygments.org/docs/lexers/
6469
"""
6570
code_lang_to_lexer = {
71+
CodeLang.BASH: "bash",
72+
CodeLang.C: "c",
73+
CodeLang.COBOL: "cobol",
74+
CodeLang.CPP: "cpp",
75+
CodeLang.CSHARP: "csharp",
6676
CodeLang.GO: "golang",
67-
CodeLang.JAVASCRIPT: "javascript",
6877
CodeLang.JAVA: "java",
78+
CodeLang.JAVASCRIPT: "javascript",
6979
CodeLang.KOTLIN: "kotlin",
7080
CodeLang.PYTHON: "python",
7181
CodeLang.RUBY: "ruby",
7282
CodeLang.RUST: "rust",
7383
CodeLang.SCALA: "scala",
7484
CodeLang.SWIFT: "swift",
85+
CodeLang.TYPESCRIPT: "typescript",
7586
CodeLang.SQL_SQLITE: "sql",
7687
CodeLang.SQL_ANSI: "sql",
7788
CodeLang.SQL_TSQL: "tsql",

packages/data-designer-config/tests/config/utils/test_code_lang.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_parse_dialect():
2626

2727

2828
def test_supported_values():
29-
assert len(CodeLang.supported_values()) == 16
29+
assert len(CodeLang.supported_values()) == 21
3030

3131

3232
def test_code_lang_to_syntax_lexer():

0 commit comments

Comments
 (0)