File tree 4 files changed +26
-8
lines changed
4 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 28
28
- Add refactoring ` Restructure keys ` , the inverse of ` Destructure keys ` . #1170
29
29
- Add refactorings to convert between ` (:x m) ` and ` (get m :x) ` or ` (:y (:x m)) ` and ` (get-in m [:x :y]) ` . #1172
30
30
- Add support to imported java class on completion. #1193
31
+ - Add new question to skip or retry classpath scan during startup if failed.
31
32
32
33
## 2022.07.24-18.25.43
33
34
Original file line number Diff line number Diff line change 126
126
:actions actions}
127
127
(conform-or-log ::coercer/show-message-request )
128
128
(lsp.server/send-request server " window/showMessageRequest" ))
129
- response (lsp.server/deref-or-cancel request 10e3 ::timeout )]
129
+ ; ; High timeout as we probably want to wait some time for user input
130
+ response (lsp.server/deref-or-cancel request 10e5 ::timeout )]
130
131
(when-not (= response ::timeout )
131
132
(:title response)))))
132
133
Original file line number Diff line number Diff line change 72
72
{:command command
73
73
:error (.getMessage e)}))))
74
74
75
+ (defn ^:private lookup-classpath-handling-error! [project-spec root-path producer]
76
+ (let [{:keys [command error paths]} (lookup-classpath! root-path project-spec)
77
+ retry-action " Retry"
78
+ ignore-action " Ignore" ]
79
+ (if error
80
+ (do
81
+ (logger/error (format " Error while looking up classpath info in %s. Error: %s" (str root-path) error))
82
+ (if-let [chosen-action (producer/show-message-request
83
+ producer
84
+ (format (str " LSP classpath lookup failed when running `%s`. Some features may not work properly if ignored.\n\n "
85
+ " Error: %s\n\n Choose an option:" ) command error)
86
+ :warning
87
+ [{:title retry-action}
88
+ {:title ignore-action}])]
89
+ (if (= retry-action chosen-action)
90
+ (recur project-spec root-path producer)
91
+ (do
92
+ (logger/warn (format " Classpath lookup retry skipped by user" ))
93
+ paths))
94
+ (logger/warn (format " Invalid classpath lookup option, skipping lookup" ))))
95
+ paths)))
96
+
75
97
(defn scan-classpath! [{:keys [db* producer]}]
76
98
(let [db @db*
77
99
root-path (shared/uri->path (:project-root-uri db))]
78
100
(->> (settings/get db [:project-specs ])
79
101
(filter (partial valid-project-spec? root-path))
80
- (map #(lookup-classpath! root-path %))
81
- (map (fn [{:keys [command error paths]}]
82
- (when error
83
- (logger/error (format " Error while looking up classpath info in %s. Error: %s" (str root-path) error))
84
- (producer/show-message producer (format " Classpath lookup failed when running `%s`. Some features may not work properly. Error: %s" command error) :error error))
85
- paths))
102
+ (mapv #(lookup-classpath-handling-error! % root-path producer))
86
103
(reduce set/union))))
87
104
88
105
(defn ^:private classpath-cmd->windows-safe-classpath-cmd
Original file line number Diff line number Diff line change 223
223
(analyze-external-classpath! root-path (-> @db* :settings :source-paths ) classpath progress-token components))
224
224
(logger/info " Caching db for next startup..." )
225
225
(upsert-db-cache! @db*))))
226
-
227
226
(publish-task-progress producer (:resolving-config task-list) progress-token)
228
227
(when-let [classpath-settings (and (config/classpath-config-paths? settings)
229
228
(:classpath @db*)
You can’t perform that action at this time.
0 commit comments