OberonDev

Overview

OberonDev is a simple Oberon development environment based on Sublime Text. It uses the command line tools of Astrobe’s Professional Edition to compile and link Oberon modules.

Enlarge for better details: click the button thing at the top right. Click again to get back.

Motivation

The need (or wish) to be able

  • to see and edit different modules side by side, with continuous consistency between all files;
  • to compile and link the same module set-up and edit status for different target MCUs.

Status

I have cobbled this together for my own needs. Everything works, but there are few guardrails for possible edge cases, faulty configurations, and the like. If I should get a run-time error, I simply fix the tool and go on. For this reason, the Sublime package is not (yet) in the repository.

Drop me a note if you’re interested, and I may add some of the guardrails and polish, and publish.

Prerequisites

The heavy lifting of compilation and linking is 100% done by Astrobe’s tools. All kudos for their functionality and speed go to them, or their creator, respectively. :)

Features

Multi-pane Code Editing

Open several program module files in panes that can be arranged in many different (and possibly crazy) ways – see the screenshot above.

Sublime’s looks can be customised using many of the available Themes and Colour Schemes, which can further be tweaked to one’s own preferences. Obviously, I have not done a lot of that yet. :)

Code Highlighting

An Oberon-specific syntax definition is used for code highlighting, see the screenshot above. The syntax definition only identifies scopes, such as keywords or procedure names, which are then coloured based on the Colour Scheme selected by the user (including their individual customisations, if any).

Multi-MCU Support

The Astrobe compiler and linker, as well as the UF2 creation and upload tools, to be used are selected and invoked from within the same editor window.

Same for the config files.

Based on the selected MCU (and thus compiler/linker variant) and the selected config file:

  • Compile Module: compile the module in the active (frontmost) text pane.
  • Compile Recursive:1 compile the module in the active (frontmost) text pane, plus also recursively all imported modules – if necessary.
  • Link: link the consistently compiled modules to an executable program binary.
  • Clean: delete all binary compilation results (symbol and object files) in the directories following the library search path in the current config file, in order to force a full recompilation of all modules.

Astrobe’s Build command corresponds to Compile Recursive plus Link, Rebuild to Clean plus Compile Recursive and Link. The command line tool AstrobeBuild.exe does what Compile Recursive does, ie. compile all modules, without linking. I like that separation.

Using makeuf2:

  • Make UF2 Binary: create the UF2 binary for the selected MCU
  • Make UF2 and Upload: create the UF2 and also upload to the Pico or Pico 2.

Command Shell

There can be one or more command shells directly in the editor window.

Error Tracking

The results of the compilation and linking are displayed in a separate output pane at the bottom.2

Compilation errors are also flagged inside the module text editing pane.

Double clicking on the error line in the output pane puts the cursor at the position indicated by the error message, and there are keyboard shortcuts for Next Error and Previous Error.

When a module and its imports are compiled (Build in Astrobe), and there’s an error in one of the imported modules, double clicking on the error line also brings the defective module’s text pane to the front, opening the file if necessary.

Change Tracking and Git Integration

Changes to the module texts are tracked against the version in the Git repository.

The project file list on the left hand side indicates changed and new module files (the yellowish-brown and green dots).

Changed lines and sections in the module text are indicated on the left hand side (yellow bars), and the changes can be inspected.

Find Definitions

Hovering over a symbol displays its possible definition locations.

Code Snippets

To quote N. Wirth (emphasis mine):

A programmer’s competence should be judged by the ability to find simple solutions, certainly not by productivity measured in “number of lines ejected per day.” Prolific programmers contribute to certain disaster.

So I mention this more for completeness, or as fun fact: we can define code snippets that get expanded.

When I type:

mod<tab>

I get this:

I then press backspace, and type “Module”, and voilà, the module name gets inserted at the beginning and at the end.

You can define all sorts of snippets, with tab positions to fill in the necessary program text. But I don’t think my productivity is limited by my typing speed. :)


  1. I don’t particularly like that menu command name, but haven’t been able to come up with something better. ↩︎

  2. If you’re eagle-eyed, you may have spotted a difference in the above compiler output from what you see inside Astrobe: the latter’s output gets patched on the fly to show the full path to the module file, in order to fit the structure of Sublime’s build system. ↩︎