Skip to content

Features

Kazaï edited this page Dec 18, 2024 · 1 revision

Features

This document describes the features supported by this extension.

Table of Contents

Highlighting

The default syntax highlighting for gno files is implemented in Visual Studio Code using TextMate grammar, not by this extension.

Formatting

Format code and organize imports, either manually or on save.

The extension formats gno code, organizes imports, and removes unused imports by default. For different behavior.

  • Organizing imports When organizing imports, the imported packages are grouped in the default gnoimports style.

IntelliSense

  • Code completion: Suggestions appear as you type.
  • Signature help: Displays function parameters as you type.
  • Quick info: Shows documentation when hovering over symbols.

Transpile

Supports compiling or transpiling Gno code into executable formats, enabling easier deployment or testing.

Clean

Removes unnecessary or temporary files generated during development. This helps to maintain a tidy workspace.

Gno Test

Test Package

Runs all unit tests in a specified Gno package to verify the functionality of the entire module.

Test File

Executes all tests within a specific gno test

Test Function

Test a specific function

Test At Cursor

Executes the test case where the cursor is currently placed in the code editor.

Maketx

Publish Gno package/realm to the chain. gnokey needs to be installed for this feature to work.

Mod init

Create gno.mod file

Find References

Find or go to the references of a symbol.

Find Implementations

Find the concrete types that implement a given interface.

Go to implementations for Server

Go to definition

Jump to or peek a symbol's declaration.

Call Hierarchy

Show all calls from or to a function.

Show call hierarchy and investigate callers of a function

Toggle Between Code And Tests

Quickly toggle between a file and its corresponding test file by using the Gno: Toggle Test File command.

Toggle between reverse.go and reverse_test.go

Add Import

The extension organizes imports automatically and can add missing imports if the package is present in your module cache already.

Rename all occurrences of a symbol in your workspace.

Note: For undo after rename to work on Windows, you need to have diff tool on your PATH.

This feature is not available if you are using without gnopls, the Go language server.

Rename an exported variable in gno

Refactor

Select the area for refactoring (e.g. variable, function body, etc). Click on the Code Action light bulb icon that appears in the selected area, or select "Refactoring..." or "Rename Symbol" from the VS Code Context menu.