Skip to content
Open
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
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ This will be disabled only for the git repository you're currently on.

### Editor Setup

For editor configuration and LSP support, see
[github.com/gnoverse/gnopls](https://github.com/gnoverse/gnopls).
See [docs/resources/editor-setup.md](./docs/resources/editor-setup.md) for
configuring your editor with LSP support, autocompletion, and formatting
for `.gno` files.

## Reporting Issues

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Learn about core concepts found in Gno.land & Gno.
- [Storage Deposit](resources/storage-deposit.md) - Learn how storage deposits work, including costs, refunds, and cleanup incentives in Gno.land.
- [Standard libraries](resources/gno-stdlibs.md) - An overview of the standard libraries found in the Gno language and how they enhance blockchain functionality.
- [Configuring Gno Projects](resources/configuring-gno-projects.md) - Using gnomod.toml & gnowork.toml to configure your Gno packages.
- [Editor Setup](resources/editor-setup.md) - Configure your editor with LSP support, autocompletion, and formatting for `.gno` files.
- [Testing Gno](resources/gno-testing.md) - Learn how to run and test Gno code locally using the built-in testing framework.
- [Working with Realms](resources/realms.md) - Working with realms and environment variables.
- [Interrealm Specification](resources/gno-interrealm.md) - Understand how inter-realm communication works.
Expand Down
2 changes: 2 additions & 0 deletions docs/builders/local-dev-with-gnodev.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ git clone git@github.com:gnolang/gno.git
cd gno && make install
```

For editor configuration and LSP support, see the [Editor Setup](../resources/editor-setup.md) guide.

## Overview

In this tutorial, you will learn how to run up a local development node with
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/configuring-gno-projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ such as a remote chain.

<!-- TODO: allow configuration of dependency source priority/hierarchy -->

Note: `gnowork.toml` support is a work in progress for `gnodev` and `gnopls`.
Note: `gnowork.toml` support is a work in progress for `gnodev` and `gnopls`. See [Editor Setup](editor-setup.md) to wire `gnopls` into your editor.

#### Cleaning the dependency cache

Expand Down
90 changes: 90 additions & 0 deletions docs/resources/editor-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Editor Setup

This guide helps you configure your editor for working with `.gno` files —
autocompletion, go-to-definition, diagnostics, and formatting.

## Table of contents

- [Language server (gnopls)](#language-server-gnopls)
- [Official plugins](#official-plugins)
- [Community plugins](#community-plugins)
- [Formatting and linting](#formatting-and-linting)
- [Contributing](#contributing)

## Language server (gnopls)

[gnopls](https://github.com/gnoverse/gnopls) is the Gno language server — a
fork of [gopls](https://github.com/golang/tools/tree/master/gopls) adapted for
Gno. It works with any editor that supports the
[Language Server Protocol](https://microsoft.github.io/language-server-protocol/) (LSP)
and provides completions, go-to-definition, references, diagnostics,
formatting, and more.

> **VS Code users:** skip this — the [Gno for VS Code](https://marketplace.visualstudio.com/items?itemName=Gnoverse.gnolang) extension installs `gnopls` automatically.

Install the Gno toolchain first (`make install` from a clone of
[gnolang/gno](https://github.com/gnolang/gno)), then:

```sh
go install github.com/gnoverse/gnopls@latest
```

Verify with `gnopls version`.

## Official plugins

### VS Code

Install the [Gno for VS Code](https://marketplace.visualstudio.com/items?itemName=Gnoverse.gnolang)
extension. Open any `.gno` file to activate it — the **⚡** icon in the
status bar confirms the language server is running. `gnopls` is installed
automatically on first run.

See the [extension docs](https://github.com/gnoverse/vscode-gno) for
configuration options and commands.

## Community plugins

### Neovim

Use [gno.nvim](https://github.com/x1unix/gno.nvim) for out-of-the-box LSP
integration, or set up the built-in LSP client manually — see the
[gnopls Neovim instructions](https://github.com/gnoverse/gnopls#using-neovim-built-in-lsp).

### Vim

Connect `gnopls` via [vim-lsp](https://github.com/prabirshrestha/vim-lsp).
See the [gnopls Vim instructions](https://github.com/gnoverse/gnopls#using-vim-lsp).

### Emacs

Use [lsp-mode](https://github.com/emacs-lsp/lsp-mode) with a `gno-mode`
derived from `go-mode`. See the
[gnopls Emacs instructions](https://github.com/gnoverse/gnopls#emacs).

### Zed

Install the [zed-gno](https://github.com/julienrbrt/zed-gno) extension.

### Sublime Text

See the [gnols](https://github.com/jdkato/gnols) language server
for Sublime Text setup.

## Formatting and linting

Editors with gnopls wired up already use `gno fmt` as the formatter. You
can also run these CLI tools directly, or bind them to save hooks:

```sh
gno fmt ./... # format .gno files
gno lint ./... # lint .gno files
```

## Contributing

Using Gno with an editor not listed here? Open a PR to add setup
instructions — see [CONTRIBUTING.md](../../CONTRIBUTING.md).

Bug reports and feature requests for the language server belong in the
[gnopls issue tracker](https://github.com/gnoverse/gnopls/issues).
1 change: 1 addition & 0 deletions docs/users/power-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Power up your Gno.land journey with these tools:

- [Gno Studio](https://gno.studio/) - Web IDE for Gno development
- [Gno Studio Connect](https://gno.studio/connect) - Interact with any Gno.land app with a web wallet
- [Editor Setup](../resources/editor-setup.md) - Configure your editor with LSP support
- [Gno Playground](https://play.gno.land/) - Try Gno code in your browser
- [Faucet Hub](https://faucet.gno.land/) - Get testnet tokens

Expand Down
1 change: 1 addition & 0 deletions misc/docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"resources/storage-deposit",
"resources/gno-stdlibs",
"resources/configuring-gno-projects",
"resources/editor-setup",
"resources/gno-testing",
"resources/realms",
"resources/gno-interrealm",
Expand Down
Loading