Skip to content

Misidentified syntax error #9018

@adantonio

Description

@adantonio

Type: Bug

Issue Description

I was creating a C# file that had two classes. When I went to run my project, I got an error that I was missing a closing curley brace, }. The thing is, I wasn't! I couldn't compile until I closed my project and re-opened it. Once I re-opened the folder, the syntax error was gone. This seems to be a bug in the C# extension. This type of issue has happened to me more than once using VSCode.

Steps to Reproduce

I'm not sure the steps to reproduce. I had one .cs file with two classes in the file. After reloading the project, the syntax error went away.

Expected Behavior

I expect the code analyzers to recognize syntax correctly.

Extension version: 2.120.3
VS Code version: Code 1.109.5 (Universal) (072586267e68ece9a47aa43f8c108e0dcbf44622, 2026-02-19T19:43:32.382Z)
OS version: Darwin arm64 25.3.0
Modes:

System Info
Item Value
CPUs Apple M5 (10 x 2400)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M5, Version 26.3 (Build 25D125))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.3 ACTIVE
Machine model name: Mac
Machine model version: 17.2
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 24.00GB (0.51GB free)
Process Argv --crash-reporter-id 75e6e672-2764-4992-b6be-931dbc517bd1
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
82j33506:31327384
63221493:31336333
envsactivate1:31464700
cloudbuttont:31379625
3efgi100_wstrepl:31403338
use-responses-api:31390855
anonusage:31403420
je187915:31401257
ec5jj548:31422691
cp_cls_c_966_ss:31454199
find_all_ref_in_bg_t:31453034
ge8j1254_inline_auto_hint_haiku:31431912
nes-autoexp-10:31446583
a5gib710:31434435
00h15499_gpt_53_codex:31464542
7a04d226_do_not_restore_last_panel_session:31438103
31c7i317_no_change:31465101
preserve_tokens:31444547
cp_cls_c_1081:31454833
copilot-nes-oct-trt:31432596
ia-use-proxy-models-svc:31452481
a43f0576c:31442824
e9c30283:31461165
ts_provider_disabled:31458191
c0ci8992_validated:31449878
nes-conv-2-3:31462665
idci7584:31464702
edit_mode_hidden:31461530
nostats:31457175
864ei723_large_tool_results_to_disk:31460878
showingstats:31457202
hg17d649:31458077
nes-extended-on:31455476
chat:31457767
ah:31460422

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