Skip to content

refactor: change how we represnt disabled in settings

Description

This refactoring makes the CodeSuggestionsStateManager a thicker class (with more business logic). We'll move all business logic related to managing state into it so that we can reuse it for the Language Server.

Related Issues

Part of #1052 (closed)

How has this been tested?

  1. Disable code suggestions in your settings and make sure you use the non-LS implementation

    {
      "gitlab.aiAssistedCodeSuggestions.enabled": false,
      "gitlab.featureFlags.languageServer":false,
    }
  2. See that suggestions are disabled in the status bar

    • image
  3. Click the status bar icon

    • see that the gitlab.aiAssistedCodeSuggestions.enabled value changed in your settings.json to true
    • see suggestion enabled in you status bar
      • image
  4. Click the status bar icon again

    • see code suggestions were disabled only for this session
    • image
  5. Click again to enable

  6. Go to a JSON file

    • see that the language is unsupported
    • image
  7. Go to JS file and type something in

    • see that the icon changes when the extension loads new suggestions

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Tomas Vik (OOO back on 2024-06-18)

Merge request reports