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

Add completion suggestions for 'Add Include' #4

Closed
BigBahss opened this issue Feb 7, 2021 · 3 comments
Closed

Add completion suggestions for 'Add Include' #4

BigBahss opened this issue Feb 7, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@BigBahss
Copy link
Owner

BigBahss commented Feb 7, 2021

It would be nice to add completion suggestions for the 'Add Include' command. Although, this doesn't seem straightforward with the current implementation that uses the input box.

One idea is that 'Add Include' could open a small CodeLens to the spot where the new include would be added, in which case auto-completions would be provided automatically by other extensions. I think I like this idea, except in order to place includes based on if they are a system header (#include <...>) or a project header (#include "...") it would probably require 2 different commands in order to automatically place the starting #include prompt in the right spot. I'm not a big fan of requiring 2 different commands since it seems a little clunky, but (counterintuitively) this might be mitigated by having a third command that just goes to the end largest block of includes, not caring if they are system or project headers.

Also, I have no experience with the CodeLens api, so I don't know how easy this would be. Suggestions on how to implement this are welcome.

@BigBahss BigBahss added the enhancement New feature or request label Feb 7, 2021
@BigBahss
Copy link
Owner Author

BigBahss commented Apr 5, 2021

The CodeLens api wasn't what I thought it was, I was thinking of 'peek locations' (editor.action.peekLocations command). I have played around a bit with this, and it doesn't seem possible to give editing focus to the peek-window. We can insert the start of the include statement, but the user has to click into the window to start typing in it, and manually close the window when they're done. This feels very clunky. I am going to close this for now, because this feature has become a much lower priority, and I think the current implementation is good enough for what it is.

@BigBahss BigBahss closed this as completed Apr 5, 2021
@BigBahss
Copy link
Owner Author

BigBahss commented May 6, 2021

Reopening because I've found a decent way to implement this feature using the same input-box that is currently used.

@BigBahss
Copy link
Owner Author

BigBahss commented Jun 2, 2021

Added in v0.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant