Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,40 @@ All notable changes to the **VS Code Aster** extension will be documented in thi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.10.0] - 2026-04-27

A broad LSP and IDE-experience pass: cave-driven catalog resolution, a TypeScript-style hover layer, context-aware autocompletion, edit-time diagnostics with quick fixes, a `.comm` formatter, a guided setup flow, and a new activity-bar panel that doubles as a command dictionary. The status bar slims to an icon and Output channels are grouped under a single `code_aster:` prefix.

### Added

- **Catalog from cave** — the language server now reads its catalog directly from the Docker image of the cave-selected code_aster version (extracted on demand to `~/.cache/vs-code-aster/catalogs/<version>/` and cached). A bundled 16.7 catalog ships as a zero-config fallback, so the editor still works when Docker / cave aren't installed. The selection follows `~/.cave` live and an in-memory reconcile clears orphan caches when an image is removed.
- **Cave version picker** — right-aligned status-bar item modeled on VS Code's Python interpreter chip. Shows the current version, click to switch / install / remove. Install runs `cave use <v>` with `y` piped in and reports progress through phases (Pulling / Downloading / Extracting / Finalizing). Cancellable.
- **Guided setup flow** — a one-shot toast chain on first `.comm` / `.export` open walks the user through Python LSP deps (auto-installed into a managed venv at `<globalStorage>/.venv`), ruff, Docker, cave, and a code_aster image. Each step is opt-in with `Install` / `Not now` / `Don't ask again`, and the new `code_aster: Run setup checks` command re-fires the chain.
- **Activity-bar sidebar panel** with seven groups: Setup (`Setup (n/5)`, top when failing, bottom when healthy), Quick actions (filtered per active editor), Command browser (only when a `.comm` is active), Versions, Settings, External links, and the bottom Setup. The brand mark gets a tightened monochrome icon for the activity bar plus light/dark variants for in-tree use.
- **Command browser** — five canonical families (Mesh / Material / BC & Loads / Analysis / Output), each listing the file's commands first (✓) then the rest of the catalog dim. Title-bar action runs a fuzzy `Cmd+P`-style QuickPick over every catalog command. Reads from `CommandRegistry` so it updates live without saving.
- **Hover rewrite** — TypeScript-style cards inside a `python` code fence (signature → description → details → doc link). Required vs optional read as Python defaults, BLOC branches filter by the parameters already typed at the call site, `regles` rules render as a bullet list, and the doc link points at `demo-docaster.simvia-app.fr/versions/v17/`. Surfaces the `translation={...}` short labels when present and is locale-aware (FR / EN via `LANG`). Variants for command, keyword, allowed-value literal, factor marker, plain-Python variable assignment, and legacy-command notes.
- **Context-aware autocompletion** — forward scanner replaces the old backward one (no longer confused by mid-edit unmatched quotes). Detects nested `_F(...)` scopes, suggests allowed `into` values when the cursor is in a value position, suggests previously-defined variables compatible with the SIMP's expected class (resolves callable `sd_prod` via `__all__=True`), and filters already-typed kwargs at every depth (not just the outer call). Snippet inserts: `LIRE_MAILLAGE($0)`, `KEY=$0`, `KEY=_F($0)` — each retriggers the popup. Trigger characters expanded to `(`, `,`, `=`, space; client-side hide-then-trigger keeps the suggest widget from sticking on "No suggestions".
- **Edit-time diagnostics** for `.comm` files with quick-fix code actions: unknown command, unknown keyword, value not in `into`, missing required keyword, `regles` violations, undefined variable, type mismatch, and a soft information note for legacy commands. Quick fixes offer fuzzy-matched replacements (Levenshtein) and allowed-value swaps. Wrapped end-to-end so a CATA quirk can never block hover, completion, or formatting.
- **`.comm` formatter** via `python -m ruff format --quote-style=preserve --line-length=100`. First-open prompt offers to install ruff with one click into the managed venv; PEP-668 retry with `--user`.
- **`.comm` syntax grammar overhaul** — TextMate rules rewritten around a `function-call` begin/end block with a nested `parens` sub-block so `_F(...)`, tuples, and multi-line kwargs all color correctly. Lowercase scientific notation, Python constants (`None`/`True`/`False`), and lowercase kwarg names are now recognized. Single-quote auto-close added; `wordPattern` keeps `_` attached.
- **External links group** in the sidebar (Star on GitHub, Rate on Marketplace, Browse code_aster website / documentation, Visit simvia.tech). Always at the bottom, always expanded.

### Changed

- **Status bar** down to a single icon: `$(symbol-namespace)` neutral when 3+ command families are present in the file, `$(circle-outline)` warning-tinted otherwise. Click opens and expands the sidebar's Command browser group.
- **Output channels** unified under a `code_aster:` prefix — `code_aster: Language Server` (replaces the misleading `Python Language Server`), `code_aster: Catalog`, `code_aster: Formatter`. LSP error toasts updated accordingly.
- **Language aliases** are now `code_aster (comm)` and `code_aster (export)`.
- **Hover layout**: signature first, then italic description, then details and rules, then doc-link footer. Drops the per-keyword inline `# …` doc strings to keep the signature scannable.
- **Dream background** off by default for new users (existing explicit-on choices preserved).

### Fixed

- LSP `restart()` no longer recreates the `LanguageClient`, so hover / completion / code-action providers don't duplicate after `cave use`. Server env (catalog path) is refreshed by mutating `serverOptions.options.env` in place before bouncing.
- Sidebar and status bar wait for an `LspServer.onReady` event to re-probe, so the Command browser populates without a file switch even when the LSP starts after activation.
- Stale `~/.cave` selections (image removed via `docker rmi`) now correctly fall back to the bundled catalog. The trash button on the version picker also clears the matching extracted-catalog cache.
- `.comm` `CommandRegistry` falls back to a full reparse when a single-line edit is outside any tracked command, so newly-typed top-level commands register immediately.
- `pip install` for ruff / LSP deps no longer passes `--user` unconditionally (broke venv installs); retried with `--user` only on PEP-668 errors.

## [1.9.2] - 2026-04-23

Better rendering for 1D meshes and a flatter, more readable face shading.
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cff-version: 1.9.2
cff-version: 1.10.0
title: VS Code Aster
message: >-
If you use this software, please cite it using the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center"><img src="https://raw.githubusercontent.com/simvia-tech/vs-code-aster/main/media/images/simvia.png" alt="Simvia Logo" width="50%" /></p>

<p align="center">
<a href="/"><img src="https://img.shields.io/badge/version-1.9.2-blue" alt="Version" /></a>
<a href="/"><img src="https://img.shields.io/badge/version-1.10.0-blue" alt="Version" /></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-GPL%203.0-green" alt="License" /></a>
<a href="https://github.com/simvia-tech/vs-code-aster/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/simvia-tech/vs-code-aster/ci.yml?branch=main&label=CI" alt="CI Status" /></a>
<a href="https://github.com/simvia-tech/vs-code-aster/issues"><img src="https://img.shields.io/github/issues/simvia-tech/vs-code-aster?label=issues" alt="GitHub issues" /></a>
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The extension aims to reduce friction between modeling, validation, execution, and analysis by bringing **code_aster** native workflows into the editor.

## Current Capabilities (v1.9.2)
## Current Capabilities (v1.10.0)

- `.export` file generator
- 3D mesh viewer
Expand Down
6 changes: 4 additions & 2 deletions language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
{ "open": "(", "close": ")" },
{ "open": "[", "close": "]" },
{ "open": "{", "close": "}" },
{ "open": "\"", "close": "\"" }
]
{ "open": "\"", "close": "\"" },
{ "open": "'", "close": "'" }
],
"wordPattern": "(-?\\d*\\.\\d\\w*)|([A-Za-z_][A-Za-z0-9_]*)"
}
18 changes: 18 additions & 0 deletions media/images/activity-bar-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions media/images/code-aster-icon-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions media/images/code-aster-icon-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 81 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vs-code-aster",
"displayName": "VS Code Aster",
"version": "1.9.2",
"version": "1.10.0",
"description": "VS Code extension for code_aster",
"publisher": "simvia",
"license": "GPL-3.0",
Expand Down Expand Up @@ -67,6 +67,36 @@
"title": "Restart the LSP server for code_aster",
"icon": "$(sync~spin)"
},
{
"command": "vs-code-aster.showCatalogInfo",
"title": "Show code_aster catalog info"
},
{
"command": "vs-code-aster.selectCaveVersion",
"title": "Select code_aster version (cave)"
},
{
"command": "vs-code-aster.runSetup",
"title": "Run code_aster setup checks"
},
{
"command": "vs-code-aster.sidebar.refresh",
"title": "Refresh code_aster panel",
"icon": "$(refresh)"
},
{
"command": "vs-code-aster.commandBrowser.search",
"title": "Search code_aster commands",
"icon": "$(search)"
},
{
"command": "vs-code-aster.commandBrowser.openDoc",
"title": "Open code_aster command documentation"
},
{
"command": "vs-code-aster.commandBrowser.focus",
"title": "Focus code_aster command browser"
},
{
"command": "vs-code-aster.addToMedExtensions",
"title": "Open as MED mesh",
Expand All @@ -80,7 +110,7 @@
{
"id": "comm",
"aliases": [
"Aster Commands"
"code_aster (comm)"
],
"extensions": [
".comm",
Expand All @@ -105,7 +135,7 @@
{
"id": "export",
"aliases": [
"Aster Export"
"code_aster (export)"
],
"extensions": [
".export"
Expand Down Expand Up @@ -143,6 +173,24 @@
"path": "./syntaxes/export.tmLanguage.json"
}
],
"viewsContainers": {
"activitybar": [
{
"id": "vs-code-aster",
"title": "code_aster",
"icon": "./media/images/activity-bar-icon.svg"
}
]
},
"views": {
"vs-code-aster": [
{
"id": "vs-code-aster.sidebar",
"name": "code_aster",
"icon": "./media/images/activity-bar-icon.svg"
}
]
},
"customEditors": [
{
"viewType": "vs-code-aster.medViewer",
Expand All @@ -169,6 +217,18 @@
}
],
"menus": {
"view/title": [
{
"command": "vs-code-aster.commandBrowser.search",
"when": "view == vs-code-aster.sidebar",
"group": "navigation@1"
},
{
"command": "vs-code-aster.sidebar.refresh",
"when": "view == vs-code-aster.sidebar",
"group": "navigation@2"
}
],
"editor/title": [
{
"command": "vs-code-aster.exportDoc",
Expand Down Expand Up @@ -199,6 +259,11 @@
}
]
},
"configurationDefaults": {
"[comm]": {
"editor.wordBasedSuggestions": "off"
}
},
"configuration": {
"title": "VS Code Aster",
"type": "object",
Expand Down Expand Up @@ -250,6 +315,18 @@
"default": "python3",
"markdownDescription": "Specifies the python executable used to run the language server."
},
"vs-code-aster.formatter": {
"order": 2.6,
"type": "string",
"default": "ruff",
"markdownDescription": "Formatter for `.comm` files. Use `ruff` (default) to format via `python -m ruff format` using the interpreter at `#vs-code-aster.pythonExecutablePath#`, `off` to disable formatting, or any custom shell command (e.g. `black - -q`) that reads source on stdin and writes the formatted result to stdout."
},
"vs-code-aster.asterCatalogPath": {
"order": 2.5,
"type": "string",
"default": "",
"markdownDescription": "Optional path to a local `code_aster` directory (must contain a `Cata/` subdirectory) whose catalog should be used by the language server. When empty, the extension auto-detects the cave-selected version and extracts the catalog from the corresponding Docker image; if that fails, it falls back to the bundled catalog."
},
"vs-code-aster.maxRunLogs": {
"order": 3,
"type": "integer",
Expand Down Expand Up @@ -362,7 +439,7 @@
"vs-code-aster.viewer.dreamBackground": {
"order": 22,
"type": "boolean",
"default": true,
"default": false,
"markdownDescription": "Cosmetic animated EDF orange and blue light blobs slowly breathing behind the mesh. Purely decorative — does not affect mesh lighting."
},
"vs-code-aster.viewer.autoRotate": {
Expand Down
Loading
Loading