Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel code completion and code hint upon go-to line (bookmark, breakpoint, etc.) #97674

Conversation

jaydensipe
Copy link
Contributor

Fixes #95056.

When doing an action that does a "go-to line" such as Go to Next/Previous Breakpoint or Go to Next/Previous Bookmark, this ensures the code hint or currently open code completion is cleared when jumping lines.

@jaydensipe jaydensipe requested a review from a team as a code owner October 1, 2024 02:54
Copy link
Member

@HolonProduction HolonProduction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that this fixes the linked issue. Code looks straight forward.

@AThousandShips AThousandShips added bug topic:gdscript topic:editor cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Oct 1, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Oct 1, 2024
@kitbdev
Copy link
Contributor

kitbdev commented Oct 1, 2024

This works for the linked issue, but there are more places where the code hint and code completion need to be hidden.
For both: using the Search bar.
For the code hint: ctrl+up and down when the caret moves, left and right that goes out of the function, selecting text and using ctrl+d to select next, ctrl+x to cut the existing line, etc.
Also they shouldn't be hidden when just scrolling (using scrollbar works, but mouse wheel hides it).

Ideally CodeEdit should respond to all caret movements and cancel it when needed there instead of needing to cancel it in each of these separately. This can be done in another PR if we want to merge this one as is.

@akien-mga
Copy link
Member

akien-mga commented Oct 1, 2024

I thought I was merging this but it seems I missed it in my batch. Good timing as kleonc had some comments :D

@HolonProduction
Copy link
Member

Ideally CodeEdit should respond to all caret movements and cancel it when needed there instead of needing to cancel it in each of these separately. This can be done in another PR if we want to merge this one as is.

I'd say adjusting the search bar behavior here would make sense.

A more general solution on CodeEdit level sounds great, but it might get complicated to generalize the decision whether the hint needs to be canceled and when it needs to be updated by querying the ScriptLanguage (e.g. when moving the cursor inside the same call we would need to update the hint, not cancel it, to highlight the correct current argument). Querying too often might also have performance implications for GDScript at the moment, due to the lack of caching. So merging this as a simple fix for now would make sense to me.

@jaydensipe jaydensipe force-pushed the cancel-code-completion-and-hint-on-goto-line branch from 46bdd18 to b72d8a3 Compare October 1, 2024 16:41
@jaydensipe
Copy link
Contributor Author

jaydensipe commented Oct 1, 2024

Ideally CodeEdit should respond to all caret movements and cancel it when needed there instead of needing to cancel it in each of these separately. This can be done in another PR if we want to merge this one as is.

I'd say adjusting the search bar behavior here would make sense.

A more general solution on CodeEdit level sounds great, but it might get complicated to generalize the decision whether the hint needs to be canceled and when it needs to be updated by querying the ScriptLanguage (e.g. when moving the cursor inside the same call we would need to update the hint, not cancel it, to highlight the correct current argument). Querying too often might also have performance implications for GDScript at the moment, due to the lack of caching. So merging this as a simple fix for now would make sense to me.

Alright, updated to clear when using "Go to Line..." and when finding a successful search in the search bar.

Copy link
Member

@HolonProduction HolonProduction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The search bar adjustment works as well. As said before I think merging this fix is a good idea since a generalized fix on CodeEdit level may pose some challenges at the moment.

@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@akien-mga akien-mga merged commit 0f1c7e6 into godotengine:master Oct 3, 2024
19 checks passed
@jaydensipe jaydensipe deleted the cancel-code-completion-and-hint-on-goto-line branch October 4, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:editor topic:gdscript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The function information remains on the screen even if the code does not match.
5 participants