Important Commands for Language Service Filters

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

If you want to create a fully featured language service filter, consider handling the following commands. The full list of command identifiers is defined in the VSConstants.VSStd2KCmdID enumeration for managed code and the Stdidcmd.h header file for unmanaged Visual C++ code. You can find the Stdidcmd.h file in Visual Studio SDK installation path\VisualStudioIntegration\Common\Inc.

Commands to Handle

Note

It is not mandatory to filter for every command in the following table.

Command Description
VSConstants.VSStd2KCmdID Sent when the user right-clicks. This command indicates that it is time to provide a shortcut menu. If you do not handle this command, the text editor provides a default shortcut menu without any language-specific commands. To include your own commands on this menu, handle the command and display a shortcut menu yourself.
VSConstants.VSStd2KCmdID Typically sent when the user types CTRL+J. Call the UpdateCompletionStatus method on the IVsTextView to show the statement completion box.
VSConstants.VSStd2KCmdID Sent when the user types a character. Monitor this command to determine when a trigger character is typed and to provide statement completion, method tips, and text markers, such as syntax coloring, brace matching, and error markers. Call the UpdateCompletionStatus method on the IVsTextView for statement completion and the SetMethodData method on the IVsMethodTipWindow for method tips. To support text markers, monitor this command to determine whether the character being typed requires that you update your markers.
VSConstants.VSStd2KCmdID Sent when the user types the Enter key. Monitor this command to determine when to dismiss a method tip window by calling the OnDismiss method on the IVsMethodData. By default, the text view handles this command.
VSConstants.VSStd2KCmdID Sent when the user types the Backspace key. Monitor to determine when to dismiss a method tip window by calling the OnDismiss method on the IVsMethodData. By default, the text view handles this command.
VSConstants.VSStd2KCmdID Sent from a menu or a shortcut key. Call the UpdateTipWindow method on the IVsTextView to update the tip window with the parameter information.
VSConstants.VSStd2KCmdID Sent when the user hovers over a variable or positions the cursor on a variable and selects Quick Info from IntelliSense in the Edit menu. Return the type of the variable in a tip by calling the UpdateTipWindow method on the IVsTextView. If debugging is active, the tip should also show the value of the variable.
VSConstants.VSStd2KCmdID Typically sent when the user types CTRL+SPACEBAR. This command tells the language service to call the UpdateCompletionStatus method on the IVsTextView.
VSConstants.VSStd2KCmdID

VSConstants.VSStd2KCmdID
Sent from a menu, typically Comment Selection or Uncomment Selection from Advanced in the Edit menu. VSConstants.VSStd2KCmdID indicates that the user wants to comment out the selected text; VSConstants.VSStd2KCmdID indicates that the user wants to uncomment the selected text. These commands can be implemented only by the language service.

See also