Skip to content

autoload/rustfmt.vim slowdown vim startup #527

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikewy0527
Copy link

fix #524

rustfmt.vim want to switch config option automatically between difference rustfmt version according detect version and check supported option of rustfmt. But this design causing more trouble than convenience for users.

According this change, we not need to call rustfmt --version and rustfmt --help anymore. If we need to support new feature:

  1. for breaking change compatible, providing option g:rustfmt_xxx_legacy
  2. for new rustfmt option and it can't be config in configuration file, providing option g:rustfmt_xxx_xxx. We don't care about it is nightly or stable, we just make sure: If it is nightly only, then it work on nightly version. If it is both, then it work on both. That is it.
  3. other should be done by g:rustfmt_use_configfile. If set to 1, using config file; otherwise using default (current is --edition 2018).

more details in this comment and relative issue in vim

Solution: Replace DetectVersion() with rust-settings.

Relative rust-settings:
    * rustfmt_emitmode_legacy
    * rustfmt_format_range
    * rustfmt_use_configfile

fixes rust-lang#524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autoload/rustfmt.vim should not call rustfmt on load
1 participant