I would like to know which version of JuliaFormatter.jl is used by the Julia extension for VS Code when I run the command Format Document. I don’t have JuliaFormatter in my global env and also not in my current project environment.
I think that’d be v1.0.61, as specified here: julia-vscode/scripts/environments/languageserver/v1.11/Manifest.toml at v1.127.2 · julia-vscode/julia-vscode
Thanks! Do you know if it’s always using this version, or is there a way to change it?
I don’t think there is a way to change it. You can of cause run JuliaFormatter outside of the extension, wait for a new release of the extension with an updated version, or perhaps configure VSCode in another way similar to fredrikekre/Runic.jl: A code formatter for Julia with rules set in stone.
Thank you!
Another option for using JuliaFormatter V2 is to use that Custom Local Formatters extension to run jlfmt (requires new Julia 1.12 app feature)
julia +1.12]app add JuliaFormatter- add
~/.julia/binto your PATH if needed. (output suggests this)
Then configure it in VSCode settings:
"customLocalFormatters.formatters": [
{
"command": "jlfmt --config-dir=. --prioritize-config-file",
"languages": ["julia"]
}
],
- it was not discovering my
.JuliaFormatter.tomlwithout explicit--config-dir --prioritize-config-filefixes this bug When using CLI `jlfmt`, `style` is never taken from config file, unless switch `--prioritize-config-file` is given · Issue #951 · domluna/JuliaFormatter.jl · GitHub