Skip to content

feat: add "enabled supported languages" setting

Description

refactor: Remove duplicate constant

feat: add "enabled supported languages" setting

This adds a new setting called Enabled Supported Languages. This presents to the user as checklist of languages, which are all enabled by default.

In reality, it is a denylist. Only languages which are unchecked have any effect on Code Suggestions. This is true in both states of the gitlab.featureFlags.languageServer.

See https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/issues/174 for the rationale.

Part of #1388 (closed).

Related Issues

Resolves #1388 (closed)

Local testing

  1. Ensure the gitlab.aiAssistedCodeSuggestions.enabled is enabled.
  2. Check out the corresponding language server MR in your local language server clone.
  3. Connect it to your VS Code repository in your preferred way (e.g., the language server's npm run watch -- --editor=vscode command)

Without language server

  1. Ensure the gitlab.featureFlags.languageServer setting is disabled.
  2. Check out this branch and start the Extension Development Host
  3. Open a file written in a supported language
  4. Observe Code Suggestions works as normal
  5. Visit user and/or workspace settings and disable the language
  6. Observe that Code Suggestions are now disabled for files written in that language

With language server

  1. Ensure the gitlab.featureFlags.languageServer setting is enabled.
  2. Follow from step 5 above.

Screenshots (if appropriate)

Without language server With language server
simplescreenrecorder-2024-07-02_16.46.29 simplescreenrecorder-2024-07-02_17.02.00

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Mark Florian

Merge request reports