|
1 | | -# Vitte Language Support |
| 1 | +# Vitte Language Support (Vitte/Vitl) — VS Code Extension |
2 | 2 |
|
3 | | -[](https://marketplace.visualstudio.com/items?itemName=VitteStudio.vitte-lang) |
4 | | -[](https://marketplace.visualstudio.com/items?itemName=VitteStudio.vitte-lang) |
5 | | -[](https://marketplace.visualstudio.com/items?itemName=VitteStudio.vitte-lang) |
| 3 | +[](https://marketplace.visualstudio.com/manage) |
6 | 4 | [](LICENSE) |
| 5 | + |
| 6 | + |
7 | 7 |
|
8 | | -Extension **Visual Studio Code** pour le langage **Vitte** : |
9 | | -coloration syntaxique, snippets, Language Server Protocol (LSP), et icônes personnalisées pour vos fichiers `.vitte` et `.vit`. |
| 8 | +Extension Visual Studio Code pour le langage **Vitte** et le dialecte **Vitl**. Coloration syntaxique, snippets, configuration de langage, **LSP** (auto-complétion, hover, go to definition, symboles, diagnostics, semantic tokens) et **thème d’icônes**. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Sommaire |
| 13 | +- [Fonctionnalités](#fonctionnalités) |
| 14 | +- [Formats pris en charge](#formats-pris-en-charge) |
| 15 | +- [Installation rapide](#installation-rapide) |
| 16 | +- [Utilisation](#utilisation) |
| 17 | +- [Paramètres](#paramètres) |
| 18 | +- [Arborescence du projet](#arborescence-du-projet) |
| 19 | +- [Développement](#développement) |
| 20 | +- [Build VSIX](#build-vsix) |
| 21 | +- [Publication Marketplace](#publication-marketplace) |
| 22 | +- [Exemples](#exemples) |
| 23 | +- [Dépannage](#dépannage) |
| 24 | +- [Feuille de route](#feuille-de-route) |
| 25 | +- [Contribuer](#contribuer) |
| 26 | +- [Licence](#licence) |
10 | 27 |
|
11 | 28 | --- |
12 | 29 |
|
13 | 30 | ## Fonctionnalités |
14 | 31 |
|
15 | | -- **Coloration syntaxique avancée** pour mots-clés, types, fonctions, opérateurs et macros |
16 | | -- **Snippets prêts à l’emploi** pour accélérer l’écriture de code |
17 | | -- **Diagnostics LSP** : |
18 | | - - Détection de `TODO`, `FIXME`, `???` |
19 | | - - Mise en évidence des espaces en fin de ligne |
20 | | - - Alerte sur les lignes trop longues |
21 | | -- **Complétion intelligente** : mots-clés et symboles définis dans le document |
22 | | -- **Infobulles (hover tooltips)** : documentation rapide des mots-clés |
23 | | -- **Navigation** : accès aux définitions et symboles du document |
24 | | -- **Icône personnalisée** pour les fichiers `.vitte` et `.vit` |
| 32 | +- **Deux langages** : `vitte` et `vitl`. |
| 33 | +- **Extensions de fichiers** : `.vitte`, `.vit` et `.vitl`. |
| 34 | +- **Coloration** : `syntaxes/vitte.tmLanguage.json` et `syntaxes/vitl.tmLanguage.json`. |
| 35 | +- **Snippets** : `snippets/vitte.json` et `snippets/vitl.json`. |
| 36 | +- **Configuration de langage** : `language-configuration.json` et `language-configuration-vitl.json` (optionnel). |
| 37 | +- **LSP intégré** (node): |
| 38 | + - Complétion, Hover, Go to Definition, Document Symbols |
| 39 | + - **Semantic Tokens** |
| 40 | + - Diagnostics : `TODO/FIXME`, `???`, espaces en fin de ligne, longueur de ligne |
| 41 | + - **Watchers**: `**/.vitteconfig`, `**/vitte.toml`, `**/.vitlconfig`, `**/vitl.toml` |
| 42 | + - **Sélecteurs** de documents : `vitte` et `vitl` (file + untitled) |
| 43 | + - **Options d’exécution** : |
| 44 | + - `VITTE_LSP_PATH` pour pointer vers un binaire serveur externe |
| 45 | + - `VITTE_LSP_INSPECT` pour activer l’inspection Node (ex. `6009`) |
| 46 | +- **Thème d’icônes** : `icons/vitte-icon-theme.json`. |
| 47 | +- **Compatibilité** : VS Code `^1.75.0`, Node 18+ recommandé. |
25 | 48 |
|
26 | 49 | --- |
27 | 50 |
|
28 | | -## Installation |
| 51 | +## Formats pris en charge |
29 | 52 |
|
30 | | -### Depuis le Marketplace |
31 | | -1. Ouvrir **Visual Studio Code** |
32 | | -2. Aller dans l’onglet **Extensions** |
33 | | -3. Rechercher : **Vitte Language Support** |
34 | | -4. Cliquer sur **Installer** |
| 53 | +| Langage | Extensions | Scope TextMate | Snippets | |
| 54 | +|---|---|---|---| |
| 55 | +| Vitte | `.vitte`, `.vit` | `source.vitte` | `snippets/vitte.json` | |
| 56 | +| Vitl | `.vitl` | `source.vitl` | `snippets/vitl.json` | |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Installation rapide |
35 | 61 |
|
36 | 62 | ### Depuis un fichier `.vsix` |
37 | | -Si vous avez construit le package localement : |
38 | 63 | ```bash |
39 | | -code --install-extension vitte-lang-0.2.0.vsix |
| 64 | +# racine du dépôt |
| 65 | +npm ci |
| 66 | +npx tsc -p ./client && npx tsc -p ./server |
| 67 | +mkdir -p dist |
| 68 | +npx @vscode/vsce package -o dist/vitte-lang-$(jq -r .version package.json).vsix |
| 69 | + |
| 70 | +# installation locale |
| 71 | +code --install-extension dist/*.vsix |
| 72 | +``` |
| 73 | + |
| 74 | +### Depuis le Marketplace |
| 75 | +1) Créer un **Personal Access Token** (Azure DevOps → User settings → *Personal access tokens* → scope `Marketplace > Manage`). |
| 76 | +2) Se connecter : `npx vsce login VitteStudio` (coller le PAT). |
| 77 | +3) Publier : `npx vsce publish` ou `npx vsce publish 0.3.0`. |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## Utilisation |
| 82 | + |
| 83 | +- Ouvrir un fichier `*.vitte`, `*.vit` ou `*.vitl`. |
| 84 | +- Activer le LSP si désactivé par défaut : `F1 → Preferences: Open Settings (JSON)` puis : |
| 85 | + |
| 86 | +```json |
| 87 | +{ |
| 88 | + "vitte.enableLSP": true, |
| 89 | + "vitte.trace.server": "off" |
| 90 | +} |
| 91 | +``` |
| 92 | + |
| 93 | +> Le serveur propage aussi une section `vitl` si vous l’ajoutez dans vos settings, ex.: |
| 94 | +```json |
| 95 | +{ "vitl": { "enableSemanticTokens": true } } |
| 96 | +``` |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## Paramètres |
| 101 | + |
| 102 | +Paramètres déclarés dans `package.json` (section `contributes.configuration`): |
| 103 | + |
| 104 | +- `vitte.enableLSP` (`boolean`, défaut `false`) : active le serveur de langage. |
| 105 | +- `vitte.trace.server` (`"off" | "messages" | "verbose"`, défaut `off`) : niveau de trace LSP. |
| 106 | + |
| 107 | +Paramètres dynamiques vus côté serveur (non déclarés dans `contributes`) : |
| 108 | +- `vitl.enableSemanticTokens` (`boolean`, défaut `true` si non défini). |
| 109 | + |
| 110 | +Variables d’environnement utiles : |
| 111 | +- `VITTE_LSP_PATH` : chemin d’un serveur LSP externe (binaire). |
| 112 | +- `VITTE_LSP_INSPECT` : port d’inspection Node pour le LSP, ex. `6009`. |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## Arborescence du projet |
| 117 | + |
| 118 | +``` |
| 119 | +VitteLangVsCode/ |
| 120 | +├── .vscode/ |
| 121 | +│ ├── launch.json |
| 122 | +│ ├── tasks.json |
| 123 | +│ └── extensions.json |
| 124 | +├── package.json |
| 125 | +├── tsconfig.json |
| 126 | +├── README.md |
| 127 | +├── CHANGELOG.md |
| 128 | +├── icon.png |
| 129 | +│ |
| 130 | +├── client/ |
| 131 | +│ ├── src/extension.ts # LSP client (vitte + vitl) |
| 132 | +│ └── out/ |
| 133 | +│ |
| 134 | +├── server/ |
| 135 | +│ ├── src/server.ts # LSP server (vitte + vitl) |
| 136 | +│ └── out/ |
| 137 | +│ |
| 138 | +├── syntaxes/ |
| 139 | +│ ├── vitte.tmLanguage.json |
| 140 | +│ └── vitl.tmLanguage.json |
| 141 | +│ |
| 142 | +├── snippets/ |
| 143 | +│ ├── vitte.json |
| 144 | +│ └── vitl.json |
| 145 | +│ |
| 146 | +├── icons/ |
| 147 | +│ └── vitte-icon-theme.json |
| 148 | +│ |
| 149 | +├── language-configuration.json |
| 150 | +├── language-configuration-vitl.json |
| 151 | +│ |
| 152 | +└── scripts/ |
| 153 | + ├── build.sh |
| 154 | + └── release.sh |
| 155 | +``` |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +## Développement |
| 160 | + |
| 161 | +Prérequis : Node 18+, npm, VS Code ≥ 1.75. |
| 162 | + |
| 163 | +```bash |
| 164 | +# installer |
| 165 | +npm ci |
| 166 | + |
| 167 | +# builder (TS → JS) |
| 168 | +npx tsc -p ./client && npx tsc -p ./server |
| 169 | + |
| 170 | +# lancer en mode extension (F5) avec .vscode/launch.json |
| 171 | +# option debug serveur |
| 172 | +export VITTE_LSP_INSPECT=6009 |
| 173 | +``` |
| 174 | + |
| 175 | +### Scripts utiles |
| 176 | +- `npm run compile` : compile `client` et `server` via `tsc`. |
| 177 | +- `npm run watch` : compilation incrémentale en watch. |
| 178 | +- `npm run build:vsix` : compile + check + package en `.vsix`. |
| 179 | +- `npm run publish` : compile + publication Marketplace. |
| 180 | + |
| 181 | +--- |
| 182 | + |
| 183 | +## Build VSIX |
| 184 | + |
| 185 | +### Unix |
| 186 | +```bash |
| 187 | +npm ci |
| 188 | +npx tsc -p ./client && npx tsc -p ./server |
| 189 | +mkdir -p dist |
| 190 | +VSIX="dist/vitte-lang-$(jq -r .version package.json).vsix" |
| 191 | +npx @vscode/vsce package -o "$VSIX" |
| 192 | +unzip -p "$VSIX" extension/package.json | jq -r '.name, .publisher, .version' |
| 193 | +code --install-extension "$VSIX" |
| 194 | +``` |
40 | 195 |
|
| 196 | +### Windows (PowerShell) |
| 197 | +```powershell |
| 198 | +npm ci |
| 199 | +npx tsc -p ./client; npx tsc -p ./server |
| 200 | +if (!(Test-Path dist)) { New-Item -ItemType Directory dist | Out-Null } |
| 201 | +$ver = (Get-Content package.json | ConvertFrom-Json).version |
| 202 | +$vsix = "dist/vitte-lang-$ver.vsix" |
| 203 | +npx @vscode/vsce package -o $vsix |
| 204 | +code --install-extension $vsix |
| 205 | +``` |
| 206 | + |
| 207 | +--- |
41 | 208 |
|
42 | | -👉 Lien direct : [Vitte Language Support — Marketplace](https://marketplace.visualstudio.com/items?itemName=VitteStudio.vitte-lang) |
| 209 | +## Publication Marketplace |
43 | 210 |
|
44 | | -### Depuis un `.vsix` |
45 | | -Si vous avez construit le package localement : |
46 | 211 | ```bash |
47 | | -code --install-extension vitte-lang-0.2.0.vsix |
| 212 | +# connexion (1ère fois) |
| 213 | +npx vsce login VitteStudio |
| 214 | + |
| 215 | +# publier version exacte |
| 216 | +npx vsce publish 0.3.0 |
| 217 | + |
| 218 | +# ou bump auto |
| 219 | +npx vsce publish patch # ex. 0.3.1 |
| 220 | +npx vsce publish minor # ex. 0.4.0 |
| 221 | +``` |
| 222 | + |
| 223 | +Erreurs fréquentes et correction : |
| 224 | +- `The version 0.2.0 already exists and cannot be modified` → **incrémenter** la version (`npm version patch --no-git-tag-version`), re-packager, republier. |
| 225 | +- `ENOENT .vsix` lors de l’installation → vérifier le **répertoire** d’exécution et l’option `-o` de `vsce package`. |
| 226 | +- `tsc not found` → `npm i -D typescript` et utiliser `npx tsc` (éviter le paquet `tsc` qui n’est pas TypeScript). |
| 227 | + |
| 228 | +--- |
| 229 | + |
| 230 | +## Exemples |
| 231 | + |
| 232 | +### `examples/hello.vitte` |
| 233 | +```vitte |
| 234 | +module demo |
| 235 | +
|
| 236 | +pub fn main() { |
| 237 | + let msg: string = "Hello Vitte" |
| 238 | + print(msg) |
| 239 | +} |
| 240 | +``` |
| 241 | + |
| 242 | +### `examples/hello.vitl` |
| 243 | +```vitl |
| 244 | +module demo |
| 245 | +
|
| 246 | +fn main(): void { |
| 247 | + let msg: string = "Hello Vitl" |
| 248 | + println(msg) |
| 249 | +} |
| 250 | +``` |
| 251 | + |
| 252 | +--- |
| 253 | + |
| 254 | +## Dépannage |
| 255 | + |
| 256 | +- **LSP ne démarre pas** : vérifier la console des extensions et le canal “Vitte/Vitl LSP”. |
| 257 | + - Assurer la présence de `server/out/server.js` (`npm run compile`). |
| 258 | + - Pour un serveur externe : définir `VITTE_LSP_PATH` vers le binaire. |
| 259 | +- **Coloration manquante** : contrôler `syntaxes/*.tmLanguage.json` et l’association d’extensions dans `package.json`. |
| 260 | +- **Snippets absents** : vérifier les fichiers `snippets/*.json` et les chemins `contributes.snippets`. |
| 261 | +- **Publisher invalide** : `publisher` de `package.json` doit correspondre au **publisher Marketplace** (`VitteStudio`). |
| 262 | + |
| 263 | +--- |
| 264 | + |
| 265 | +## Feuille de route |
| 266 | + |
| 267 | +- Formatteur (`DocumentRangeFormatting`) |
| 268 | +- Renommage symboles |
| 269 | +- Inlay hints et code lenses |
| 270 | +- Tests end-to-end via `@vscode/test-electron` |
| 271 | +- Télémétrie opt-in |
| 272 | + |
| 273 | +--- |
| 274 | + |
| 275 | +## Contribuer |
| 276 | + |
| 277 | +Issues et PRs bienvenues : <https://github.com/vitte-lang/vscode-vitte>. |
| 278 | +Style : TypeScript strict, commits clairs, CI verte. |
| 279 | + |
| 280 | +--- |
| 281 | + |
| 282 | +## Licence |
48 | 283 |
|
| 284 | +MIT. Voir `LICENSE`. |
0 commit comments