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

Added ability to filter code complete options by type (function, class, const, signal, etc) #38449

Closed

Conversation

EricEzaM
Copy link
Contributor

@EricEzaM EricEzaM commented May 4, 2020

Like the Visual Studio implementation.

You can filter completion options by type. Sometimes you only want to see functions, etc but you get a huge list of everything. Now you can filter just for those! Hurrah!

2vfCZsxekt

Also fixed a bug where clicking + dragging (even just for 1 pixel) on the code completion box started selecting text. See below... hard to show clicking and dragging though!

xCMjDV9O7k
sCWiOda6bM

@Calinou
Copy link
Member

Calinou commented May 4, 2020

While this is pretty cool, keep in mind there's a long-term goal to refactor TextEdit to make it easier to maintain: #31739

@YuriSizov
Copy link
Contributor

This looks nice, but is there a way to access different tabs with a keyboard? Code completion is a poweruser tool, and switching to a mouse to use this functionality is not desirable.

@EricEzaM
Copy link
Contributor Author

EricEzaM commented May 4, 2020

@pycbouh Oh yeah! I thought of that but totally forgot before making the PR.

@EricEzaM EricEzaM force-pushed the code-complete-category-filters branch from a9a0ce9 to 47e3d37 Compare May 4, 2020 11:51
@EricEzaM
Copy link
Contributor Author

EricEzaM commented May 4, 2020

@Calinou Yeah I saw the PR that was made for that earlier today. I would be interested in 'porting' this feature to that implementation if those changes in 31739 are merged first. Especially if it is cleaner to do so. text_edit.cpp is almost 8k lines now!

@pycbouh I added shortcuts like in Visual Studio, e.g. Alt + F = functions, Alt + S = signals, Alt + C = constants, etc. Also Alt PgUp/PgDn to cycle right/left through the tabs.

@EricEzaM EricEzaM force-pushed the code-complete-category-filters branch from 47e3d37 to e5c7863 Compare May 4, 2020 12:33
@KoBeWi
Copy link
Member

KoBeWi commented May 4, 2020

While the feature looks cool, I don't see much use for it. The autocompletion should just accurately suggest the identifier you are trying to write (see #21726), the amount of options doesn't matter.

@EricEzaM EricEzaM force-pushed the code-complete-category-filters branch from e5c7863 to 794233c Compare May 4, 2020 12:56
@EricEzaM
Copy link
Contributor Author

EricEzaM commented May 4, 2020

@KoBeWi The situation where I use this is where I am looking for a function/property/etc on an object, but don't remember it's exact name. So I can use this to quickly find what I need instead of going to the source script/docs.

@EricEzaM
Copy link
Contributor Author

This is probably better to be implemented at some point in the future, maybe 4.1, when the api for script/code/text editor is finalised.

Closing for now, and would submit as a separate PR in the future if I were still to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants