Loading
feat: support missing default namespace state in status bar
Description
This MR adds UI support for the SUGGESTIONS_NO_DEFAULT_NAMESPACE state check that will be introduced in the Language Server (gitlab-org/editor-extensions/gitlab-lsp!3059 (merged)). When users haven't selected a default GitLab Duo namespace, the extension now displays an appropriate status bar icon and tooltip message.
Changes Made
- Added
SUGGESTIONS_NO_DEFAULT_NAMESPACEto theVisibleCodeSuggestionsStateenum - Added status bar UI configuration for the missing namespace state with:
- Disabled icon (
gitlab-code-suggestions-disabled) - Tooltip message explaining the issue and how to resolve it
- Disabled icon (
How It Works
- The Language Server detects when a user hasn't selected a default namespace via the
SUGGESTIONS_NO_DEFAULT_NAMESPACEstate check - The state is broadcast to the VS Code extension via
FeatureStateChangeNotificationType - The
LanguageServerPolicyreceives the state and engages when the check is active - The status bar item updates to show the disabled icon with the tooltip message
- Users are informed they need to select a default namespace in their GitLab preferences
Related Issues
Related to https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/work_items/1907
How has this been tested?
To test this MR with your local gdk, follow these steps:
- Checkout this branch in your gdk's gitlab repo and this branch in your language server repo https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/tree/1907-handle-missing-default-namespace
- Compile both the vscode extension and language server
- Start extension host
- Open a cloned project for your gdk instance in your editor
- Open a code file in your editor to trigger code suggestions
- Verify that code suggestions are disabled and when you hover over the status bar item you see a tooltip message indicating you need to select a default namespace
- If
src/browserorsrc/commonhas been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE. - Consider an end-to-end test for significant new features that aren't covered by integration tests.
Screenshots (if appropriate)
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 Mohammed Osumah
