Skip to content

Commit

Permalink
Fix completion mechanism
Browse files Browse the repository at this point in the history
Problem
-------
Message body for the "complete_request" [changed][1].

> Changed in version 5.0: line, block, and text keys are removed in
favor of a single code for context. Lexing is up to the kernel.

Solution
--------

Update type definition for the message body.

  header: {..., "msg_type":"complete_request"}
  parent: {}
  content: {"code":"List.","cursor_pos":5}

Tested
------

Manually.

  header: {....,"msg_type":"complete_reply"}
  content: {"matches":["List.length","List.hd",...,"List.merge"],
            "matched_text":"List.","status":"ok"}

Actually `matched_text` is removed from the reply body too in favor
of `cursor_start` and `cursor_end`. By default, if missing,
they describe the same text that was sent in the request.

[1]: https://ipython.org/ipython-doc/3/development/messaging.html#completion
  • Loading branch information
Volodymyr Vitvitskyi committed Dec 10, 2015
1 parent 7c9abeb commit 5733a22
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Ipython_json.atd
Expand Up @@ -105,9 +105,7 @@ type object_info_reply = {
(*********************************************************************)

type complete_request = {
cr_text <json name="text"> : string;
line : string;
block : unit;
line <json name="code"> : string;
cursor_pos : int;
}

Expand Down

0 comments on commit 5733a22

Please sign in to comment.