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) {
140140 return
141141 }
142142
143- items := diagnostics .Diagnostics
143+ items := []protocol.Diagnostic {}
144+ if diagnostics != nil {
145+ items = diagnostics .Diagnostics
146+ }
147+
144148 limit := requestData .Limit
145149 if limit != nil && uint64 (len (items )) > * limit {
146150 items = items [:* limit ]
@@ -204,7 +208,10 @@ func (a *API) completion(w http.ResponseWriter, r *http.Request) {
204208 return
205209 }
206210
207- items := completion .Items
211+ items := []protocol.CompletionItem {}
212+ if completion != nil {
213+ items = completion .Items
214+ }
208215 limit := requestData .Limit
209216 if limit != nil && uint64 (len (items )) > * limit {
210217 items = items [:* limit ]
You can’t perform that action at this time.
0 commit comments