Перейти до вмісту

Цю сторінку ще не перекладено, тому її показано англійською.

Tern plugin

Elide in Tern: tests, builds, help, servers and the REPL as native terminal views, plus project workspaces, a debugger, coverage, diagnostics and traces.

Експериментально

Експериментально
Ця функція експериментальна: її команди, параметри та вивід можуть змінюватися між версіями. Повідомити про проблему

Читати офлайнelide help --lang uk tern

На цій сторінці

Type elide test in a Tern terminal and the results draw in the pane as a live view: totals, each test’s status, the failure under the one you select. elide build, elide help, elide serve and elide repl do the same. The Elide plugin for Tern adds the rest of a project workflow: a workspace per elide.pkl, a debugger, a source editor with coverage, debug and diagnostics overlays, a trace waterfall for served apps and a notebook where JavaScript and Python share values.

Install

Install the plugin → on macOS on Apple Silicon: check the release, unpack it, run install.sh. With the plugin installed, continue with the tour.

See it

Each clip is a recording of the plugin in Tern.

TernTests inline in the terminal0:06elide test in a Tern terminal draws live results inline: totals, each test's status and duration, and failures.
TernBuild diagnostics in the source editor0:18The workspace's Build button opens the Build page; Open takes an error to the Elide source editor, which marks it in the gutter, underlines it and prints the message beside the line.
TernStep through a program0:13In the Elide source editor, set a breakpoint with F9, launch with F5 and step into a call; the Debug panel shows the call stack and, on request, the values.
TernCoverage in the source editor0:09In the Elide source editor, F5 runs the tests with coverage and tints covered, uncovered and partly covered lines.
TernTrace waterfall0:15The serve dashboard captures the server's OpenTelemetry spans locally: pick a request and read its trace as a waterfall.
TernShared values across languages0:14In the Elide REPL, define a value in JavaScript, switch to Python with Ctrl+L and use it there: every language shares one notebook kernel.

The Installation page takes it from here.

The tour

Commands become views

Five commands you already type draw native views in any Tern terminal, with no plugin needed. elide test and elide build draw inline and stay in scrollback when they finish; --surface=screen gives them the whole pane. elide help opens the docs as a page with navigation and search; elide serve opens the Server page; elide repl draws an editor with a language picker. Pipe or redirect any of them and you get plain text, as anywhere else. Details and keys: Terminal surfaces.

One tab per project

Open project workspace turns a directory with elide.pkl into a Tern tab: Files, an editor, a terminal in the project root and a toolbar with Build project, Run tests, Run project, Debug, Source, Open REPL and Serve project files. Test runs are shared: every Tests view of the project, and Tern’s agent, see the same runs. elide:// links on file names and failure locations open the file at the line. Details: Project workspace.

Stop at the failing line

Debug this test on the Tests page launches the failing JavaScript or TypeScript test with a breakpoint at its failure line. In the source editor, F9 sets a breakpoint, F5 launches, F10 and F11 step, and values are read when you ask for them. Python sources debug the same way. Details: Debugging.

Which lines ran

Run with coverage (c) adds a Coverage tab with line and branch totals, the measured files and n/p to jump between uncovered lines. The source editor tints covered, partly covered and uncovered rows while you keep editing. Details: Coverage.

Compiler errors as cards

Each javac and kotlinc error, warning and note becomes a card with its source excerpt and an Open link. The source editor marks the line in the gutter, underlines the column and prints the message beside it; F8 moves to the next. Details: Build diagnostics.

Traces beside the server

elide serve in Tern captures the served app’s spans and logs locally. Pick a request and read its trace as a waterfall while your own exporters keep sending to their destinations. Details: Traces.

One notebook, several languages

Open REPL opens a notebook for JavaScript, Python, Kotlin, CEL and Pkl. Define const y = {"hi": 5} in JavaScript, switch to Python with Ctrl+L, and y.hi returns 5. Details: REPL notebook.

Palette commands

The plugin’s commands are in Tern’s command palette under Elide.

CommandOpens
Open project workspaceThe workspace for the project around the focused pane.
Project actionsThe project menu.
Run testsThe Tests page for a project directory or test file you enter.
View project test runsThe project’s recent test runs.
Debug project sourceThe debugger on the open source file, or its target picker.
Open Elide source viewA project file in Elide’s source editor.
Open REPLA notebook session; Open js REPL and Open python REPL start in that language.
Serve directory or scriptThe Server page for a directory or script you enter.

See also

Чи була ця сторінка корисною?