microsoft / vscode

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

wrong placing of line spacer in diff view for code lense #125517

Closed S-p-Ace closed 1 year ago

S-p-Ace commented 3 years ago

Issue Type: Bug

with code lense enabled on for example references in java, the diff editor side by side view places a line spacer below the line with code lense while the code lense itself is displayed above the line.

VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:13:13.157Z) OS version: Windows_NT x64 10.0.19042

Extensions (72) Extension|Author (truncated)|Version ---|---|--- codesnap|adp|1.3.2 Bookmarks|ale|13.0.4 project-manager|ale|12.1.0 atlascode|atl|2.8.6 github-markdown-preview|bie|0.0.2 markdown-checkbox|bie|0.1.3 markdown-emoji|bie|0.1.0 markdown-preview-github-styles|bie|0.2.0 markdown-yaml-preamble|bie|0.0.4 npm-intellisense|chr|1.3.1 path-intellisense|chr|2.3.0 gitignore|cod|0.7.0 bracket-pair-colorizer-2|Coe|0.2.0 disableligatures|Coe|0.0.10 vscode-markdownlint|Dav|0.41.1 vscode-eslint|dba|2.1.20 java-decompiler|dgi|0.0.2 git-extension-pack|don|0.1.3 githistory|don|0.6.16 xml|Dot|2.5.1 gitlens|eam|11.4.1 vscode-npm-script|eg2|0.3.21 vscode-lombok|Gab|1.0.1 vscode-pull-request-github|Git|0.26.0 todo-tree|Gru|0.0.213 vsc-essentials|Gyd|0.5.0 search-node-modules|jas|1.3.0 react-vscode-extension-pack|jaw|0.4.0 vscode-todo-highlight|jgc|2.0.2 git-graph|mhu|1.30.0 vscode-docker|ms-|1.13.0 vscode-postgresql|ms-|0.3.0 remote-containers|ms-|0.177.2 vsliveshare|ms-|1.0.4360 vsliveshare-audio|ms-|0.1.91 vsliveshare-pack|ms-|0.4.0 sqltools|mtx|0.23.0 sqltools-driver-pg|mtx|0.2.0 color-highlight|nau|2.3.0 git-extension-pack|nie|0.0.6 regexr-vscode|Ora|1.0.0 vscode-versionlens|pfl|1.0.9 vscode-gitignore-generator|pio|1.0.3 vscode-boot-dev-pack|Piv|0.0.8 vscode-concourse|Piv|1.25.1 vscode-manifest-yaml|Piv|1.25.1 vscode-spring-boot|Piv|1.25.1 material-icon-theme|PKi|4.7.0 polacode|pnp|0.3.4 fabric8-analytics|red|0.3.3 java|red|0.79.2 vscode-commons|red|0.0.6 vscode-xml|red|0.16.1 vscode-yaml|red|0.19.2 vscode-checkstyle|she|1.4.0 sonarlint-vscode|Son|2.0.0 git-prefix|srm|1.2.0 code-spell-checker|str|1.10.2 vscode-status-bar-format-toggle|tom|2.0.0 gitflow|vec|1.2.1 vscodeintellicode|Vis|1.2.14 vscode-java-debug|vsc|0.34.0 vscode-java-dependency|vsc|0.18.4 vscode-java-pack|vsc|0.16.0 vscode-java-test|vsc|0.30.0 vscode-maven|vsc|0.31.0 vscode-spring-boot-dashboard|vsc|0.2.0 vscode-spring-initializr|vsc|0.7.0 JavaScriptSnippets|xab|1.8.0 ReactSnippets|xab|2.4.0 markdown-all-in-one|yzh|3.4.0 vscode-open-in-github|ziy|1.3.6 (5 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 pythonvspyt602:30300191 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 pythonvspyt639:30300192 pythontb:30283811 pythonvspyt551:30311712 vspre833:30267464 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 pythondataviewer:30285071 vscus158:30286553 vscgsv2:30307504 vscorehov:30309549 bridgeflight:30312182 vscod805cf:30301675 ```
S-p-Ace commented 3 years ago

On a fresh file where very little is going on the spacer is positioned correctly. I'll look further into how to reproduce this.

S-p-Ace commented 3 years ago

Ok, the spacers on the left side are positioned at the wrong place when word wrap is enabled on the right side (with code lense). Independent on whether word wrap is enabled on the left side.

alexdima commented 3 years ago

@S-p-Ace Could you please share a sample for how to reproduce? It might also help to attach a screenshot showing the problem.

S-p-Ace commented 3 years ago

Hi @alexdima, I hope its OK for me to just provide some steps to reproduce the issue.

here is what I did:

  1. Initialise a new project for example with maven (quickstart archetype) and initialize git
  2. commit the initial project files
  3. do some changes to code that has code lense and save the file (I updated the maven dependencies to use JUnit5 instead of 4)
  4. open the diff editor from the changed file in source control
  5. enable word wrap on the right side

word wrap disabled: image word wrap enabled: image

The majority of the dependency block for junit has moved up one line on the left side and the spacer for the code lense moved down between the version and scope tags.

The provider for these code lenses is pflannery.vscode-versionlens

alexdima commented 3 years ago

:+1: Here is a simplified repro:

hediet commented 1 year ago

Fixed in Diff Editor v2:

Code_-_OSS_2mZIfw3ASG