dotnet / dotnet/vscode-csharp

Go to definition misses the target if a region is unfolded

Open
#5,550 1 comment 0 reactions 0 assignees View on GitHub
OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

Type: Bug

Steps to reproduce:

1. Create some method in one .cs file, surround it by a `#region` and fold/collapse that (the method must be 2 or 3 pages into the region to actually see the issue)
2. Open another .cs file and call the first method
3. Place the text cursor on the method call and press F12 (or select "Go to definition" from the context menu)

Now the file that contains the definition is activated and the region around the method is unfolded/expanded. But the scroll position is now wrong. The method definition is scrolled out of view and no longer visible. I need to go back to the previous file with Ctrl+Tab and press F12 again to finally get to the definition (or use the mouse to bring the scrollbar down to the cursor position).

I'm not sure if this is a VSCode core problem, but it's this extension that provides the F12 feature, so I'd start here.

Extension version: 1.25.2
VS Code version: Code 1.74.3 (97dec172d3256f8ca4bfb2143f3f76b503ca0534, 2023-01-09T16:59:02.252Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: No

System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 x 3400)|
|GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off|
|Load (avg)|undefined|
|Memory (System)|15.71GB (7.78GB free)|
|Process Argv|--folder-uri file:///c%3A/Source/Komprenu/Kappa-Indect/core-daemon-cs --crash-reporter-id 1b00a758-578c-4b77-a258-fe145c18e004|
|Screen Reader|no|
|VM|22%|

A/B Experiments

```
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
pyindex848:30577860
nodejswelcome1cf:30587006
2e4cg342:30602488
pyind779cf:30647092
89544117:30613380

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.