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

GutterFormatter breaks clicking in gutter to create breakpoint #586

Closed
markcarroll opened this issue May 23, 2020 · 9 comments · Fixed by #635
Closed

GutterFormatter breaks clicking in gutter to create breakpoint #586

markcarroll opened this issue May 23, 2020 · 9 comments · Fixed by #635

Comments

@markcarroll
Copy link

Environment

  1. node -v: v12.16.1

  2. npm -v: 6.14.5

  3. npm ls jest or npm ls react-scripts (if you haven’t ejected): jest@26.0.1

  4. your vscode-jest settings if customized:

    • jest.pathToJest? default
    • jest.pathToConfig? default
    • anything else that you think might be relevant? see below
  5. Operating system: macOS 10.15.4

Prerequisite

  • are you able to run jest test from command line? yes
  • how do you run your tests from command line? (for example: npm run test or node_modules/.bin/jest) jest (with npx fallback)

Steps to Reproduce

Turn on GutterFormatter in vscode settings
Try clicking in the gutter to turn on/off a breakpoint

Expected Behavior

Breakpoint is toggled on/off for that line

Actual Behavior

Nothing happens. Breakpoint not toggled.

@connectdotz
Copy link
Collaborator

connectdotz commented May 25, 2020

yeah this is a well-known issue, unfortunately, there is only one gutter so extensions and vscode easily step on each other... maybe just use the DefaultFormater?

Can you share with us the main reason for choosing GutterFormatter over the default? Giving the conflict of gutters and other issues, I am wondering if we should just retire GutterFormatter...?

@connectdotz connectdotz mentioned this issue May 26, 2020
15 tasks
@amatosov-rbx
Copy link

Looks like in v4 "DefaultFormatter" == "GutterFormatter" and there is no way to opt out of the gutter formatter anymore.
Shall there be a new entry "InlineFormatter" that has old behavior?

@markcarroll
Copy link
Author

Sorry @connectdotz I missed your question back when you asked.

I like the gutter formatted because it doesn't get in the way the same as the default one. With the default formatted I have to keep toggling coverage off when I am starting new code and then have to turn it on again later. When a file has little to no tests and coverage is on, it is very hard to read the contents of the file using the built in Dark+ theme.

The gutter formatter is nice in that it hows coverage in a more subtle but still useful manner.

I hear you on the gutter issue though and yes, the breakpoint on/off thing is a real problem.

Maybe if we could make the default formatter more subtle that would do the trick.

@connectdotz
Copy link
Collaborator

connectdotz commented Nov 9, 2020

@amatosov-rbx:

Looks like in v4 "DefaultFormatter" == "GutterFormatter" and there is no way to opt out of the gutter formatter anymore.

hmmm... v4 did not change this behavior. However, there is some inconsistency regarding changing this setting, unlike most other settings, you do need to reload the extension (i.e. reload window or restart code) to see the new formatter. This is not new but certainly could be improved. should be a simple PR if you are interested.

@connectdotz
Copy link
Collaborator

@markcarroll

I hear you. I am thinking we could move the gutter indicator to the right instead.

@markcarroll
Copy link
Author

That would work for me. Let's face it, most lines begin with white space for indentation anyway so that could work.

@connectdotz
Copy link
Collaborator

@markcarroll:

I am thinking we could move the gutter indicator to the right instead.

Turns out this doesn't work 😞 . The right side is the "overview ruler", where the scroller is and it does not match code line-by-line. It really just helps you to quickly scroll to the approximate area but not precise enough for the line-level coverage without any other visual indicator, such as inline overlay or gutter icon.

Maybe if we could make the default formatter more subtle that would do the trick.

This is a good idea, I added some new customization so you can customize the color and transparency for the inline overlay in #635, feel free to take a look and let me know if it works.

@amatosov-rbx:

unlike most other settings, you do need to reload the extension (i.e. reload window or restart code) to see the new formatter.

I have also fixed this reload issue, you should be able to change formatter setting and it should take effect right away now. Feel free to take a look #635

@markcarroll
Copy link
Author

markcarroll commented Nov 19, 2020

This looks like a great solution. Thank you. Closing this now.

@stefaneidelloth
Copy link

stefaneidelloth commented Nov 18, 2022

The bug of non working break points is still there. You should remove the GutterFormatter if you cannot fix that. The customization of line cutter works as workaround for me. Maybe use less annoying appearance as a default.

I use Darcula/PyCharm theme and following settings for the uncovered lines:

.vscode/settings.json

{
"jest.coverageColors": {
      "uncovered": "rgba(35,35,35, 0.5)",
      "partially-covered": "rgba(255,215,0, 0.04)",
}
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants