JunoLab / Juno.jl

MIT License
144 stars 23 forks source link

[BUG] formatting using cmd-J cmd-F does not look into .JuliaFormatter file #587

Open TsurHerman opened 4 years ago

TsurHerman commented 4 years ago
  1. place a .JuliaFormatter file somewhere in the root of a test file A.jl with margin = 10000
  2. place a very long julia line in A.jl
  3. Format using JuliaFormatter.format("A.jl")
  4. Undo
  5. Format using cmd-J cmd-F
  6. Behold the difference
aviatesk commented 4 years ago

] up and update your JuliaFormatter to .5.4 will solve this

TsurHerman commented 4 years ago

It did not solve it for me...

aviatesk commented 4 years ago

can you share your environment, exact example, etc ?

TsurHerman commented 4 years ago

Atom v0.12.11 Juno v0.8.2 JuliaFormatter v0.5.4

Julia Version 1.3.1 Commit 2d5741174c (2019-12-30 21:36 UTC) Platform Info: OS: macOS (x86_64-apple-darwin18.6.0) CPU: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, skylake) Environment: JULIA_EDITOR = atom -a JULIA_NUM_THREADS = 4

my setup is that I have .JuliaFormatter.toml in Work\ directory with

margin = 100
remove_extra_newlines = true

under Work I have another directory A with a filename named A.jl with:

A = 5

B =       6

notice the two-line space between the first and second statements and the offset spaces before the 6 If I use cmj-j cmd-f , the 6 pops into place, If I use

using JuliaFormatter
JuliaFormatter.format("A.jl");

The 6 pops into place and the extra newline is removed as-well