godotengine / godotengine/godot
Code completion shortcut (CTRL+SPACE) does not work without a filter (e.g. on blank lines before you start typing)
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in v4.2.2.stable.flathub [15073afe3]
I don't ever remember Godot not having this issue.
### System information
Godot v4.2.2.stable (15073afe3) - Freedesktop SDK 23.08 (Flatpak runtime) - X11 - Vulkan (Forward+) - integrated Intel(R) HD Graphics 5500 (BDW GT2) () - Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz (4 Threads)
### Issue description
Pressing the `ui_text_completion_query` shortcut like Ctrl Space should always trigger code completion, listing every API available on that context.
Instead it only triggers after a prefix (e.g. where I started typing `a`, filtering identifiers that have `a`).
This is very inconvenient as I often want to list everything available, as I don't know yet what I'm looking for.
Please implement unfiltered completion.
Preferably with (perhaps configurable) [well-defined useful ordering](https://github.com/microsoft/vscode/issues/80444), such as e.g.:
- Local variables first (closest above cursor first)
- Current class members (closest to cursor first)
- Inherited members (nearest super-class in inheritance chain first)
- Language keywords in the middle (alphabetic)
- Global functions (alphabetic)
- Global engine classes (alphabetic)
- Global user classes last, for easy access (alphabetic)
### Steps to reproduce
Create a new GDScript or GDShader code and press CTRL-SPACE on a blank line.
An example is on the line before `pass` in this code:
```gdscript
@tool extends EditorScript
func _run() -> void:
pass
```
Same issue happens inside e.g. a method argument like `foo(` | `)` -- when I haven't yet typed anything, I don't get any completion at all.
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start by reproducing the issue in the Godot script editor with a GDScript or GDShader blank line, using the ui_text_completion_query shortcut. Trace the completion handling for empty prefixes and method-argument positions; done means Ctrl-Space lists context-appropriate completions without requiring typed characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100