display completions more frequently

This commit is contained in:
Matt Parker
2025-10-27 23:41:48 +10:00
parent ee3213b4e4
commit bf053ed580
2 changed files with 19 additions and 0 deletions

View File

@@ -174,6 +174,12 @@ public partial class SharpIdeCodeEdit : CodeEdit
private void OnTextChanged()
{
var codeCompletionPopupClosed = GetCodeCompletionSelectedIndex() is -1;
var shouldShowCodeCompletion = codeCompletionPopupClosed && HasFocus(); // This is a bad solution - it will be triggered on copy paste, undo redo, applying code fixes etc
if (codeCompletionPopupClosed)
{
EmitSignalCodeCompletionRequested();
}
_ = Task.GodotRun(async () =>
{
var __ = SharpIdeOtel.Source.StartActivity($"{nameof(SharpIdeCodeEdit)}.{nameof(OnTextChanged)}");