microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.68k forks source link

Jumpy when going to next/prev problem #156782

Open daelmaak opened 2 years ago

daelmaak commented 2 years ago

Issue Type: Bug

  1. Have a typescript file long enough so that the code extends below the fold
  2. Have a linting / TS error, let's say in bottom part of the editor close to the fold
  3. Have your cursor vertically centered in the file
  4. Invoke the editor.action.marker.next

https://user-images.githubusercontent.com/34311965/182109433-e5739db4-a469-4e11-b517-6bbdad278f7c.mov

Expected:

The cursor jumps downwards to highlight the issue without scrolling the file, so that user doesn't lose the context of where he is in the file.

Actual:

The file is abruptly scrolled so that the next problem is vertically aligned at the top half of the editor, and user (I) lose the context of where I am now. This is the case especially with long files, much longer than those in the video. This works as expected eg. in WebStorm and allows for much better issue-tackling experience.

VS Code version: Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a, 2022-07-18T16:12:57.074Z) OS version: Darwin x64 21.5.0 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
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
webgl: enabled
webgl2: enabled| |Load (avg)|12, 5, 4| |Memory (System)|16.00GB (2.59GB free)| |Process Argv|--crash-reporter-id fb3a65fd-4c91-4160-9c4b-da791093bfc3| |Screen Reader|no| |VM|0%|
Extensions (17) Extension|Author (truncated)|Version ---|---|--- ng-template|Ang|14.1.0 vscode-neovim|asv|0.0.89 vscode-simpler-icons|dav|1.6.5 vscode-eslint|dba|2.2.6 gitlens|eam|12.1.2 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.5.0 vscode-jest-runner|fir|0.4.48 vscode-angular-html|gha|1.8.0 jwt-decoder|jfl|1.2.0 Angular2|joh|13.0.0 vscode-peacock|joh|4.0.1 vscode-scss|mrm|0.10.0 vscode-docker|ms-|1.22.1 vsliveshare|ms-|1.0.5667 angular-console|nrw|17.19.0 keyboard-quickfix|pas|0.0.6 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonvspyt551:30345470 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 vscscmwlcmt:30465135 cppdebug:30492333 pylanb8912:30529769 vsclangdc:30486549 c4g48928:30535728 ```
aeschli commented 2 years ago

If I get this right, your request is that Goto next Problem does not scroll (just moves the cursor), if the problem is visible. I verified that scrolling happens independently of folded regions.

jrieken commented 2 years ago

code pointer: https://github.com/microsoft/vscode/blob/a4384fa6dbdf58bd50a5b23de8d1a7513f2b5738/src/vs/editor/contrib/gotoError/browser/gotoError.ts#L153

VSCodeTriageBot commented 2 years ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

daelmaak commented 2 years ago

If I get this right, your request is that Goto next Problem does not scroll (just moves the cursor), if the problem is visible. I verified that scrolling happens independently of folded regions.

Exactly.

ashutosh887 commented 1 year ago

I'm willing to work on this

daelmaak commented 1 year ago

I'd like to have a look at this issue @jrieken.

daelmaak commented 1 year ago

I had a quick stab at it, but I am not sure I am content with the result.

The issue is that the error marker widget takes space in between codelines and shifts the code below, which is not visible when the marker always maintains the same position, but becomes visible when it doesn't (see vid).

gotoError

It would be nice to redesign the marker widget and allow it to overlay code below, which would eliminate the code shifting, but I realize this might be too big a change.

daelmaak commented 1 year ago

I worked around this issue in this PR for go-to-next-error plugin, which deals with common problem markers' issues.