Browse the handbook
Guides

Aner in VS Code

Install the editor extension, write source files, and use notebooks with an installed Aner executable.

Use VS Code to edit .aner source files and work in .anernb notebooks with code, Markdown, images, and saved results. The Aner extension supplies the editor features; an installed native Aner executable runs your programs.

This guide describes the current extension, 0.1.16. Public packages and supported platforms depend on the release. Check installation and availability, then use the binary and editor extension versions recommended together by that release.

Install the editor extension

  1. Install the native Aner package for your operating system and architecture by following the installation guide.
  2. Download the VSIX supplied with that release, or find it in the package's editor/ directory when included.
  3. In VS Code, open Extensions, choose … → Install from VSIX…, and select the supplied file.
  4. Run Developer: Reload Window from the Command Palette after installing or updating the extension.

The editor package described here is named aner-language-0.1.16.vsix. If the code command is available, you can also install it from the folder containing that downloaded file:

sh
code --install-extension aner-language-0.1.16.vsix --force

Use the filename supplied by your release when it differs. These instructions do not assume an extension Marketplace listing. The same VSIX supports VS Code on macOS, Windows, and Linux; the native executable must match the machine where execution happens. In a remote VS Code session, install the matching native executable and workspace extension on that remote machine.

Choose the installed executable

Open VS Code's integrated terminal and check:

sh
aner --version

If that command works and the extension has access to the same PATH, it can find the installed executable. For a predictable installation, open Settings, search for Aner: Notebook Executable, and set the full path to your installed aner executable. The setting key is aner.notebook.executable.

For example, if this is the actual location of your Linux installation:

json
{
    "aner.notebook.executable": "/home/you/.local/opt/aner/bin/aner"
}

On macOS, select the executable inside your installed Aner package in the same way. On Windows, select aner.exe; backslashes in JSON are escaped:

json
{
    "aner.notebook.executable": "C:\\Users\\you\\Apps\\Aner\\bin\\aner.exe"
}

Replace these example paths with your own installation location. An explicit setting takes priority over automatic discovery. You can set it for one workspace when different projects use different Aner releases. After moving or updating an installation, update the path and restart any running notebook session.

Write a source program

Open your own project folder with File → Open Folder…, create hello.aner, and save:

aner
let message = "Hello from Aner"
print(message)

The language mode in the lower right corner should read Aner. If it does not, click the language mode and choose Aner. A project can also explicitly associate its source files:

json
{
    "files.associations": {
        "*.aner": "aner"
    }
}

From the integrated terminal, with the project folder as the current directory:

sh
aner check hello.aner
aner run hello.aner

The first command checks the file without running it. The second prints Hello from Aner. Errors identify a source location when applicable. The editor's syntax colors do not replace static checking.

Create a notebook

Run Aner: New Notebook from the Command Palette. Save it as experiment.anernb inside your project folder. If prompted for a kernel, choose Aner — notebook.

Put this in the first code cell and run it:

aner
var a = 10

Put this in a second cell and run it:

aner
a = a + 5
print(a)

The second cell prints 15. New notebooks use shared variables, so values, imports, and definitions can remain available between cells. No fn main() is needed. Add Markdown cells for explanations, tables, or images. Choose Run All to execute the code cells in order.

Notebook execution requires a trusted workspace. Only trust a folder when you are comfortable executing its code. Viewing and editing notebooks remain available without trust.

To work through supplied examples, open the folder containing their examples/ directory. Start with shared variables, the concise Iris classifier, or concise object methods. Keep the example files and data paths together.

State, modes, and restart

Use Aner: Use Shared Variables for experiments split across cells. Use Aner: Use Independent Programs when every cell should run as a separate script or complete main program. The mode belongs to the whole notebook and is saved with it; selecting a kernel does not change it.

Changing modes clears live state and never reruns earlier cells. Aner: Restart Notebook Session also clears state. Run the defining cells again before using their values. Restart before changing or rerunning a function or class definition; those definitions cannot currently be replaced within a live session.

Syntax and type errors preserve earlier successful state. An execution error, Stop, timeout, notebook closure, or extension reload clears the session. Stop cancels execution; it is not a debugging pause. Saved notebook outputs may still be visible afterward, but saving or reopening does not restore variables. See notebook behavior and limits for the complete rules.

Colors and editing

Choose Preferences: Color Theme to switch between light and dark themes. Aner uses the active theme's syntax colors for keywords, types, functions, strings, numbers, and comments.

The extension supports line comments, matching brackets, automatic closing pairs, and snippets. Use Insert Snippet or type a snippet prefix such as fn, let, class, importdataset, or nnsequential, then select a suggestion. Syntax highlighting is available for source files and notebook code cells.

A language server, live variable explorer, inline training charts, and pause/step debugger are not included in the current extension. You can inspect results using program output, dataset/model summaries, and offline visual reports.

Troubleshooting

What you seeWhat to do
A notebook opens as JSONConfirm the Aner extension is installed. Run Developer: Reload Window, then Reopen Editor With… → Aner Notebook on the .anernb tab.
aner is not foundFollow the installation guide's PATH setup, restart VS Code, or set the full installed executable path in Aner: Notebook Executable.
The terminal works but notebook execution cannot find AnerVS Code may have a different environment. Set aner.notebook.executable to the absolute installed binary path.
A variable from another cell is unknownSelect Aner: Use Shared Variables, then rerun the defining cells. Also check whether Stop, an execution error, or a restart cleared state.
A class or function is already definedRun Aner: Restart Notebook Session, then Run All from the beginning.
An example cannot find its CSV fileOpen the folder containing examples/, or adjust the path relative to your current project folder.
The extension asks for a newer native binaryInstall the compatible binary recommended by the release; updating only the VSIX does not update Aner itself.
Saved output looks inconsistent with the edited codeRestart and run the cells in order. Automatic stale output detection is not implemented.

The extension runs with VS Code's own runtime and the installed native Aner executable.

Aner handbook · Guides and API reference