Skip to content

Statement on first line in top-level statements file is treated incorrectly when partial class Program definition is present #7762

@just-ero

Description

@just-ero

Environment

VS Code version: 1.95.2, e8653663e8840adaf45af01eab5c627a5af81807, x64
C# Extension version: v2.55.21

Steps to reproduce

  1. Create or open any C# project.
  2. Open or create a top-level statements (Program.cs) file.
  3. Add the following code:
    int i;
    
    partial class Program;
  4. Observe int i; being treated incorrectly; it is "folded away":
    Image

Expected Behavior

The statement on the first line is not treated incorrectly like this.

Actual Behavior

The statement is in an extra "container", navigating to the line with the cursor hides the cursor behind that container. The contents of the line can still be edited. Clicking the container does not yield a response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions