Nova 11 duplicates code after Format Document

Hi there!

I had a look at the new Format Document command of v11 and I experienced a code duplication with two different language servers.

Considering a file with this content:

class MeController < ApplicationController
  def show
  puts "ciao"
  end
end

I would expect the following result after running the command:

class MeController < ApplicationController
  def show
    puts "ciao"
  end
end

Instead I got this:

class MeController < ApplicationController
  def show
    puts "ciao"
  end
end
class MeController < ApplicationController
  def show
  puts "ciao"
  end
end

If it can help this is the response of the formatting request:

[{"newText":"class MeController < ApplicationController\n  def show\n    puts \"ciao\"\n  end\nend\n","range":{"start":{"character":0,"line":0},"end":{"line":5,"character":0}}}]

Since I can’t configure the feature in any way I consider this a Nova issue. If I can help debugging this in any way let me know.

Thanks!

I’m seeing this behaviour as well with my extension; the textDocument/formatting response of my LSP server is handled correctly in VSC, but in Nova the formatted text is inserted into the document instead of replacing the current contents.

1 Like

Thank you for the bug report. We will investigate.

1 Like