Skip to content

Bogolang 0.2.0 is out. It is an early version, for trial. See what is not proven

bogolang
FR

Documentation

Bogolang in other editors

The language server, bogo lsp, in Neovim, Emacs and other editors: the set-up, what was tried, the limits.

All documentation pages

Since 0.2.0 Bogolang carries a language server, bogo lsp. An editor starts it and talks to it while you work. It gives the mistakes as you type, the type under the mouse, completion and go to the definition. It never runs a program and never contacts the network.

VS Code needs none of this page: its extension starts the server by itself (vscode.md). This page is for an editor whose client for the Language Server Protocol (LSP) is built in.

What an editor must be told

What Value
The command bogo lsp. It speaks LSP on its standard input and output
The files Those whose name ends in .bogo
The root folder The folder of the project, the one that holds bogo.toml. For a file outside a project, its own folder

One setting is optional. Give it in the initialization options of the client:

Option Meaning
checkDelay Milliseconds to wait after the last change before the check. Default 1000

The server reads a file only through the editor. A text with no file name, or a file whose name does not end in .bogo, gets nothing: save it as a .bogo file first.

Neovim 0.11 or later

Add these lines to your init.lua:

vim.filetype.add({ extension = { bogo = "bogo" } })

vim.lsp.config("bogolang", {
  cmd = { "bogo", "lsp" },
  filetypes = { "bogo" },
  root_markers = { "bogo.toml", ".git" },
  init_options = { checkDelay = 1000 },
})

vim.lsp.enable("bogolang")
  • The first line gives .bogo files the file type bogo. The server starts for that type.
  • root_markers names the files that mark the root folder. When neither is found, the client still starts, with no root folder.
  • init_options is sent to the server as its initialization options. Leave it out to keep the default.

The keys Neovim gives an LSP client by itself: K shows the type under the cursor, CTRL-] goes to the definition, CTRL-X CTRL-O in insert mode opens the completion, and CTRL-W d shows the mistake under the cursor.

Emacs 29 or later

Emacs 29 carries Eglot, its LSP client. Add these lines to your init.el:

(define-derived-mode bogo-mode python-mode "Bogolang"
  "Mode for Bogolang files: the layout and colours of Python, the rest from bogo lsp.")

(add-to-list 'auto-mode-alist '("\\.bogo\\'" . bogo-mode))

(with-eval-after-load 'eglot
  (add-to-list 'eglot-server-programs '(bogo-mode . ("bogo" "lsp"))))

(add-hook 'bogo-mode-hook #'eglot-ensure)
  • The mode is built on python-mode, not on prog-mode. A Bogolang file is laid out as Python is, so you get Python's indentation and Python's colours. prog-mode would give neither.
  • add-to-list puts the entry first in eglot-server-programs. Keep it so: that list already holds entries for python-mode, and a mode built on it could match one of them.
  • The hooks you set for python-mode run in bogo-mode too.
  • To give checkDelay, write the entry as (bogo-mode . ("bogo" "lsp" :initializationOptions (:checkDelay 1000))).

Eglot shows the mistakes with Flymake. M-. goes to the definition, C-M-i opens the completion, and the type under the cursor shows in the echo area.

What was tried

The two set-ups above were tried on 26 November 2026, on Windows, in Neovim 0.12.6 and in Emacs 31.1. Each editor was a portable copy, driven by a script and not by a person. The lines of this page were used as they stand, with the full path of bogo.exe in place of bogo.

In both editors:

  • The file Links.bogo of See that it works got the file type bogo in Neovim and the mode bogo-mode in Emacs, and the server started.
  • With 3 changed to "three", the mark came on line 7 with the message "this value is a str, but the variable is declared as int".
  • The type of gw on the last line came back as gw: IP. Go to the definition went to gw on line 6. Completion offered the names of the file, built-in names such as ping, and statement words such as retry.
  • The editor gave the server its process number at the start. The value of checkDelay reached the server: with 5000 in place of 1000, the mark came 2.5 to 4 seconds later.
  • When the editor was killed without a word to the server, the server and its worker were gone within 2 seconds.

In Neovim, the keys K, CTRL-], CTRL-X CTRL-O and CTRL-W d were found set for the file, by asking Neovim, not by pressing them. In Emacs, Eglot came with Emacs, with no package to install. The entry of this page was the one chosen for bogo-mode, not an entry for Python. M-. and C-M-i were found bound to the definition and to the completion.

Not tried: a person at the keyboard; what the screen shows, such as the marks, the echo area of Emacs, the lists and the colours; Linux and macOS; other versions of the two editors, among them Neovim 0.11 and Emacs 29 and 30. The server itself was also tried with VS Code and with test clients written from the protocol (not-proven.md).

What works and what does not

It gives How
The mistakes The check of bogo check, with the same text and help. A check runs when a file is opened, when it is saved, and checkDelay after the last change. The check sees the open texts of all .bogo files, also those not saved yet
The type under the mouse For a name, a method or a field: its type, such as gw: IP. For a literal: what it is, such as 50ms is a Duration. For a built-in name: its signature and the first lines of its text. For a statement word, such as retry or watch: its form and the section of the language reference
Completion After a dot, the members of the type before it. Elsewhere, the names of the file, the built-in names, the keywords of Python and the statement words that may stand there
Go to the definition For a name of the file, or of another .bogo file of the project or of the folder

The limits:

  • No colours of Bogolang. The colours of the VS Code extension are written in the format of VS Code only. Neovim, with the lines above, shows the file with no colours. Emacs, with the mode built on python-mode, shows Python's colours: a literal such as 192.0.2.0/24 or 50ms is not coloured as one value, and a statement word such as retry is not coloured as a keyword.
  • A type you wrote after a colon is not answered. In link: Link, the mouse on Link gives nothing, and go to the definition goes nowhere. A built-in type there, such as IP, shows its text.
  • Completion offers more than it should. Away from a dot, it offers the names of every method of the file, not only those of the method you are in.
  • Go to the definition goes nowhere for a built-in name, such as ping, and for a name of a Python package or of Python itself.
  • Types come from the last check that reached the type checker. A line you have changed since then shows no type, no completion after a dot and no definition until the next check ends. A file stopped by a rule of Bogolang, such as a loose line outside any class, shows no type at all until that mistake is mended. A mistake of type does not stop the types.
  • After a dot, a receiver in brackets, such as (a + b)., gets no completion.
  • A definition in another .bogo file is given as that file was when it was last checked.
  • The server does not tidy a file. For that, an editor can run bogo fmt --stdin FILE (vscode.md).

See that it works

Make a file Links.bogo in an empty folder:

Bogolang
edition 2027

class Links:
    @staticmethod
    def main(args: list[str]) -> None:
        gw: IP = 192.0.2.1
        n: int = 3
        print(gw, n)

Open it in the editor. Then change 3 to "three". A mark comes under "three" two to three seconds after you stop typing, with a message that a str is not an int. The very first check on a PC takes longer. Put the cursor on gw in the last line and ask for the type: it says gw: IP.

For a closer look, watch the list of processes. While the file is open you see the server, bogo lsp, and the worker it starts for the checks. When you close the editor, both are gone within a few seconds. If the editor ends without a word to the server, the server ends by itself within 10 seconds, when the editor gave it its process number at the start.

When nothing happens

  • bogo is not on the PATH of the editor. An editor started from a menu, or before Bogolang was installed, may not see the PATH of your terminal. Give the full path in place of bogo: %LOCALAPPDATA%\Bogolang\bin\bogo.exe on Windows, with the variable written out, and ~/.local/bin/bogo on Linux, with ~ written out. In Lua and in Emacs Lisp a Windows path may be written with / in place of \.
  • The Bogolang is older than 0.2.0. Type bogo version. An older version has no lsp command, and the server cannot start. Install 0.2.0 or later.
  • The file kind is not set. In Neovim, :set filetype? must say filetype=bogo, and :checkhealth vim.lsp lists the clients that run. In Emacs, the mode line must say Bogolang, and M-x eglot-events-buffer shows what Eglot and the server said to each other.