Skip to content

Commit c701781

Browse files
authored
Fix progress notification timing (#873)
1 parent 47eb208 commit c701781

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/solargraph/language_server/progress.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,8 @@ def send host
6767

6868
message = build
6969

70-
if created?
71-
host.send_notification '$/progress', message
72-
else
73-
create(host) { host.send_notification '$/progress', message }
74-
end
70+
create(host) unless created?
71+
host.send_notification '$/progress', message
7572
@status = FINISHED if kind == 'end'
7673
end
7774

@@ -86,10 +83,11 @@ def finished?
8683
private
8784

8885
# @param host [Solargraph::LanguageServer::Host]
89-
def create host, &block
90-
return false if created?
86+
# @return [void]
87+
def create host
88+
return if created?
9189

92-
host.send_request 'window/workDoneProgress/create', { token: uuid }, &block
90+
host.send_request 'window/workDoneProgress/create', { token: uuid }
9391
@status = CREATED
9492
end
9593

0 commit comments

Comments
 (0)