Display richer error message
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 43/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- rust, vim
- Bereich
- developer-experience, tooling
Rechercherichtung
Start by locating rust.vim's makeprg and errorformat configuration, then check how its diagnostics are parsed. The report suggests using Cargo's human message format for richer multiline details, but leaves open whether to change the command format or parser. Done means location list entries show the useful diagnostic context from the example; test against the provided Cargo errors.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Tested with vim 8.2 and nvim 0.5.0-dev on fedora 30, with the current master of rust.vim (9e6836f44528312171b21a78d9228c88615f63ae) and the current master branch of syntastic (b3e2d8470fddc7f2b598f09023ebc5045a3fb1fd)
Steps to reproduce:
Type some rust code and wait for the error to be displayed in the location list (or open it manually with :lopen)
Currently the location list windows looks like this:
lib/dice_system.rs|34 col 5 error| struct is not supported in `trait`s or `impl`s
lib/dice_system.rs|41 col 5 error| associated type in `impl` without body
lib/dice_system.rs|41 col 23 error| bounds on `type`s in `impl`s have no effect
lib/dice_system.rs|53 col 5 error| associated function in `impl` without body
lib/dice_system.rs|54 col 5 error| associated function in `impl` without body
This is the same output that if you do manually (in command mode):
set makeprg=cargo\ check\ --message-format=short
make
copen
If I do change it to
set makeprg=cargo\ check\ --message-format=human
I get much nicer details
|| Checking pyrite v0.1.0 (/home/rmoussu/perso/brolisteam/pyrite)
lib/dice_system.rs|34 col 5 error| struct is not supported in `trait`s or `impl`s
|| |
|| 34 | struct DiceInformation {
|| | ^^^^^^^^^^^^^^^^^^^^^^
lib/dice_system.rs|41 col 5 error| associated type in `impl` without body
|| |
|| 41 | type DiceDisplay: Display;
|| | ^^^^^^^^^^^^^^^^^^^^^^^^^-
|| | |
|| | help: provide a definition for the type: `= <type>;`
lib/dice_system.rs|41 col 23 error| bounds on `type`s in `impl`s have no effect
|| |
|| 41 | type DiceDisplay: Display;
|| | ^^^^^^^
I didn't found a way to specify the --message-format used by rust.vim It is possible? I am willing to do a PR, but I don't know where to look. I can also modify the errorformat used by rust.vim to correctly parse the multiline error but I don't know either where to look.
Using rust.vim + syntastic is much nicer that calling :make by hand since you have instant feedback, and it also works even if you have autochdir set.
I assume it's not possible to add colors (I don't think it's possible to display ANSI colors in vim – I have no idea if it's possible for neovim). If it was possible, then ideally --message-format=json-diagnostic-rendered-ansi should be used.
- Vorherrschende Sprache
- Vim Script
- Sterne
- 4.2k
- Forks
- 323
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rust-lang/rust.vim
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
It's Dead, Jim!Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
-
Remove hard coded edition fallbackEvtl. vergeben @alerque hat das vor 231 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 35/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 55/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
Alle Issues in rust-lang/rust.vim
Ähnliche Issues
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 83/100
FinanceFlash/unvibecode#652 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
swc-project/swc-ai-issues#164 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
google/executor.nvim#46 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
pop-os/cosmic-player#367 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag