Skip to content

fix(status icon): Handle parallel completion requests

Tristan Read requested to merge tr-loading-state-fix into main

Description

The code suggestions loading state does not account for multiple in-flight completion requests. It can enter an invalid state (showing 'ready' when in fact it is 'loading'.

This applies to the language server, I have not checked the non-language server version to see if the issue exists there also.

More info: gitlab-org/editor-extensions/gitlab-lsp!125 (comment 1670891715)

Related Issues

Resolves #[issue_number]

How has this been tested?

  1. Link the gitlab-lsp (tv/2023-11/cancellation-debounce-draft branch) and gitlab-vscode-extension (this branch) together.
  2. Run the extension host.
  3. Enable code suggestions and the language server in settings.json, restarting if necessary:
    {
      "gitlab.featureFlags.languageServer": true,
      "gitlab.aiAssistedCodeSuggestions.enabled": true
    }
  4. Type into a text file, triggering some requests.
  5. Observe the state of the gitlab icon in the status bar.

Recordings (if appropriate):

Note the code suggestions icon state at the bottom of the video:

before after
debounce_recording debounce_fixed

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 Tristan Read

Merge request reports