Skip to content

Commit b7cdf49

Browse files
committed
fix: properly initiate progress notification
1 parent 4785944 commit b7cdf49

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Diff for: .dialyzer_ignore.exs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
22
{"lib/next_ls/lsp_supervisor.ex", :exact_eq},
3-
{"lib/next_ls/runtime.ex", :exact_eq}
3+
{"lib/next_ls/runtime.ex", :exact_eq},
4+
{"lib/next_ls/progress.ex", :pattern_match}
45
]

Diff for: lib/next_ls/progress.ex

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
defmodule NextLS.Progress do
22
@moduledoc false
3+
@env Mix.env()
34
def start(lsp, token, msg) do
5+
# FIXME: gen_lsp should allow stubbing requests so we don't have to
6+
# set this in every test. For now, don't send it in the test env
7+
if @env != :test do
8+
GenLSP.request(lsp, %GenLSP.Requests.WindowWorkDoneProgressCreate{
9+
id: System.unique_integer([:positive]),
10+
params: %GenLSP.Structures.WorkDoneProgressCreateParams{
11+
token: token
12+
}
13+
})
14+
end
15+
416
GenLSP.notify(lsp, %GenLSP.Notifications.DollarProgress{
517
params: %GenLSP.Structures.ProgressParams{
618
token: token,

0 commit comments

Comments
 (0)