Consistent way to ensure rustfmt uses 2018 edition

Đang mở
#439 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust, vim

Hướng nghiên cứu

Start by reading the :RustFmt implementation and how it builds rustfmt arguments from g:rustfmt_options and rustfmt.toml. Reproduce both reported cases with a Rust 2018 async function: one duplicates --edition, while the other defaults to 2015. Done means formatting succeeds in both cases without requiring users to coordinate the two edition settings.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

rust.vim version

vim-plug, current rust.vim commit 87c745d8d506fc1eecc1d81df15d5bde1658a2fc

Steps to reproduce:

Option (A): Specify --edition 2018 in g:rustfmt_options in .vimrc (or equivalent)
Option (B): Do not specify --edition 2018 in g:rustfmt_options in .vimrc (or equivalent)

  1. Create a new rust project, 2018 edition.
  2. Use an async fn (or other 2018-specific syntax).
  3. Run :RustFmt
  4. Add a rustfmt.toml file which does not specify edition
  5. Run :RustFmt

Expected behavior:

At least one of option (A) or (B) works (correctly formats the file at steps 3 and 5)

Actual behavior

Option (A) fails at step 3, with "Option 'edition' given more than once"
Option (B) fails at step 5, with "async fn is not permitted in the 2015 edition"

Ngôn ngữ chính
Vim Script
Star
4.2k
Fork
323
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-lang/rust.vim

Tất cả issue của rust-lang/rust.vim

Issue tương tự

Thêm issue về DevTools

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.