Skip to content

scala

The community/lang/scala directory contains the Talon files for programming in Scala.

The file scala.py defines the core functionality for Scala programming within Talon. It sets up a context that is activated when the user is coding in Scala (code.language: scala). It defines lists for common Scala types, modifiers, and keywords, making them available for use in voice commands. This file also implements many actions used to insert code snippets, such as operators, control flow statements, and comments. Most of these actions simply insert the necessary characters or use existing Talon actions to move the cursor and achieve the desired result.

The file scala.talon configures the tags, settings, and simple phrases used when programming in Scala. It enables several tags related to imperative programming, object-oriented programming, C-like syntax, and specific code features like comments, boolean data, null values, functions, libraries, and operators. This allows other Talon files to target specific tags (e.g. user.code_functions) and have consistent functionality across different languages. It also sets formatting conventions for function and variable names. Lastly, this file defines simple phrases to make coding quicker, such as "op right arrow" to insert " -> " and "state match" to insert match { with the cursor in the proper place.