Skip to content

Autocomplete not working with unclosed macro parenthesis #6097

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

Open
GoldsteinE opened this issue Sep 29, 2020 · 4 comments
Open

Autocomplete not working with unclosed macro parenthesis #6097

GoldsteinE opened this issue Sep 29, 2020 · 4 comments
Labels
A-completion autocompletion A-macro macro expansion C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now

Comments

@GoldsteinE
Copy link

fn func() { }

fn main() {
    println!("{:?}", fu<Tab>
}

Autocomplete is not working here, hover is showing something unrelated: fn _print(args: Arguments)

@matklad matklad added E-hard S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Oct 14, 2020
@jonas-schievink jonas-schievink added A-completion autocompletion A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now C-bug Category: bug and removed E-hard S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Apr 26, 2022
@Veykril
Copy link
Member

Veykril commented Jan 19, 2023

I am inclined to close this as wont-fix. We don't expand unclosed macros as we potentially add a ton of tokens to it which can have varying effects on it. Even if we expand those macro calls, the extra tokens will affect what macro matcher we pick which might also degrade completion quality.

@GoldsteinE
Copy link
Author

The other possible solution is to ignore unclosed macro instead of expanding it and complete as it's not there. It feels like it could give decent completion quality.

@Veykril
Copy link
Member

Veykril commented Jan 20, 2023

That will end up with a bad quality in a lot of cases, a macro doesn't necessarily expect expressions as the input.

@GoldsteinE
Copy link
Author

A lot of macros expect expressions as the input, and the alternative is no completion at all. I guess the concern is editor setups where the autocomplete is truly “auto” and pops up without pressing a trigger key (which is the default in VS Code AFAIR?). An opt-in option to enable “completion as if macro is not there” would be helpful for people who use manually triggered completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion A-macro macro expansion C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

4 participants