Skip to content

lang

The community/lang directory contains a collection of subdirectories, each dedicated to providing support for a specific programming language or markup language within Talon. Each subdirectory typically includes a .py file for the core logic and a .talon file for defining voice commands.

Here's a breakdown of the most important and interesting subdirectories:

  • rust: This directory provides support for the Rust programming language. The rust.py file defines the core logic, including lists of Rust keywords, types, and macros, as well as actions for inserting code structures, operators, and comments. The rust.talon file defines the voice commands that trigger these actions. Together, they allow users to write Rust code more easily with voice.
  • lua: This directory provides support for the Lua programming language. The lua.talon file defines the core Talon grammar for Lua, while the lua.py implements the actions, lists, and settings used by those commands. It also has a stylua.talon file to support the Stylua linter. These files enable voice control for writing Lua code with proper syntax and formatting.
  • terraform: This directory adds support for Terraform. The terraform.talon file contains the Talon commands for working with Terraform code, while terraform.py contains the Python implementation of the custom actions and lists used in the Talon file. This allows the user to insert Terraform blocks, properties, and operators using voice commands.
  • r: This directory provides support for the R programming language. The r.py file defines the core functionality for R support in Talon. The file includes lists of common R functions and libraries, and provides actions that are implemented by voice commands defined in r.talon. The files work together to provide voice control for R development.
  • sql: This directory contains files to add support for SQL in Talon. The sql.talon file defines voice commands for common SQL keywords and syntax, while sql.py defines the context for SQL, and adds actions for inserting operators, functions, and null values. This enables the user to write SQL using voice commands.
  • python: This directory provides comprehensive support for Python development. The python.py file defines lists of common Python functions, keywords, and exceptions, as well as actions for inserting code structures, operators, and comments. The python.talon file provides the voice commands and grammar for using these actions.
  • scala: This directory contains the Talon files for programming in Scala. The scala.py file defines the core functionality, including lists of Scala types and keywords, and actions for inserting code snippets. The scala.talon file configures the tags, settings, and phrases used when programming in Scala, and defines some simple voice commands.
  • proto: This directory adds support for Protocol Buffer language in Talon. The proto.py file defines a Talon context and the list of protobuf types. The proto.talon file defines the voice commands for interacting with protobuf code, including commands for specifying types.
  • php: This directory provides support for the PHP programming language. The php.py file defines actions for common PHP constructs like keywords, comments, operators, functions, and variables. The php.talon file defines the Talon grammar and settings for PHP, including tags and formatting options.
  • stata: This directory contains the files that add Stata language support to Talon. The stata.py file defines the core logic for Stata code, while the stata.talon file defines the voice commands that are used to insert Stata code.
  • csharp: This directory provides support for the C# programming language. The csharp.py file defines actions for common C# coding tasks, such as inserting operators, keywords, control flow statements, and functions. The csharp.talon file defines tags, settings, and some basic voice commands that activate functionality in the python file.
  • css: This directory contains the files to add CSS and SCSS support to Talon. The css.py file defines lists of CSS units, at-rules, and global values, as well as some basic actions. The css.talon file defines voice commands for inserting CSS properties, values, rules, and other syntax.
  • tags: This directory contains files that define tags, actions, and rules for various programming language constructs. The files in this directory are organized by concept, with each concept having a corresponding .py file that defines the actions and a corresponding .talon file that defines the voice commands. For example, the operators_math.py and operators_math.talon files enable the insertion of math operators using voice.
  • html: This directory provides support for HTML, JavaScript React, and TypeScript React. The html.talon file defines these three languages, indicating to Talon that files using these languages should be interpreted using the appropriate grammar.
  • java: This directory adds support for the Java programming language to Talon. The java.py file defines the context, lists of types and modifiers, and actions for inserting code snippets and operators. The java.talon file defines the voice commands for interacting with the code, and imports many tags from other locations.
  • c: This directory contains files that provide support for the C programming language. The c.talon file defines the core grammar for C, while the c.py file contains the Python code that supports the grammar, including lists of C elements, captures, and actions.
  • batch: This directory adds support for the Batch scripting language. The batch.py file defines the context, and the batch.talon file defines a set of voice commands for working with Batch files, including keywords, and a way to insert arguments.
  • ruby: This directory contains files that add support for the Ruby programming language. The ruby.talon file defines the language tag and basic tags, and the ruby.py file implements actions specific to Ruby code.
  • elixir: This directory provides support for the Elixir programming language. The elixir.py file defines the core functionality and actions, while the elixir.talon file defines the voice commands and language features specific to Elixir.
  • kotlin: This directory adds support for the Kotlin programming language. The kotlin.talon file defines the language tag and formatting rules, and kotlin.py defines the core functionality of the module with many methods to insert specific code elements and operators.
  • typescript: This directory contains files that add support for the TypeScript language. The typescript.talon file defines the voice commands for inserting type annotations and other constructs, and the typescript.py file defines the context, list of types, and actions.
  • talon: This directory provides extensions for editing and creating Talon code. It defines actions, lists, tags, and commands that aid in writing both .talon and .talon-list files. The talon.py file is the core, defining the logic and actions, while other files like talon_common.talon and talon_context.talon define voice commands for inserting specific Talon constructs.
  • javascript: This directory provides support for Javascript and Typescript development. The javascript.py file defines the core logic and actions for Javascript and Typescript, and the javascript.talon file provides the voice commands.
  • vimscript: This directory contains files that add support for the Vimscript language. The vimscript.py file defines the context, lists of functions and scopes, and actions for common tasks, while the vimscript.talon file defines the voice commands.
  • markdown: This directory provides support for the Markdown language in Talon. The markdown.talon file defines a set of voice commands for common markdown syntax, while markdown.py defines the context and list of supported languages for code blocks.

These subdirectories showcase a wide range of language support, and a consistent pattern of using a Python file for the logic and a Talon file for voice commands. The tags directory provides a reusable set of rules that can be included in other language modules, making it easier to extend the functionality of Talon with voice commands for different languages.