Skip to content

[VS Code][Desktop] Settings validation Diagnostics section

Problem to solve

Unlike, for example, JetBrains, the VS Code Extension doesn't have control over what settings user save in their settings.json. It can only validate the already-saved settings and surface issues to the user. We need to clearly inform the user if the configuration is invalid and ideally tell them why it is invalid.

NOTE: This issue only pertains to the desktop implementation of the settings diagnostics section, please check out, [VS Code][WebIDE] Settings validation Diagnosti... (#1921 - closed), for the work tracking the webide implementation.

Proposal

image

In the diagnostics screen, we want to show a section that should contain information about any failed setting validation, especially the more complex fields like gitlab.duoCodeSuggestions.additionalLanguages and gitlab.duoCodeSuggestions.enabledSupportedLanguages.

## Settings

- [ok] Custom SSL certificates are enabled and loaded
- [false] GitLab Duo Code Sugestions enabled
- enabled feature flags
  - `singleAccount`
  - `webviewsInLs`

define the detailed format as you start this issue

Further details

  • Extension configuration is processed in extension_configuration.ts
  • There is an endpoint for validating configuration in LS but we should use the FeatureStateManager from LS because we set the config as soon as the user saves it, we can't reject the save with a validation error.
  • This hasn't been spiked out in the POC
  • If possible, please turn the getExtnesionConfiguration() method into a service 🙏 🙏 🙏

Links / references

Edited by Dylan Bernardi