question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto formatter inserts lots of empty lines at beginning of some modules

See original GitHub issue

Description

Auto formatter inserts lots of empty lines at beginning of some modules.

  • Attached Athasha.Phoenix-main.zip with phoenix project that builds correctly
  • Launch VSCode and wait for elixir-ls to build
  • Trigger auto formatter on lib/athasha/auth.ex or lib/athasha_web/router.ex
  • Lots of empty lines are inserted just after the first defmodule line
  • Most other files work fine
  • Output panel attached ElixirLS_Output.txt

Environment

  • Elixir & Erlang versions (elixir --version): Erlang/OTP 21 [erts-10.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] Elixir 1.11.3 (compiled with Erlang/OTP 21)
  • VSCode ElixirLS version: 0.6.4
  • Operating System Version: win32 10.0.18363
  • VSCode About
Version: 1.53.0 (user setup)
Commit: 8490d3dde47c57ba65ec40dd192d014fd2113496
Date: 2021-02-03T20:36:38.611Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.18363

Troubleshooting

  • Restart your editor (which will restart ElixirLS) sometimes fixes issues
  • Stop your editor, remove the entire .elixir_ls directory, then restart your editor

Capture1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
CallumVasscommented, Mar 10, 2021

FYI. You can use 0.6.5 of this extension now by changing your VS Code settings to be just LF in your settings.json file:

“files.eol”: “\n”,

Tested on Windows machine just now.

0reactions
Attramscommented, Mar 25, 2021

I am currently using a windows machine and this stopped when I changed the End of line sequence from CRLF to LF.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convention about empty lines #57 - rust-lang/fmt-rfcs - GitHub
Hi everybody. It looks like there is no any convention about empty lines. I like to separate all function with one empty line....
Read more >
Is there any Visual Studio Code code formatter that keeps ...
I know that "clean code" is supposed to have just one empty line between selectors, but especially in SCSS-files whitespace comes free, ...
Read more >
Adding empty lines for readability - lyx - LaTeX Stack Exchange
One thing you can do as a "dummy marker" is to insert an "ERT" box ( Ctrl + L or Alt + I...
Read more >
Rationale - Prettier
Prettier collapses multiple blank lines into a single blank line. Empty lines at the start and end of blocks (and whole files) are...
Read more >
doctest — Test interactive Python examples — Python 3.11.1 ...
The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to verify that they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found