Skip to content

csharp

This directory provides comprehensive support for programming in C# using Talon voice commands. It defines C#-specific syntax, syntax formatters, operators, and common functions.

How C# Support Works

When you are editing a file recognized as C# (code.language: csharp), Talon activates the configuration and actions defined in this directory. These files work in tandem to map generic programming concepts (such as "print" or "is null") to their exact C# syntax implementations.

The directory is composed of the following three files:

  • csharp.talon: Sets up the environment for C# programming. It activates generic programming tags (such as user.code_imperative, user.code_object_oriented, comment tags, and various operator sets) and configures naming-style formatters. For instance, private functions and variables default to PRIVATE_CAMEL_CASE, while public and protected counterparts default to PUBLIC_CAMEL_CASE.
  • csharp.py: Contains the logic for C#-specific operations. It defines an Operators mapping for assignment, bitwise math, lambda expressions (=>), pointer operations, and subscripting. It also implements standard code actions, such as generating object accessors (.), inserting null checks, and scaffolding method signatures (e.g., private static void ...) using the formatters declared in the settings.
  • code_common_function.talon-list: Maps generic voice commands for common operations to C# specific methods. For example:
    • The command for "integer" maps to int.TryParse
    • The command for "print" maps to Console.WriteLine
    • The command for "string" maps to .ToString