Consistent way to ensure rustfmt uses 2018 edition

Aperta
#439 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
rust, vim

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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"

Lingua principale
Vim Script
Stelle
4.2k
Fork
323
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rust.vim

Tutte le issue di rust-lang/rust.vim

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.