Skip to content

ESV — Editor Service Specification

The Editor Service (ESV) language is a declarative meta-language for configuring the editor services of a language.Most editor services are configured in an ESV file. This way the following editor services can be defined:

Reference Sources

Structure

ESV files end with the .esv extension, and are by convention placed in the editor/ folder of a language project. Each ESV file defines a module for the file, followed by import statements and then the main configuration sections. Each section consists of a number of keys and values. For example, the following ESV code fragment configures the syntax highlighting for a language, based on the types of tokens:

module color

colorer

  keyword    : 153 51 153
  identifier : black
  string     : 177 47 2
  number     : 17 131 22
  operator   : black
  layout     : 63 127 95 italic

Main File

By convention, the main ESV file of a language project must live at editor/Main.esv (default) or editor/main.esv. Other ESV files can be (transitively) imported from the main ESV file.

Module Definition

An ESV file starts with a module definition at the top of the file:

module $ModuleName

The module name is the filename of the ESV file without the exttension, and relative to the editor/ directory. For example, the module editor/mylang/Syntax.esv would have the following module name:

module mylang/Syntax

Module names can only contains the alphanumeric characters and dash, underscore, and period, and use the forward slash (/) as the path separator.

Module names cannot be in parent directories, so ../Syntax is not allowed.

Imports

The imports section is an optional section immediately following the module definition. When specified it is given as:

imports
    $Imports

For example, to import editor/Syntax.esv and editor/Analysis.esv:

imports
    Syntax
    Analysis

Imports are transitive.

At most one imports section is permitted. When specified, the imports section cannot be empty.

Configuration Sections

The main body of an ESV file consists of any number of configuration sections. An example of a configuration section is:

language
  line comment:  "//"
  block comment: "/*" "*/"

The configuration sections are hard-coded in the ESV language, but mostly use a consistent syntax for the keys and values.

The following configuration sections are currently defined:

The following sections have been deprecated:

  • analysis
  • builders
  • completions
  • folding
  • outliner
  • refactorings

Sources

The sources of ESV can be found at:


Last update: October 17, 2024
Created: October 17, 2024