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

V5: debug codelens was removed, please bring it back #961

Open
markcarroll opened this issue Dec 6, 2022 · 17 comments
Open

V5: debug codelens was removed, please bring it back #961

markcarroll opened this issue Dec 6, 2022 · 17 comments
Labels
need-discussion needs more in-depth discussion

Comments

@markcarroll
Copy link

Environment

  1. vscode-jest version: v5.0.3
  2. node -v: 18
  3. npm -v or yarn --version: 8
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): 29.2
  5. your vscode-jest settings if customized:
    • jest.jestCommandLine?
    • jest.autoRun? [
    • anything else that you think might be relevant?
  6. Operating system: macOS Ventura

The Debug codelens was removed in v5.0.3. This makes the plug-in a lot less useful. Please consider adding it back or making it a config option. Having to go to the other side of the screen (on a 32" 4k monitor) to find the debug button in the explorer is a real pain compared to just clicking above the test you are debugging.

Thank you.

@connectdotz
Copy link
Collaborator

connectdotz commented Dec 6, 2022

Hi @markcarroll, thanks for the feedback. I want to make sure I understand your experience:

The debug codeLens was at the beginning of the line, a few pixels right of the gutter menu (the status icon). Not sure what you mean by "Having to go to the other side of the screen..."? Do you mean the TestExplorer tree panel? In case you were unaware that you can trigger debug from the status icon, i.e., the gutter menu, by right-mouse click.

Position-wise, I think they are pretty similar. However, as far as discoverability goes, I agree codeLens is more prominent.

@markcarroll
Copy link
Author

ha, well you are quite right on discoverability, I had no idea the right click option was even there at all on the gutter icon. Yes that is definitely better than going over to the TestExplorer tree panel, which as a I said is a long way on a big 4k screen. However you are spot on, discoverability is the key here.

Honestly, I liked seeing the debug code lens and would still prefer that than the right click menu, although that is still better than the TestExplorer. Was there a technical issue that is preventing you keeping it with an option or were you just trying to clean up UI?

@connectdotz
Copy link
Collaborator

Was there a technical issue that is preventing you keeping it with an option or were you just trying to clean up UI?

Not for technical reason but extensibility and consistency. As you can see the context menu has quite a few more actions: run, debug, and it has also better parameterized tests (test.each) support. In v5 when I try to add snapshot update and view features, I realized either we have to add more codeLens to duplicate the context menu functions, or risking inconsistency between codeLens and context menu - also a discoverability issue that people like yourself, who is used to the codeLens, would probably not discover the rich features in the context menu...

But you did raise a good point, maybe we should do a one-time reminder for context menu when people upgrade to v5? 🤔 Do you have alternative suggestions?

@markcarroll
Copy link
Author

After spending a few days debugging some code and actively using the context menu I am going to stand by my original request of being able to turn the code lens back on with a config setting. For some reason I just do not find going to the gutter, right clicking on the icon and clicking the Debug Test option as easy as clicking on the old code lens above each test. The rest of this extension has come a long way and is working really nicely (really great job, BTW), I just feel like losing the debt code lens is a step backwards.

@connectdotz
Copy link
Collaborator

@markcarroll, I hear you. What do you think if we add more codeLens, like run, view, and update snapshots in addition to the debug?

@markcarroll
Copy link
Author

Run might be useful, although I think that works best in the explorer or the gutter/TextExplorer. To me that is one where you would click on the red x icon in the gutter to get it to run again after fixing a bug to try to turn it green.

I'm not sure where you would put View. Won't you already be at the location of the test when the code lens is displayed?

I don't use snapshots so I can't comment on that last one.

I really think that you had it right with Debug being the one that shows up right before the code. It was very intuitive to click on to try running the test again after you edit it (or the code it is testing).

Others may have different opinions, I'm just explaining how I work with it.

@connectdotz
Copy link
Collaborator

Run might be useful, although I think that works best in the explorer or the gutter/TextExplorer. To me that is one where you would click on the red x icon in the gutter to get it to run again after fixing a bug to try to turn it green.

The same can be said about debug. :-) I think we can all agree that UI is quite subjective.

Ok, I don't think I got a good sense of this issue yet; let's keep this thread open and see what others think...

@connectdotz connectdotz added the need-discussion needs more in-depth discussion label Dec 11, 2022
@markcarroll
Copy link
Author

Haha understood. Thanks for considering other opinions, you really have an invaluable tool here. We love it.

@markcarroll
Copy link
Author

Still missing this - the right click method is just not as good. I consider this a backwards step. Please reconsider reverting this change. "Run" is a single click on the gutter icon. "Debug" used to be.

@connectdotz
Copy link
Collaborator

@markcarroll, thanks for being a devoted debug codeLens user! I was hoping you would come around with the gutter menu... 😄 In any case, as I mentioned earlier, let's hear from more people before taking further action.

@mschmidt-onecause
Copy link

I'm also missing the codelens, partly because I was used to it, but mostly because the gutter icons seem to frequently disappear on me. For example, clicking the gutter to run a test works, then clicking another one runs the test and then all the individual test gutter icons disappear except for the top-level describe and one on the last blank line in the file.

@connectdotz
Copy link
Collaborator

For example, clicking the gutter to run a test works, then clicking another one runs the test and then all the individual test gutter icons disappear except for the top-level describe and one on the last blank line in the file.

can you post a screen recording or a repo so I can see what is happening? This sounded like a bug. The gutter icons should not disappear unless there is a parsing error, which would make codeLens disappear as well... 🤔

@Chakrygin
Copy link

+1 to bring back codelens. It more fast and user friendly for typical scenarios.
I always (by mistake) click run test instead of debug test. =(

@piotrjak
Copy link

+1 to bring back the CodeLens option! I got back to testing with jest after a break and I thought my config was wrong (I had problems with CodeLens not appearing before when it couldn't locate jest binary).
It was a option as you can't really run one test with jest with .only like you can with mocha...

@connectdotz
Copy link
Collaborator

connectdotz commented Jan 30, 2023

@piotrjak,

It was a option as you can't really run one test with jest with .only like you can with mocha...

I just want to make sure you are aware that you could run/debug any individual test from the gutter menu next to the test block - by right-mouse click on the "status" icon. Or maybe I misunderstood your comment?

@piotrjak
Copy link

piotrjak commented Feb 3, 2023

@connectdotz yeah, I know that, thanks!
anyway, I've found a better way to run the individual tests or test suites! with cmd+;cmd+c. It's called `Test: Debug test at cursor". thanks for this shortcut 🙇🏻

@loderunner
Copy link

Don't know if this request is still under consideration, but I also miss the Codelens ever since it was removed.

I'm aware of the gutter icon + right-click access, and I use it constantly. Writing tests and running them through the debugger is central to my workflow. Right-clicking a small icon + selecting the right item in the list, even though a minor annoyance, is worse than accessing the codelens. As this can happen hundreds of times a day, and also because I remember a time when this was easier, it can get a little frustrating.

As mentioned in the discussion, I would make full use of other Codelenses, too. The "Update snapshots" sounds like one I'd be using a lot. It just seems like a great spot to show actions that target a single test, available in a single click.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-discussion needs more in-depth discussion
Projects
None yet
Development

No branches or pull requests

6 participants