Skip to content

julia formatter ignores config file one folder out #3894

@dpo

Description

@dpo

Description

The documentation of the Julia formatter states that directories will be search up from the current directory for a configuration file. However, that does not seem to be happening with the neovim formatter. I'm using LazyVim based on neovim 0.11.1 on macOS with Julia's LanguageServer.jl v4.5.1.

I have

dir/.JuliaFormatter.toml
dir/subdir/file.jl

If I cd to dir/subdir and edit file.jl, formatting the file applies the default formatting options (e.g., indent with 4 spaces). If I copy file.jl to the parent directory, and repeat, the settings in .JuliaFormatter.toml are applied (e.g., indent with 2 spaces).

Formatting directly from Julia works as advertised:

julia> add Pkg
julia> using Pkg
julia> Pkg.add("JuliaFormatter")
julia> using JuliaFormatter
julia> format("file.jl")  # applies settings in ../.JuliaFormatter.toml

Here are a .JuliaFormatter.toml

indent = 2

and file.jlto reproduce:

function f()
    return 1  # default indent is 4
end

As far as I understand, LazyVim imports nvim-lspconfig, but does not pass any options. I did not change the default options either.

Wondering if I'm missing some configuration option or if others can reproduce.

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions