Skip to content

Finalise the lightbulb/sparkle story #200538

@aeschli

Description

@aeschli

Last milestone we tested the lightbulb/sparkle and got positive feedback.

We want to finalise the solution and remove the editor.lightbulb.experimental.showAiIcon setting:

  • We merge the editor.lightbulb.experimental.showAiIcon setting into the existing editor.lightbulb.enabled:
    editor.lightbulb.enabled will have 3 states: off, onCode and on.
    The setting controls where we ask for code actions.
    'off': we don't ask for code actions
    'onCode`: We only ask for code actions when on code or when the selection is not empty. That's matches the old way when we just had lightbulbs.
    'on': We ask for code actions everywhere (also on empty lines)

Old boolean states of editor.lightbulb.enabled are still honoured. true map to the new default (on or onCode, see discussion later)

  • When one or more providers return code actions for a given selection, we render
    a. a light-bulb (yellow/blue) if all code actions are regular code actions
    b. a light-bulb with sparkle (yellow/blue) if there a mix of regular code actions and AI code actions
    c. a sparkle (yellow) if all code actions are AI code actions
    Blue is used if one of the code actions can fix the problem at the cursor (no change)
  • It's up to each code action provider to have a setting to turn on/off the provider. So if someone doesn't want any sparkles, they have to turn off the providers of AI actions. In our case: github.copilot.editor.enableCodeActions : false

Our goal is still to advertise inline chat. We want to set the default of editor.lightbulb.enabled to on for the January insiders.

  • Users that have the copilot extension installed will see lightbulb/sparkle, also on new lines.
  • Users that don't have copilot extension installed might see additional lightbulbs on empty lines, if there are extensions that provide code actions for these locations. We will try this out with various languages and the major language extensions. We will file issues if a language extension provides non-useful code actions as it didn't expect us to ask on empty lines. Based on the state in January, we can change the default back to onCode for the next stable. If needed, we can do that per-language (we try to avoid that)

We remove the light bulb in the gutter as well the light bulb in the editor toolbar. (remove feature and setting)

@alexdima @justschen Do you like and support that approach?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions