Skip to content

Commit

Permalink
fix: properly initiate progress notification (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanberg committed Mar 1, 2024
1 parent 4785944 commit 082b8d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
{"lib/next_ls/lsp_supervisor.ex", :exact_eq},
{"lib/next_ls/runtime.ex", :exact_eq}
{"lib/next_ls/runtime.ex", :exact_eq},
{"lib/next_ls/progress.ex", :pattern_match}
]
12 changes: 12 additions & 0 deletions lib/next_ls/progress.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
defmodule NextLS.Progress do
@moduledoc false
@env Mix.env()
def start(lsp, token, msg) do
# FIXME: gen_lsp should allow stubbing requests so we don't have to
# set this in every test. For now, don't send it in the test env
if @env != :test do
GenLSP.request(lsp, %GenLSP.Requests.WindowWorkDoneProgressCreate{
id: System.unique_integer([:positive]),
params: %GenLSP.Structures.WorkDoneProgressCreateParams{
token: token
}
})
end

GenLSP.notify(lsp, %GenLSP.Notifications.DollarProgress{
params: %GenLSP.Structures.ProgressParams{
token: token,
Expand Down

0 comments on commit 082b8d5

Please sign in to comment.