refactor: code suggestions state manager handles unsupported language
Description
This MR refactors the code suggestions state manager to be the source of truth for whether the active text editor supports the language or not.
The more self-contained the state manager is, the more it is reusable for the Language Server integration.
This MR continues work that refactor: change how we represnt disabled in se... (!1182 - merged) started.
Related Issues
Related to #1052 (closed)
How has this been tested?
(the process is the same as for !1182 (merged))
-
Disable code suggestions in your settings and make sure you use the non-LS implementation
{ "gitlab.aiAssistedCodeSuggestions.enabled": false, "gitlab.featureFlags.languageServer":false, }
-
See that suggestions are disabled in the status bar
-
Click the status bar icon
-
Click the status bar icon again
-
Click again to enable
-
Go to a JSON file
-
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