Skip to content

Commit c10ab90

Browse files
committed
fix: log next-ls version on start
1 parent f6c7c87 commit c10ab90

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/next_ls.ex

+8-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ defmodule NextLS do
148148

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

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

@@ -381,4 +381,11 @@ defmodule NextLS do
381381
|> Base.url_encode64(padding: false)
382382
|> binary_part(0, 8)
383383
end
384+
385+
defp version() do
386+
case :application.get_key(:next_ls, :vsn) do
387+
{:ok, version} -> to_string(version)
388+
_ -> "dev"
389+
end
390+
end
384391
end

test/next_ls_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ defmodule NextLSTest do
124124
})
125125

126126
assert_notification "window/logMessage", %{
127-
"message" => "[NextLS] LSP Initialized!",
127+
"message" => "[NextLS] NextLS v" <> _,
128128
"type" => 4
129129
}
130130

0 commit comments

Comments
 (0)