Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mitigated] Selection by mouse affected by gitlens decoration #88873

Closed
rebornix opened this issue Jan 17, 2020 · 21 comments · Fixed by #102011
Closed

[mitigated] Selection by mouse affected by gitlens decoration #88873

rebornix opened this issue Jan 17, 2020 · 21 comments · Fixed by #102011
Assignees
Labels
chromium Issues and items related to Chromium insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed
Milestone

Comments

@rebornix
Copy link
Member

Issue Type: Bug

Codelens affects the hit test of mouse position when selecting text by moving mouse.

codelens-selection

As shown above, I have trouble selecting to the end of the line.

VS Code version: Code - Insiders 1.42.0-insider (fd13e44, 2020-01-17T16:30:38.851Z)
OS version: Darwin x64 19.2.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 32.00GB (4.78GB free)
Process Argv -psn_0_17432735
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
comment-tagged-templates bie 0.3.0
github-markdown-preview bie 0.0.2
markdown-emoji bie 0.0.9
markdown-preview-github-styles bie 0.1.6
gitlens eam 10.2.0
vscode-pull-request-github-insiders Git 2020.1.11042
remote-ssh-edit-nightly ms- 2020.1.11041
remote-ssh-nightly ms- 2020.1.11041
debugger-for-chrome msj 4.12.5

(2 theme extensions excluded)

@rebornix rebornix self-assigned this Jan 17, 2020
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Jan 17, 2020
@alexdima
Copy link
Member

@rebornix I have tried with:

  • settings.json:
    "typescript.referencesCodeLens.enabled": true
  • test.ts:
class C {
    readonly isClosed: boolean;

    constructor() {
        this.isClosed = true;
    }
}

const c:C;
c.isClosed;

Kapture 2020-01-17 at 21 53 05

And I could not reproduce.

Perhaps there are more steps to it? Did you try disabling all extensions, I see that there is a git lens decoration on that line.

@alexdima alexdima added info-needed Issue requires more information from poster and removed bug Issue identified by VS Code Team member as probable bug code-lens labels Jan 17, 2020
@jmbockhorst
Copy link
Contributor

I am also seeing this, but it seems like an issue with gitlens, not codelens.

@alexdima
Copy link
Member

This appears to be a result of using margin in the after decoration. Here is an extension I can reproduce with:

  • package.json
{
    "publisher": "alex",
    "name": "40127",
    "version": "0.0.0",
    "engines": {
        "vscode": "^1.0.0"
    },
    "activationEvents": [
        "*"
    ],
    "main": "index.js"
}
  • index.js:
const vscode = require('vscode');

exports.activate = function () {
	const dectype2 = vscode.window.createTextEditorDecorationType({
		after: {
			contentText: "abcd",
			color: "#00ff00",
			margin: "0px 0px 0px 3em"
		}
	});
	vscode.window.activeTextEditor.setDecorations(dectype2, [
		new vscode.Range(0, 1000, 0, 1000),
		new vscode.Range(1, 1000, 1, 1000),
		new vscode.Range(2, 1000, 2, 1000),
		new vscode.Range(3, 1000, 3, 1000),
		new vscode.Range(4, 1000, 4, 1000),
		new vscode.Range(5, 1000, 5, 1000),
		new vscode.Range(6, 1000, 6, 1000),
		new vscode.Range(7, 1000, 7, 1000),
		new vscode.Range(8, 1000, 8, 1000),
		new vscode.Range(9, 1000, 9, 1000),
	]);
}

@alexdima alexdima removed the info-needed Issue requires more information from poster label Jan 18, 2020
@alexdima alexdima changed the title Selection by mouse affected by codelens Selection by mouse affected by gitlens Jan 18, 2020
@alexdima alexdima changed the title Selection by mouse affected by gitlens Selection by mouse affected by gitlens decoration Jan 18, 2020
@alexdima
Copy link
Member

alexdima commented Jan 18, 2020

I could reproduce in Chromium and have created https://bugs.chromium.org/p/chromium/issues/detail?id=1043471 upstream.

FYI @eamodio The usage of margin in the ::after element (the inline blame) makes hit testing incorrect. There is no clear workaround available on our side.

@alexdima alexdima added upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream labels Jan 18, 2020
@alexdima alexdima added this to the Backlog milestone Jan 18, 2020
@eamodio
Copy link
Contributor

eamodio commented Jan 18, 2020

@alexdima Is this new with Electron 7?

@alexdima
Copy link
Member

I don't know.

@Yen
Copy link

Yen commented Jan 19, 2020

I think this was caused by a change to vscode, not gitlens. I have a second plugin Error Lens that is seeing the same issues.
wsHaZ6ByNu

@alexdima
Copy link
Member

Indeed, I cannot reproduce on Stable, and since this is a Chromium issue, this is caused by our Electron 7 upgrade on Insiders.

@bpasero bpasero added the electron Issues and items related to Electron label Jan 19, 2020
@bpasero bpasero removed their assignment Jan 19, 2020
@alexdima alexdima added the important Issue identified as high-priority label Jan 20, 2020
@alexdima
Copy link
Member

Adding important as more members of the dev team are hitting this -- @jrieken

@alexdima alexdima added the regression Something that used to work is now broken label Jan 20, 2020
@alexdima alexdima added this to the April 2020 milestone Mar 30, 2020
@ebraminio
Copy link

Fixed by upstream fortunately https://crbug.com/1043471#c11

@deepak1556 deepak1556 added upstream-issue-fixed The underlying upstream issue has been fixed chromium Issues and items related to Chromium and removed upstream-issue-linked This is an upstream issue that has been reported upstream electron Issues and items related to Electron labels Apr 20, 2020
@alexdima alexdima modified the milestones: April 2020, May 2020 Apr 27, 2020
@alexdima alexdima modified the milestones: May 2020, June 2020 Jun 3, 2020
@deepak1556 deepak1556 modified the milestones: June 2020, On Deck Jun 17, 2020
@deepak1556
Copy link
Collaborator

Backporting the chromium fix to Electron 8 turned out non-trivial because of the changes between versions and also I am not familiar with LayoutNG code path. I have backported the fix to Electron 9 for now, will enable LayoutNG when we adopt this version. If anyone else is interested in backporting the fix to Electron 8, feel free to. I can help with development setup quesitons.

@deepak1556
Copy link
Collaborator

Should be fixed in latest insiders.

@deepak1556 deepak1556 added the insiders-released Patch has been released in VS Code Insiders label Aug 28, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chromium Issues and items related to Chromium insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

13 participants