• @GlitchyDigiBun@lemmy.world
      link
      fedilink
      English
      32 years ago

      I would like to see the debugger give a list of all these boolean values and watch them toggle in real time. That would be far more useful.

    • @dingdong@lemm.ee
      link
      fedilink
      English
      1
      edit-2
      6 months ago

      No there is AT LEAST one use for this. You could create an options class with booleans, and you could toggle settings when running or debugging. Also less savvy people (other non software engineers) can toggle settings easier for internal tools.

  • @Henrik@lemmy.world
    link
    fedilink
    English
    82 years ago

    Previously I was able to search for “true” and “false” in my codebase. How do I do that now? VS Code has a new search interface specifically for toggles. It’s closed by default, but you can open it by clicking the “Toggle Search Toggle” toggle.

    Yo dawg, I heard you liked toggles so we gave you a toggle to search for toggles in your toggle

    Also, the section defining behaviour for null and undefined values are kind of bonkers.

    Buuut, a nice visual nonetheless. I don’t see myself using it though.

  • conciselyverbose
    link
    fedilink
    42 years ago

    I, uh, actually kind of like the idea. If you just visually converted primitives to a toggle after you type true/false, and let you delete it like any other text, it could be a small convenience on any flags you might change during the development process.

    • Perry
      link
      fedilink
      02 years ago

      As long as it’s not literally a toggle that you can interact with.

      I can only imagine the horrors of accidentally clicking in the editor while selecting some text and quietly changing certificateIsValid = false; to true or something like that.

      • 📛Maven
        link
        fedilink
        22 years ago

        Nah, make it a keybind like alt-shift-click and give it a deafening sound like throwing an industrial breaker.

      • conciselyverbose
        link
        fedilink
        02 years ago

        Oh, I could easily see a trainwreck of an implementation. But if this was just a display option like color coding keywords and variables, but you could click to change the underlying true/false? I might add it.

  • @Hazzard@lemm.ee
    link
    fedilink
    English
    32 years ago

    I used an extension a while ago that changed CSS colour values (#ababab) into little coloured dots, that became a colour picker when clicking on them (while still letting you input RGB or Hex, ofc), and it was pretty awesome!

    So, I could unironically see this being really nice. Although… I think this would need a pretty narrow context, something like if x == true would look pretty confusing as a toggle, I imagine. But assigning x = true? Bring it on.

    • @sebastiancarlos@lemmy.sdf.orgOP
      link
      fedilink
      English
      62 years ago

      Good point. I actually thing that having if x == true is bad practice anyway because it’s redundant, so showing a toggle in that context would have the benefit of highlighting that something’s wrong.