File tree Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Original file line number Diff line number Diff line change
1
+ {:linters {:clojure-lsp/unused-public-var {:exclude [lsp4clj.coercer]}}}
Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ - Allow create work-done-progress without percentages, for report only.
6
+
5
7
## v1.7.4
6
8
7
9
- Deprecate ` lsp4clj.socket-server ` and document preferred alternative in the README.
Original file line number Diff line number Diff line change 25
25
26
26
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgress
27
27
"
28
- [percentage message progress-token]
29
- (when progress-token
30
- (let [percentage (int (clamp percentage 0 100 ))
31
- progress (case percentage
32
- ; ; TODO: this is a bit restricting. Technically the 'begin'
33
- ; ; message can start at a higher `percentage`, and it can
34
- ; ; have a `message`. To work around this, it's possible to
35
- ; ; publish a 'begin' immediately followed by a 'progress'
36
- ; ; with the desired percentage and message.
37
- 0 {:kind :begin
38
- :title message
39
- :percentage 0 }
40
- 100 {:kind :end
41
- :message message}
42
- {:kind :report
43
- :message message
44
- :percentage percentage})]
45
- {:token progress-token
46
- :value progress})))
28
+ ([message progress-token]
29
+ (work-done-progress nil message progress-token))
30
+ ([percentage message progress-token]
31
+ (when progress-token
32
+ (let [percentage (when percentage (int (clamp percentage 0 100 )))
33
+ progress (cond
34
+ ; ; TODO: this is a bit restricting. Technically the 'begin'
35
+ ; ; message can start at a higher `percentage`, and it can
36
+ ; ; have a `message`. To work around this, it's possible to
37
+ ; ; publish a 'begin' immediately followed by a 'progress'
38
+ ; ; with the desired percentage and message.
39
+ (= 0 percentage) {:kind :begin
40
+ :title message
41
+ :percentage 0 }
42
+ (= 100 percentage) {:kind :end
43
+ :message message}
44
+ :else
45
+ (cond->
46
+ {:kind :report
47
+ :message message}
48
+ percentage (assoc :percentage percentage)))]
49
+ {:token progress-token
50
+ :value progress}))))
You can’t perform that action at this time.
0 commit comments