Skip to content

[BUG] "4 Spaces Tab" doesn't play well with Copilot inline suggestions #566

@AndersHogqvist

Description

@AndersHogqvist

Describe the bug
The "4 Spaces Tab" setting seems to take priority over other actions, basically inactivating things such as accepting Copilot inline suggestions.

I've spent some time trying to figure out why pressing tab doesn't accept inline suggestions from Copilot. I finally realized that it was the "4 Spaces Tab" setting in RobotCode that was the culprit, when I deactivated that it started working. At first I didn't understand why this setting exists at all but after a short while I realized that I don't always get 4 spaces when pressing tab.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Activate Copilot inline suggestions
  2. Start writing code
  3. Wait for a Copilot inline suggestion to appear
  4. Press tab

Expected behavior
When there's one or more active inline suggestions, pressing tab should accept the suggestions.

Additional context
I've been trying to modify the key bind for this function but with no success. If I for instance add && !inlineEditIsVisible to the "When Expression" I can see in the debug log that it triggers the correct action but now it doesn't do anything (neither accepting inline suggestion nor inserting spaces):

2026-01-28 14:08:46.641 [info] [Window] [KeybindingService]: / Soft dispatching keyboard event
2026-01-28 14:08:46.641 [info] [Window] [KeybindingService]: | Resolving Tab
2026-01-28 14:08:46.642 [info] [Window] [KeybindingService]: \ From 13 keybinding entries, matched type, when: config.robotcode.editor.4SpacesTab && editorTextFocus && !editorHasSelection && !inSnippetMode && !inlineEditIsVisible && !inlineSuggestionVisible && !suggestWidgetVisible && editorLangId == 'robotframework' || config.robotcode.editor.4SpacesTab && editorTextFocus && !editorHasSelection && !inSnippetMode && !inlineEditIsVisible && !inlineSuggestionVisible && !suggestWidgetVisible && editorLangId == 'robotframework-repl', source: user.
2026-01-28 14:08:46.642 [info] [Window] [KeybindingService]: / Received  keydown event - modifiers: [], code: Tab, keyCode: 9, key: Tab
2026-01-28 14:08:46.642 [info] [Window] [KeybindingService]: | Converted keydown event - modifiers: [], code: Tab, keyCode: 2 ('Tab')
2026-01-28 14:08:46.642 [info] [Window] [KeybindingService]: | Resolving Tab
2026-01-28 14:08:46.642 [info] [Window] [KeybindingService]: \ From 13 keybinding entries, matched type, when: config.robotcode.editor.4SpacesTab && editorTextFocus && !editorHasSelection && !inSnippetMode && !inlineEditIsVisible && !inlineSuggestionVisible && !suggestWidgetVisible && editorLangId == 'robotframework' || config.robotcode.editor.4SpacesTab && editorTextFocus && !editorHasSelection && !inSnippetMode && !inlineEditIsVisible && !inlineSuggestionVisible && !suggestWidgetVisible && editorLangId == 'robotframework-repl', source: user.
2026-01-28 14:08:46.643 [info] [Window] [KeybindingService]: + Invoking command type.

Desktop (please complete the following information):
VS Code Version 1.108.2
RobotCode Version 2.2.0
OS: Windows
Python Version 3.11.9
RobotFramework Version 7.4.1
robocop 7.2.0
tidy 4.18.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions