refactor: Migrate language check to the LS policy
Description
Creates a LanguageServerPolicy
that implements StatePolicy
(for code suggestions state) and communicates with the LS to get updates for the CS state. For now, only the supported language check is moved to the LS
This MR should be checked together with the LS MR gitlab-org/editor-extensions/gitlab-lsp!291 (merged).
Note, that the Code Sugestions and status check should work with the LanguageServer (feature flag) enabled and disabled.
Related Issues
gitlab-org/editor-extensions/gitlab-lsp#177
How to test
Open the file that has supported language for Code Suggestions,e.g. javascript
. Make sure that the status icon is enabled and code suggestions are working (unless other policies are engaged). Switch to the file with unsupported language. Make sure it is reflected in the status icon and code suggestions are not requested.