|
1519 | 1519 | (cursor-pos (gethash "cursor_pos" content))
|
1520 | 1520 | (match-set (make-match-set :start cursor-pos :end cursor-pos :code code)))
|
1521 | 1521 | (multiple-value-bind (ename evalue traceback)
|
1522 | | - (let ((*package* package) |
1523 | | - (*readtable* readtable)) |
1524 | | - (complete-code *kernel* match-set code cursor-pos)) |
1525 | | - (if ename |
1526 | | - (send-complete-reply-error ename evalue traceback) |
1527 | | - (send-complete-reply-ok (sort (mapcar #'match-text (match-set-matches match-set)) #'string<) |
1528 | | - (match-set-start match-set) |
1529 | | - (match-set-end match-set) |
1530 | | - (list :object-plist |
1531 | | - "_jupyter_types_experimental" (or (mapcan (lambda (match) |
1532 | | - (when (match-type match) |
1533 | | - (list (list :object-plist |
1534 | | - "text" (match-text match) |
1535 | | - "type" (match-type match))))) |
1536 | | - (match-set-matches match-set)) |
1537 | | - :empty-array)))))))) |
1538 | | - |
| 1522 | + (let ((*package* package) |
| 1523 | + (*readtable* readtable)) |
| 1524 | + (complete-code *kernel* match-set code cursor-pos)) |
| 1525 | + (cond (ename |
| 1526 | + (send-complete-reply-error ename evalue traceback)) |
| 1527 | + (t |
| 1528 | + (setf (match-set-matches match-set) |
| 1529 | + (sort (match-set-matches match-set) #'string< :key #'match-text)) |
| 1530 | + (send-complete-reply-ok (mapcar #'match-text (match-set-matches match-set)) |
| 1531 | + (match-set-start match-set) |
| 1532 | + (match-set-end match-set) |
| 1533 | + (list :object-plist |
| 1534 | + "_jupyter_types_experimental" (or (mapcan (lambda (match) |
| 1535 | + (when (match-type match) |
| 1536 | + (list (list :object-plist |
| 1537 | + "text" (match-text match) |
| 1538 | + "type" (match-type match))))) |
| 1539 | + (match-set-matches match-set)) |
| 1540 | + :empty-array))))))))) |
1539 | 1541 |
|
1540 | 1542 | (defun handle-comm-info-request ()
|
1541 | 1543 | (inform :info *kernel* "Handling comm_info_request message")
|
|
0 commit comments