Skip to content

visualstudio

The community/apps/visualstudio directory contains files that provide Talon voice control for the Visual Studio IDE on Windows.

The most important files in this directory are:

  • visual_studio_win.py: This file defines the core functionality for Visual Studio on Windows. It defines Talon actions for app, code, edit, and user contexts. It includes actions like closing tabs, navigating between tabs, toggling comments, indenting code, saving all files, and working with multiple cursors (using the MultiCaretBooster extension). The actions are defined in a context that matches when the operating system is Windows and the application is Visual Studio.

  • visual_studio.py: This file defines the application definition for Visual Studio on Windows, and adds additional actions for app, code, edit, win, and user contexts. Many of the same actions are repeated as in visual_studio_win.py, but there are also actions for jumping to a specific line, and interacting with the "find" and "replace" dialogs in visual studio. It defines the app.visual_studio that is used in other files in the apps/visualstudio directory. It also defines a win.filename() action that attempts to extract the file name from the window title using string manipulation. It also contains actions for finding text and replacing text, including the ability to perform project wide search and replace.

  • visual_studio.talon: This file defines the voice commands for Visual Studio. It provides commands for common IDE actions such as opening panels, showing settings, toggling fullscreen, creating files, and debugging. It leverages the actions defined in the other python files to execute these commands via voice. It also includes tags to enable other Talon modules like user.tabs, user.line_commands, user.find_and_replace, and user.multiple_cursors. This allows for a more modular approach to voice control.

These files work together to provide a comprehensive voice control solution for Visual Studio. The .py files define the actions, and the .talon file defines the voice commands that trigger those actions. The context matching ensures that actions are only available when Visual Studio is the active application on Windows.