Comprehensive language support for SomonScript, the Tajik Cyrillic programming language that compiles to JavaScript.
- Keywords: All 100+ Tajik Cyrillic keywords with proper categorization
- Type Annotations: Complete support for type syntax (
: рақам,: сатр[],: T | беқимат) - Generics: Full generic type parameter highlighting (
<T>,<T, U>,<T мерос рақам>) - Advanced Operators:
- Optional chaining (
?.) - Nullish coalescing (
??) - Spread/Rest (
...) - Arrow functions (
=>) - Ternary operators (
? :) - Type operators (
|,&) - Increment/Decrement (
++,--)
- Optional chaining (
- Advanced Types: Union types, intersection types, tuple types, optional properties (
?) - Literals: Strings, template literals with
${}interpolation, numbers (including BigInt withnsuffix) - Comments: Single-line (
//) and multi-line (/* */) - Built-in Functions: Special highlighting for чоп.сабт, математика, etc.
- Identifiers: Proper recognition of Cyrillic and Latin identifiers
- Autocompletion: Smart suggestions for all SomonScript keywords
- Member Completions: Method and property suggestions after typing
.(саг.овоз_додан) - Inheritance Support: Shows inherited methods from parent classes
- Type-Aware: Infers types from variable declarations and class definitions
- Hover Information: View keyword documentation and JavaScript equivalents
- Real-time Diagnostics: Instant error and warning messages from the SomonScript compiler
- Signature Help: Parameter hints for functions
Over 30 production-ready snippets covering all TypeScript-equivalent features:
Basic Constructs:
тағйирёбанда- Variable declarationсобит- Constant declarationфунксия- Function declarationсинф- Class declarationинтерфейс- Interface declarationнавъ- Type alias
Advanced Features:
функсия<T>- Generic functionсинф<T>- Generic classинтерфейс<T>- Generic interfaceнавъ-ё- Union type alias (Type1 | Type2)навъ-ва- Intersection type alias (Type1 & Type2)ҷуфт- Tuple type declaration
Control Flow:
агар- If/else statementинтихоб- Switch statementбарои- For loopто- While loopкардан-то- Do-while loopбарои-дар- For-in loopбарои-аз- For-of loopкӯшиш- Try-catch-finally
Async/Promises:
ҳамзамон- Async functionҳамзамон-интизор- Async function with awaitваъда- Promise function
Modern JavaScript:
тир- Arrow function (single expression)тир-блок- Arrow function with blockшартӣ- Ternary operatorпахш- Spread operatorостӣ- Rest parametersтарқиш-объект- Object destructuringтарқиш-массив- Array destructuring`` - Template literal with interpolation
Import/Export:
ворид- Import statementсодир- Export statement
And more!
- Auto-closing: Automatic closing of brackets, quotes, and braces
- Bracket Matching: Visual matching of paired brackets
- Comment Toggling: Quick comment/uncomment with keyboard shortcuts
- Indentation: Smart indentation rules
- Folding: Code folding support with region markers
-
Prerequisites: Ensure SomonScript is built:
cd /path/to/Somon-Script npm install npm run build -
Install Extension Dependencies:
cd vscode-somonscript npm install -
Compile the Extension:
npm run compile
-
Install in VS Code:
- Press
F5to open a new VS Code window with the extension loaded (for development) - OR package and install:
npm install -g @vscode/vsce vsce package code --install-extension somonscript-0.1.0.vsix
- Press
(Coming soon)
- Create a file with
.somextension - Start writing SomonScript code
- Enjoy syntax highlighting, IntelliSense, and error checking!
// Эълон кардани тағйирёбанда
тағйирёбанда салом = "Салом, ҷаҳон!";
// Функсия бо параметрҳо
функсия ҳисоб(а: рақам, б: рақам): рақам {
бозгашт а + б;
}
// Синф
синф Корбар {
хосусӣ ном: сатр;
конструктор(ном: сатр) {
ин.ном = ном;
}
салом() {
чоп.сабт("Салом, " + ин.ном);
}
}
// Истифодаи синф
тағйирёбанда корбар = нав Корбар("Аҳмад");
корбар.салом();
- Toggle Comment:
Ctrl+/(Windows/Linux) orCmd+/(macOS) - Format Document:
Shift+Alt+F(Windows/Linux) orShift+Option+F(macOS) - Go to Definition:
F12 - Find All References:
Shift+F12 - Rename Symbol:
F2 - Show Hover:
Ctrl+K Ctrl+I(Windows/Linux) orCmd+K Cmd+I(macOS)
Configure the extension in your VS Code settings:
{
"somonscript.maxNumberOfProblems": 100,
"somonscript.trace.server": "off"
}somonscript.maxNumberOfProblems: Maximum number of problems to report (default: 100)somonscript.trace.server: Trace communication between VS Code and the language serveroff: No tracingmessages: Trace messages onlyverbose: Verbose tracing
тағйирёбанда→let(variable)собит→const(constant)
функсия/функция→functionбозгашт→returnҳамзамон→asyncинтизор→await
агар→ifвагарна→elseбарои→forто→toшикастан→breakдавом→continueинтихоб→switchҳолат→case
синф→classинтерфейс→interfaceнав→newин→thisсупер→superмерос→extendsтатбиқ→implementsконструктор→constructor
хосусӣ→privateмуҳофизатшуда→protectedҷамъиятӣ→publicстатикӣ→static
сатр→stringрақам→numberмантиқӣ→booleanнавъ→type
дуруст→trueнодуруст→falseхолӣ→nullбеқимат→undefined
ворид→importсодир→exportаз→fromдар→inпешфарз→defaultчун→as
кӯшиш→tryгирифтан→catchниҳоят→finallyпартофтан→throw
чоп.сабт→console.logчоп.хато→console.errorчоп.огоҳӣ→console.warn
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Run linter
npm run lint- Open the extension in VS Code
- Press
F5to start debugging - A new VS Code window will open with the extension loaded
- Open a
.somfile to test the extension
vscode-somonscript/
├── client/ # Language client
│ ├── src/
│ │ └── extension.ts # Extension activation
│ └── package.json
├── server/ # Language server
│ ├── src/
│ │ └── server.ts # LSP implementation
│ └── package.json
├── syntaxes/
│ └── somonscript.tmLanguage.json # TextMate grammar
├── snippets/
│ └── somonscript.json # Code snippets
├── language-configuration.json # Language config
├── package.json # Extension manifest
└── README.md
- Language server requires the SomonScript compiler to be built in the parent directory
- Error locations may not be precise if the compiler doesn't provide line/column information
This extension provides complete coverage for TypeScript-equivalent features:
✅ Primitives: number, string, boolean, null, undefined, bigint ✅ Complex Types: object, arrays, tuples, unions, intersections ✅ Functions: Regular, arrow, async, generic, with type annotations ✅ Classes: Inheritance, modifiers (private, public, protected, static), abstract, constructors ✅ Interfaces: Basic, generic, with inheritance ✅ Type System: Annotations, generics, union/intersection types, tuple types, optional properties ✅ Operators: All arithmetic, logical, bitwise, comparison, ternary, optional chaining, nullish coalescing, spread/rest ✅ Control Flow: if/else, switch/case, for, while, do-while, for-in, for-of, break, continue ✅ Error Handling: try/catch/finally, throw ✅ Async: async/await, Promise ✅ Modules: import/export with named, default, and namespace patterns ✅ Modern JS: Template literals, destructuring, spread/rest, arrow functions
- Complete TypeScript-equivalent syntax highlighting
- Comprehensive snippet library (30+ snippets)
- Generic types support
- Advanced operators (optional chaining, nullish coalescing)
- Template literal interpolation
- Publish to VS Code Marketplace
- Add code formatting support
- Implement go-to-definition
- Add find-all-references
- Improve error location precision
- Add support for multi-root workspaces
- Add debugging support
- Create extension icon
Contributions are welcome! Please see the main SomonScript repository for contribution guidelines.
MIT License - see the LICENSE file in the SomonScript repository.
Created for the SomonScript project - bringing programming to the Tajik language.
Бо забони тоҷикӣ барномарезӣ кунед!