elbywan / crystalline

A Language Server Protocol implementation for Crystal. 🔮
MIT License
436 stars 23 forks source link

indentation error when enable lsp with crystallize. #42

Closed zw963 closed 2 years ago

zw963 commented 2 years ago

Please check following code example:

macro included
  def hello
    puts "hello"
  end
  end

The end in the last line not get indent correct.

If disable lsp with lsp-disconnect, it works as expected.

elbywan commented 2 years ago

Hey @zw963,

crystalline uses the official formatter from the compiler. Try to run crystal tool format on your snippet, it should produce the same output.

zw963 commented 2 years ago

Yes, you are right, the compiler just no-op, keep the wrong indentation no touch.