The VS Code extension
The VS Code extension is what you install to write Novis in VS Code.
It colours a .nvs file when the file opens. It then starts nvs lsp and shows what that server returns: errors, completions, documentation and the place where a name is declared. You install it from the VS Code Marketplace or from Open VSX. Its id is novis-lang.nvs in both.
The extension uses the colours of your theme. nvs.path is the path to the nvs binary. When it is empty, the extension finds nvs on PATH. When nvs.lsp.enable is false, no server runs and the file has only its basic colours. The command Novis: Restart Language Server stops the server and starts it again.
In the file list, a file with one class shows C beside its name, and a file with routes shows R.
Good to know: the editor blurs a value that is written to a secret variable. Put the cursor in the value to read it. The blur updates after each answer from the server. Search results, the diff view and a copy show the real text. nvs.secrets.redact turns the blur off.
Examples
What the extension draws
<?nvs// Open this file in VS Code with the Novis extension installed.// Each comment says what the editor shows on the line below it.// The extension gets this information from `nvs lsp`, the Novis language server.
// `$apiKey` is a `secret` variable. The editor blurs its string when the file opens.// Hover the string and click `Reveal` to read it. `nvs.secrets.redact` turns the blur off.secret string $apiKey = 'sk-live-not-a-real-key';
// A `tainted` variable has a value from outside the program that is not checked yet.// The editor does not hide it. Set `nvs.taint.mark` to `declaration` to show a symbol after the name.tainted string $query = 'shoes';
// The extension colours `final`, `class` and the string in `line` as soon as the file opens.// Then `nvs lsp` tells it that `Receipt` is a class and `$cents` is a property.final class Receipt{ public int $cents = 0;
// Hover `Core\Str::format` to see what it does. The text comes from the compiler, // so you do not install any extra files. public function line(): string { return Core\Str::format('%d cents', $this->cents); }}
var $receipt = new Receipt();$receipt->cents = 1250;
// The blur only changes what the screen shows. The file still contains the real string,// so selecting, copying and editing it work as usual.echo $receipt->line(), "\n";1250 centsChangelog
| Version | Change |
|---|---|
0.0.6 | The VS Code extension restarts the language server when you rebuild nvs, change the setting nvs.path or run Novis: Restart Language Server. It stops the old server first, and then it starts the new one. While the new server starts, the Novis item in the status bar shows starting. |
0.0.6 | A button in VS Code opens the debug viewer in an editor tab or in your browser. The setting nvs.debugViewer.openIn chooses the tab or the browser. In the tab, a click on a file:line opens that file in the editor. |
