Skip to content

Conversation

@tareknaser
Copy link
Contributor

This PR addresses #16084 by adding a new configuration option: rust-analyzer.typing.excludeChars.

cc: @darichey

Changes

  • Added rust-analyzer.typing.excludeChars configuration.
    • Defaults to None, meaning all trigger characters (.=<>{() are active by default.
    • Users can specify a string of characters to exclude from triggering assists.
  • Updated documentation and configuration schema to reflect this new option.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 17, 2024
@darichey
Copy link
Contributor

I think this is a good workaround for people who want some functionality of format-on-type but find the limitations/bugs (like the one presented in the linked issue) annoying.

I would reword "typing assists" to "format-on-type"

@tareknaser
Copy link
Contributor Author

I would reword "typing assists" to "format-on-type"

Thanks for the review.

I initially thought rust-analyzer.typing.excludeChars made sense because it's similar to rust-analyzer.typing.autoClosingAngleBrackets.enable.

Do you think it should be renamed to rust-analyzer.formatOnType.excludeChars instead? If so, should we also rename the other configurable option to rust-analyzer.formatOnType.autoClosingAngleBrackets.enable?

@Veykril
Copy link
Member

Veykril commented Dec 2, 2024

This setting should replace rust-analyzer.typing.autoClosingAngleBrackets.enable imo (the main reason that setting exists is because the typing for angle brackets is bugged atm)

@tareknaser tareknaser force-pushed the configure_typing_exclude_chars branch from 0cddb2d to 9aff466 Compare December 3, 2024 20:39
@tareknaser
Copy link
Contributor Author

This setting should replace rust-analyzer.typing.autoClosingAngleBrackets.enable imo

Sure. I’ve just pushed a commit to remove it from the code. I’m not sure if there’s a specific process for deprecation like this. If there is, please let me know and I can update the code

@Veykril Veykril added this pull request to the merge queue Dec 4, 2024
Merged via the queue into rust-lang:master with commit 308f5e2 Dec 4, 2024
9 checks passed
@tareknaser tareknaser deleted the configure_typing_exclude_chars branch December 4, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants