Skip to content

Commit

Permalink
increase compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Feb 6, 2024
1 parent 962572c commit 8f6938e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/language_server/lib/language_server/ast_utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,14 @@ defmodule ElixirLS.LanguageServer.AstUtils do
# TODO pass line_length to format
# TODO locals_without_parens to quoted_to_algebra
# TODO pass comments to quoted_to_algebra
code =
code = if Version.match?(System.version(), ">= 1.13.0-dev") do
ast
|> Code.quoted_to_algebra(escape: false)
|> Inspect.Algebra.format(:infinity)
|> IO.iodata_to_binary()
else
Macro.to_string(ast)
end

lines = code |> SourceFile.lines()

Expand Down

0 comments on commit 8f6938e

Please sign in to comment.