Syntax checker does not work with workspaces in PowerShell
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- vim
- Ambito
- tooling
Direzione di ricerca
Start with syntax_checkers/rust/cargo.vim, especially the workspace command construction around the lines linked in the issue, and inspect how the Vim shell setting identifies PowerShell. Reproduce the failure using the provided PowerShell configuration and a Rust workspace. Done when workspace syntax checking chains commands in a way PowerShell accepts while preserving the existing behavior for other shells.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- rust.vim version: current
Steps to reproduce:
- have MS PowerShell as the shell in which vim runs (e.g.
$Env:ComSpec=C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\powershell.exe)
" in .vimrc
" Set Powershell as the shell of choice
let &shell = has('win32') ? 'powershell' : 'pwsh'
let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
set shellquote=\" shellxquote=
set noshelltemp
- have a rust project with a workspace
- edit a file inside the workspace (e.g. a
.rsfile inside the embedded library) so thatsyntax-checkers/rust/cargo.vimwould have to enter this fork of thecargo.vimscript - save the
.rssource file so that rust syntax-checker runs
Expected vs. actual behavior:
Actual:

- This happens because PowerShell does not chain commands with
&&like other shells, so it errors out at(cd <path> && cargo check)
Expected:
- Chain commands with
;if Powershell is used. - I corrected it for myself like this (replaced
&&with) ; () in here:
if rust#GetConfigVar('rust_cargo_avoid_whole_workspace', 1)
if l:root_cargo_toml !=# l:nearest_cargo_toml
let makeprg = "cd " . fnamemodify(l:nearest_cargo_toml, ":p:h")
\ . ") ; (" . makeprg
endif
else
let makeprg = "cd " . fnamemodify(l:root_cargo_toml, ":p:h")
\ . ") ; (" . makeprg
endif
- a mere
;is not enough because then you'd end one powershell command without closing the parenthesis. - The script needs some logic to do this type of command chaining only when PowerShell is used as shell.
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-lang/rust.vim
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
-
It's Dead, Jim!Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
Remove hard coded edition fallbackForse già presa @alerque l’ha presa 230 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
-
README.md syntastic to aleAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di rust-lang/rust.vim
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
mglaman/phpstan-drupal#1078 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)Forse già presa @rohit-jsfreaky l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Graphify-Labs/graphify#5110 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
voyageurworks/launch-guard-pack#29 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
bigbio/sdrf-pipelines#372 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno