Skip to content

Commit 8445094

Browse files
author
meshya
committed
init and end?
0 parents  commit 8445094

13 files changed

+2702
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
*.vsix
3+
.vscode-test

.vscode-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { defineConfig } = require('@vscode/test-cli');
2+
3+
module.exports = defineConfig({ files: 'out/test/**/*.test.js' });

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// A launch configuration that launches the extension inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
]
15+
}
16+
]
17+
}

.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
.vscode-test/**
3+
.gitignore
4+
vsc-extension-quickstart.md

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "cyrus-lang" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2025 meshya
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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+

language-configuration.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"comments": {
3+
"lineComment": "//",
4+
"blockComment": ["/*", "*/"]
5+
},
6+
"brackets": [
7+
["{", "}"],
8+
["[", "]"],
9+
["(", ")"]
10+
],
11+
"autoClosingPairs": [
12+
{ "open": "{", "close": "}" },
13+
{ "open": "[", "close": "]" },
14+
{ "open": "(", "close": ")" },
15+
{ "open": "\"", "close": "\"" },
16+
{ "open": "'", "close": "'" }
17+
],
18+
"surroundingPairs": [
19+
{ "open": "{", "close": "}" },
20+
{ "open": "[", "close": "]" },
21+
{ "open": "(", "close": ")" },
22+
{ "open": "\"", "close": "\"" },
23+
{ "open": "'", "close": "'" }
24+
],
25+
"folding": {
26+
"markers": {
27+
"start": "^\\s*//\\s*#region\\b",
28+
"end": "^\\s*//\\s*#endregion\\b"
29+
}
30+
},
31+
"onEnterRules": [
32+
{
33+
"beforeText": "^\\s*(?:fn|struct|impl|if|else if|else|for|match).*?\\{\\s*$",
34+
"action": {
35+
"indentAction": "Indent"
36+
}
37+
},
38+
{
39+
"beforeText": "^\\s*\\}",
40+
"action": {
41+
"indentAction": "Outdent"
42+
}
43+
}
44+
]
45+
}

0 commit comments

Comments
 (0)