

The second example stores a value that you could use with a when clause to check if the number of cool open things is greater than 2. The first example below sets the key myExtension.showM圜ommand to true, which you can use in enablement of commands or with the when property. If you are authoring your own VS Code extension and need to enable/disable commands, menus, or views by using a when clause context and none of the existing keys suit your needs, then you can add your own context. Editor and explorer context menus render enablement/disablement items while the Command Palette filters them. Last, menus showing commands, like the Command Palette or context menus, implement different ways of dealing with enablement. Preventing cluttered menus is highly recommended. The when clause prevents clutter, by not showing the command for all other language files. For example, a command that analyzes a JavaScript regular expression should show when the file is JavaScript and be enabled only when the cursor is over a regular expression.
#Visual studio code for mac fd ids full#
The latter is used to prevent menus full of disabled items.

Note: There is semantic overlap between enablement and the when condition of menu items. Enablement applies to all menus and to registered keybindings. Enablement of commandsĬommands support enablement via an enablement property - its value is a when-clause. Now the myExtension.sayHello command will only show up in the Command Palette when the user is in a Markdown file. The command, for example, comments the currently selected lines in the active text editor: import * as vscode from 'vscode' function commentLine ()

This lets you use VS Code's built-in functionality, and build on extensions such as VS Code's built-in Git and Markdown extensions. The API programmatically executes a command. Many extensions also expose their core functionality as commands that users and other extensions can leverage. VS Code includes a large set of built-in commands that you can use to interact with the editor, control the user interface, or perform background operations. Commands are also used by extensions to expose functionality to users, bind to actions in VS Code's UI, and implement internal logic. If you have ever configured a keybinding, then you've worked with commands. The Mono Soft debugger is different from regular debuggers in that it is a cooperative debugger that is built into the Mono runtime the generated code and Mono runtime cooperate with the IDE to provide a debugging experience. Commands trigger actions in Visual Studio Code. Visual Studio for Mac uses the Mono Soft Debugger to debug managed (C or F) code in all Xamarin applications.
