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

Parameter autocomplete improvements #81

Conversation

MaartenStaa
Copy link
Contributor

Some autocomplete improvements aimed at typing parameters:

  • Correctly offer parameter completion options when typing a new parameter after the first one.
  • Omit already used parameter names as options.
  • Re-offer completion when typing a space after a comma in a function call (and other such cases).

Previously, parameter type autocomplete would be offered when no
parameters were typed yet (`foo(|)`), but not when adding a second
(or third, ...) parameters (`foo(bar, |)`).
e.g. in a function call, if you type a comma you would get the
completion options for parameter names and such, but then if you typed
a space you would lose the autocomplete, and would have to manually
trigger it again.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 29, 2023
@ndmitchell
Copy link
Contributor

ndmitchell commented Aug 29, 2023

All looks good - importing with the intention of merging as is. I'll make the single line comment addition

@@ -60,6 +61,7 @@ pub enum AutocompleteType {
Parameter {
function_name: String,
function_name_span: ResolvedSpan,
previously_used_named_parameters: Vec<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

The name is pretty clear, but perhaps just one sentence that they were already used in the function already

@facebook-github-bot
Copy link
Contributor

@ndmitchell has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ndmitchell merged this pull request in c86e26b.

facebook-github-bot pushed a commit to facebook/buck2 that referenced this pull request Aug 30, 2023
Summary:
Some autocomplete improvements aimed at typing parameters:

- Correctly offer parameter completion options when typing a new parameter after the first one.
- Omit already used parameter names as options.
- Re-offer completion when typing a space after a comma in a function call (and other such cases).

X-link: facebook/starlark-rust#81

Reviewed By: stepancheg

Differential Revision: D48782136

Pulled By: ndmitchell

fbshipit-source-id: e64faca0292f1722106beb503801d880b4c64be4
@MaartenStaa MaartenStaa deleted the parameter-autocomplete-improvements branch August 30, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants