|
| 1 | +# CyrusLang VS Code Extension |
| 2 | + |
| 3 | +This is a Visual Studio Code extension that provides syntax highlighting, code folding, and basic editor support for the **CyrusLang** programming language. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Syntax highlighting for keywords, variables, types, strings, numbers, and comments. |
| 8 | +- Code folding using `#region` and `#endregion`. |
| 9 | +- Automatic indentation and bracket matching. |
| 10 | +- Auto-closing and surrounding pairs for `{}`, `[]`, `()`, `"` and `'`. |
| 11 | +- Single-line (`//`) and multi-line (`/* */`) comments. |
| 12 | + |
| 13 | +## Getting Started |
| 14 | + |
| 15 | +Follow these steps to install and use the extension: |
| 16 | + |
| 17 | +### 1. Clone the Repository |
| 18 | + |
| 19 | +```bash |
| 20 | +git clone <repository-url> |
| 21 | +cd cyruslang-vscode-extension |
| 22 | +``` |
| 23 | + |
| 24 | +### 2. Open in VS Code |
| 25 | + |
| 26 | +```bash |
| 27 | +code . |
| 28 | +``` |
| 29 | + |
| 30 | +### 3. Install Dependencies |
| 31 | + |
| 32 | +Install the `vsce` tool if you don't already have it: |
| 33 | + |
| 34 | +```bash |
| 35 | +npm install -g @vscode/vsce |
| 36 | +``` |
| 37 | + |
| 38 | +### 4. Package the Extension |
| 39 | + |
| 40 | +Run the following command to create a `.vsix` file: |
| 41 | + |
| 42 | +```bash |
| 43 | +vsce package |
| 44 | +``` |
| 45 | + |
| 46 | +### 5. Install the Extension |
| 47 | + |
| 48 | +- Open Visual Studio Code. |
| 49 | +- Go to the Extensions view (`Ctrl+Shift+X`). |
| 50 | +- Click on the `...` menu in the top right corner and select **Install from VSIX**. |
| 51 | +- Select the generated `.vsix` file from the previous step. |
| 52 | + |
| 53 | +### 6. Use the Extension |
| 54 | + |
| 55 | +- Open a file with the `.cyrus` extension. |
| 56 | +- Enjoy syntax highlighting and editor support for CyrusLang! |
| 57 | + |
| 58 | +## Language Features |
| 59 | + |
| 60 | +### Syntax Highlighting |
| 61 | +- **Keywords**: `if`, `else`, `for`, `match`, `fn`, `struct`, etc. |
| 62 | +- **Types**: `i32`, `f64`, `string`, `bool`, `range`, etc. |
| 63 | +- **Variables**: Variables prefixed with `#`. |
| 64 | +- **Constants**: `true`, `false`, `nil`. |
| 65 | +- **Strings**: Single and double-quoted strings, with escape sequences. |
| 66 | + |
| 67 | +### Comments |
| 68 | +- Single-line: `// This is a comment` |
| 69 | +- Multi-line: |
| 70 | + ```cyrus |
| 71 | + /* |
| 72 | + * This is a |
| 73 | + * multi-line comment |
| 74 | + */ |
| 75 | + ``` |
| 76 | + |
| 77 | +### Code Folding |
| 78 | +Use the following markers for custom folding: |
| 79 | +```cyrus |
| 80 | +// #region |
| 81 | +// Code here... |
| 82 | +// #endregion |
| 83 | +``` |
| 84 | + |
| 85 | +### Auto-closing and Surrounding Pairs |
| 86 | +- `{}`, `[]`, `()`, `"`, `'`. |
| 87 | + |
| 88 | +### Indentation |
| 89 | +Automatic indentation for blocks like: |
| 90 | +```cyrus |
| 91 | +fn example() { |
| 92 | + if (condition) { |
| 93 | + // Indented block |
| 94 | + } |
| 95 | +} |
| 96 | +``` |
| 97 | + |
| 98 | +## File Types |
| 99 | + |
| 100 | +This extension is designed for files with the `.cy` extension. |
| 101 | + |
| 102 | +## Contributing |
| 103 | + |
| 104 | +Contributions are welcome! To contribute: |
| 105 | +1. Fork the repository. |
| 106 | +2. Create a feature branch. |
| 107 | +3. Submit a pull request with a detailed description. |
| 108 | + |
| 109 | +## License |
| 110 | + |
| 111 | +This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details. |
| 112 | + |
| 113 | +## Feedback |
| 114 | + |
| 115 | +If you encounter any issues or have suggestions, feel free to open an issue in the repository. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +Happy coding in **CyrusLang**! |
| 120 | + |
0 commit comments