Skip to content

Commit

Permalink
fix: log next-ls version on start
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanberg committed Jun 24, 2023
1 parent f6c7c87 commit c10ab90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/next_ls.ex
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ defmodule NextLS do

@impl true
def handle_notification(%Initialized{}, lsp) do
GenLSP.log(lsp, "[NextLS] LSP Initialized!")
GenLSP.log(lsp, "[NextLS] NextLS v#{version()} has initialized!")

working_dir = URI.parse(lsp.assigns.root_uri).path

Expand Down Expand Up @@ -381,4 +381,11 @@ defmodule NextLS do
|> Base.url_encode64(padding: false)
|> binary_part(0, 8)
end

defp version() do
case :application.get_key(:next_ls, :vsn) do
{:ok, version} -> to_string(version)
_ -> "dev"
end
end
end
2 changes: 1 addition & 1 deletion test/next_ls_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ defmodule NextLSTest do
})

assert_notification "window/logMessage", %{
"message" => "[NextLS] LSP Initialized!",
"message" => "[NextLS] NextLS v" <> _,
"type" => 4
}

Expand Down

0 comments on commit c10ab90

Please sign in to comment.