-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
julials
: default localization of .JuliaFormatter.toml
#172
Comments
julials
: default localization of .JuliaFormatter.tomljulials
: default localization of .JuliaFormatter.toml
Hello! Thanks for the detailed report. I don't believe there's anything that should be addressed in this plugin. I believe the problem is that The Julia language server seems to look through all registered workspace folders to find a JuliaFormatter config. I see three potential solutions:
|
Thanks for the convincing insight @williamboman :) |
Yeah that would probably be a better place. Note that nvim-lspconfig configurations are technically "unsupported" and best-effort. To me it sounds like this relates to project setups that are more complex than what nvim-lspconfig currently is able to support, so I think a good first step would be to iron out what constitutes a "project" and how these can be identified. |
Problem description
With the default configuration of
julials
it seems that procedure to find the .JuliaFormatter.toml is different from the one described in the JuliaFormatter documentation:For instance if I have the following tree:
If
directory/
doesn't have a.JuliaFormatter.toml
, the formatting will occur according toJulia/.JuliaFormatter.toml
.However, the behaviour with
julials
formatting is slightly different.From I see, if there is no
directory/Project.toml
my environment isJulia/
and the formatting is ruled byJulia/.JuliaFormatter.toml
. However, if there is adirectory/Project.toml
, it seems thatjulials
is looking for adirectory/.JuliaFormatter.toml
and if doesn't not exist, default formatting options are applied. Whereas here, I would expect that theJulia/.JuliaFormatter.toml
rules to be applied.Why do you think this is an issue with mason-lspconfig.nvim?
I am new to neovim and not sure who is responsible for the behaviour of the formatting of
julials
. Thus if I'm opened this issue in the wrong repository, I would be happy to be redirected to the right place and sorry for the inconvenience.Neovim version (>= 0.7)
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura-arm64.local
Operating system/version
Darwin sk-E22-66-156.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64
I've manually reviewed the Nvim LPS client log (
:LspLog
) to find potential errorsI've recently downloaded the latest plugin version of mason.nvim, mason-lspconfig.nvim, and nvim-lspconfig
Affected language servers
julials
Steps to reproduce
$ cd <trash_dir>
to go to a directory to create the temporary files and directory$ mkdir Julia
$ cd Julia
$ julia --project=. -e 'using Pkg; Pkg.add("Random")'
to create aProject.toml
andManifest.toml
$ echo 'indent = 1' > .JuliaFormatter.toml
$ mkdir directory
$ echo 'for i in 1:10\nprintln(i)\nend > test.jl'
$ nvim test.jl
and run the LSP formatter, you should see the inner line of the loop (println(i)
to be indented with 1 space), then save and quit the file$ julia --project=. -e 'using Pkg; Pkg.add("Random")'
to create aProject.toml
andManifest.toml
in thedirectory/
$ nvim test.jl
and run the LSP formatter, the inner loop should no be indented with 4 spaces (the default formatter option).Actual behavior
If an environment (i.e.
Project.toml
) exists in the current directory of the file but there is no.JuliaFormatter.toml
the default formatting options are applied. (In my example, the current directory isdirectory/
and the filetest.jl
)Expected behavior
Whereas we expect that formatter options of the
.JuliaFormatter.toml
of the directory above (Julia/
in my example) to be applied, instead of the defaults.LspInfo
LspLog
No response
Healthcheck
Screenshots or recordings
No response
The text was updated successfully, but these errors were encountered: