microsoft / vscode

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

Light bulb doesn't show up when file contains one line #210452

Closed MooMooM1lk closed 1 month ago

MooMooM1lk commented 5 months ago

Steps to Reproduce:

  1. Open empty python file
  2. Add one line of code
  3. Highlight the whole line

Light bulb does not appear, but if you just highlight one character or word, the light bulb will appear image image

VSCodeTriageBot commented 5 months ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.88.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

justschen commented 5 months ago

@MooMooM1lk I believe this is intended (to avoid clutter in a single line).

as you can see, when you have additional lines when highlighting, the lightbulb will show up above or below. this doesn't happen in the single line case since there isn't room for it.

Screenshot 2024-04-17 at 11 59 21 PM Screenshot 2024-04-18 at 12 00 39 AM
justschen commented 1 month ago

this should be further fixed in our latest release. this was fixed with a new heuristic which now spawns it in the best case scenario, including the gutter when available. https://github.com/microsoft/vscode/pull/221419 please update and try it out, thanks!