Syntax checker does not work with workspaces in PowerShell
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- vim
- Área
- tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- 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.
- Lenguaje dominante
- Vim Script
- Estrellas
- 4.2k
- Forks
- 323
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-lang/rust.vim
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 76/100
-
It's Dead, Jim!Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
-
Remove hard coded edition fallbackPosiblemente ocupada @alerque la tomó hace 230 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 35/100
-
README.md syntastic to aleAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de rust-lang/rust.vim
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
cqframework/vscode-cql#198 ·
-
bug documentation good first issue help wanted testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Show evidence time and supersede warnings in the memory inspectorPosiblemente ocupada @Sinchanak-212 la tomó hoy. Abiertoarea: ux good first issue priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rohit746/pdf-view.nvim#109 ·
Los mantenedores suelen responder en 1 día