File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,11 @@ func (a *API) diagnostics(w http.ResponseWriter, r *http.Request) {
140
140
return
141
141
}
142
142
143
- items := diagnostics .Diagnostics
143
+ items := []protocol.Diagnostic {}
144
+ if diagnostics != nil {
145
+ items = diagnostics .Diagnostics
146
+ }
147
+
144
148
limit := requestData .Limit
145
149
if limit != nil && uint64 (len (items )) > * limit {
146
150
items = items [:* limit ]
@@ -204,7 +208,10 @@ func (a *API) completion(w http.ResponseWriter, r *http.Request) {
204
208
return
205
209
}
206
210
207
- items := completion .Items
211
+ items := []protocol.CompletionItem {}
212
+ if completion != nil {
213
+ items = completion .Items
214
+ }
208
215
limit := requestData .Limit
209
216
if limit != nil && uint64 (len (items )) > * limit {
210
217
items = items [:* limit ]
You can’t perform that action at this time.
0 commit comments