Skip to content

Expand selection (alt + shift + right arrow) of methods and other members with body does not work correctly #7829

@alcjamgit

Description

@alcjamgit

Expand selection (alt + shift + right arrow) does not work right when the cursor is currently on the method name. Pressing (alt + shift + right arrow) will expand the selection to the entire method signature (correct). Pressing it further will expand the selection to other same-level members of the type instead of expanding to the method body first.

Steps To Reproduce

  1. Using Windows 11 and VS Code Ensure that "C# Base language support" and "C# DevKit" are installed and enabled.

  2. In VS Code open any C# class with methods and other members.

  3. In VS Code editor put the cursor on any method name and expand the selection by pressing alt + shift + arrow right. Repeat pressing this key until the entire method signature is selected (varies depending on the method name's casing).
    Image

  4. Press alt + shift + arrow right one more time.

  5. Selection is expanded thru the entire class (incorrect).
    Image

This also happens on methods with multiple params. When current cursor is in any of the parameters pressing alt + shift + right arrow expands selection to ALL method params instead of the current selected parameter first (i.e. current param type and param name should be selected first before selecting all params). This is the expected behavior on any other language extension (test this on python) or even in any modern IDE including Visual Studio.

Expected Behavior
Selection should expand to the method body first before other class members.
Image

Similarly, selection should expand to the currently selected method param's type and name before expanding to other params.
Image

Environment Information
-OS: Windows 11
-VS Code version 1.88, installed with C# (v2.23.15) and C# Dev Kit (1.4.29) extensions from MS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions