CCL Language Support for VS Code
A comprehensive VS Code extension providing syntax highlighting, IntelliSense, and code formatting for CCL (Cerner Command Language).
Features
🎨 Syntax Highlighting
- Full CCL syntax highlighting with TextMate grammar
- Support for keywords, functions, data types, operators, and comments
- Proper color coding for different language elements
🧠 IntelliSense
- Auto-completion for CCL keywords, functions, and data types
- Context-aware suggestions based on cursor position
- Function signatures with parameter hints
- Hover documentation for functions and keywords
- Automatic code formatting with configurable options
- Indentation management for control structures
- Keyword case conversion (upper/lower/preserve)
- Configurable indentation size
⚙️ Configuration
- Enable/disable formatting and IntelliSense
- Customizable indentation size
- Keyword case preferences
- Language-specific settings
Installation
- Install the extension from the VS Code marketplace
- Open a
.ccl or .prg file
- The extension will automatically activate
Usage
File Associations
The extension automatically associates with:
Commands
CCL: Format CCL Document - Format the entire document
- Right-click context menu: "Format Document" when editing CCL files
Configuration Options
Add these settings to your VS Code settings.json :
{
"ccl.format.enable": true,
"ccl.format.indentSize": 2,
"ccl.format.keywordCase": "upper",
"ccl.intellisense.enable": true
}
Configuration Details
ccl.format.enable (boolean, default: true)
- Enable or disable CCL code formatting
ccl.format.indentSize (number, default: 2)
- Number of spaces to use for indentation
ccl.format.keywordCase (string, default: "upper")
- Case for SQL keywords: "upper", "lower", or "preserve"
ccl.intellisense.enable (boolean, default: true)
- Enable or disable IntelliSense for CCL
Supported CCL Features
Keywords
- Control flow:
IF , ELSE , WHILE , FOR , CASE , BEGIN , END
- SQL operations:
SELECT , INSERT , UPDATE , DELETE , FROM , WHERE
- Joins:
JOIN , LEFT JOIN , RIGHT JOIN , INNER JOIN , OUTER JOIN
- Functions:
COUNT , SUM , AVG , MIN , MAX , CAST , CONVERT
Data Types
- Numeric:
INT , BIGINT , DECIMAL , FLOAT , REAL
- String:
CHAR , VARCHAR , TEXT
- Date/Time:
DATE , TIME , DATETIME , TIMESTAMP
- Other:
BOOLEAN , BIT , BINARY , XML , JSON
Functions
- Date/Time:
GETDATE , CURRENT_TIMESTAMP , YEAR , MONTH , DAY
- String:
SUBSTRING , LEN , UPPER , LOWER , REPLACE
- Mathematical:
ROUND , CEILING , FLOOR , ABS , POWER
- Aggregate:
COUNT , SUM , AVG , MIN , MAX
Development
Building the Extension
- Clone the repository
- Install dependencies:
npm install
- Compile TypeScript:
npm run compile
- Package the extension:
vsce package
Project Structure
├── src/
│ ├── extension.ts # Main extension entry point
│ ├── completionProvider.ts # IntelliSense provider
│ ├── hoverProvider.ts # Hover documentation provider
│ └── formatter.ts # Code formatting provider
├── syntaxes/
│ └── ccl.tmLanguage.json # TextMate grammar for syntax highlighting
├── language-configuration.json # Language configuration
├── package.json # Extension manifest
└── tsconfig.json # TypeScript configuration
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This extension is licensed under the MIT License.
Support
For issues, feature requests, or questions:
- Open an issue on GitHub
- Check the documentation
- Review the configuration options
Changelog
Version 1.0.0
Initial release
Syntax highlighting for CCL
IntelliSense with auto-completion
Code formatting with configurable options
Hover documentation for functions and keywords
Language configuration for CCL files
Developed By - Noah William Lim, a Developer at LHSC
| |