Commit graph

35 commits

Author SHA1 Message Date
John Miller
88a52f52ea Eldoc support should only show the function signature.
Returning the entire help string can be distracting as the minibuffers expands
to try to fit everything on string. The point of eldoc is to help with function
signature.
2019-06-01 09:51:19 -05:00
John Miller
70845a3411
Use completing-read instead of ido-completing-read. (#514)
* Use completing-read instead of ido-completing-read.

Per @seagle0128 and issue #496.

* lisp/ein-notebook.el:

* Wrap all calls to completing-read with ein:completing-read

Use `ein:completing-read' everywhere we need to do completion as it wraps Emacs
completing-read functionality and tries to use sane defaults.
2019-04-16 10:04:11 -05:00
dickmao
921b3a94e4 need to see websocket output of eldoc call 2019-04-14 14:39:46 -04:00
dickmao
7cb37f4093 add diagnostic to eldoc test failure 2019-04-02 11:00:31 -04:00
dickmao
234cf391f9 Polymode
M-x customize-group RET ein
Toggle Ein:Polymode

Avoid trying to emulate jump-to-definition, eldoc, and autocompletion
functionalities that Elpy will always do better.

Fixes #497 #482 #418
2019-04-02 09:35:17 -04:00
dickmao
fbda27ba7f Surface curl errors
In light of #425 and #456, provide more guidance on curl errors.

Also, clean up eldoc stub.  Leveraging elpy's eldoc perfection seems
the only sensible choice, however.
2019-01-21 13:42:35 -05:00
dickmao
129afa5fb4 Respect cursor_start and cursor_end in matches
The :cursor_start and :cursor_end fields tell us whether we need to
prepend the prefix ourselves.

Fixes #436
2018-12-28 21:14:11 -05:00
dickmao
20de508c52 make test-compile and make install
test-compile attempts to egrep "bad" warnings with hardcoded strings.
This is better than nothing, but misses a lot.  We are close
to elimiinating this hack in favor of `(setq
byte-compile-error-on-warn t)` to enforce no warnings whatsoever.  Until
then, keep adding egrep strings to `test-compile`.

Without `(package-refresh-contents)`, the `make install` won't be able
to download and install dependencies for new users.  Remedy this.

Retire files that will never be used.
2018-12-01 08:32:56 -05:00
dickmao
d4ef4ed81c Allow disabling of autocomplete
```
M-x customize-group RET ein-completion
```
Set `Ein:Completion Backend` to `ein:use-none-backend`, Set `State` to
`Save for Future Sessions`.

Also use `featurep` and `with-eval-after-load` to clean up the
subpackage requiring gymnastics.
2018-11-28 17:45:23 -05:00
John Miller
f459747352 ein-company: Install pytools when missing.
During kernel resets ein's pytools code can be lost. We try, crudely, to detect
this situation and reinject the code.
2018-11-24 10:23:34 -06:00
John Miller
e280bb8633 ein-company: Add completion caching, make caching kernel specific. 2018-11-22 09:07:02 -07:00
John Miller
fcb4040850 ein-completer: Robuster oinfo
By covering our ears and ignoring as much as possible. Apparently SyntaxError is
not a subtype of Exception. Also need to send raw strings otherwise unicode
characters will cause fits.

Also added new command, `ein:pytools-reinject` to reinject ein's pytools code.
The name could probably use some work.
2018-11-05 17:05:38 -06:00
John Miller
dd8a1607cd ein-pytools: Make pytools work over remote connections.
Python running on a remote connection doesn't know how to find files on the
local machine, apparently, so we take the route instead of sending the contents
of a temporary buffer loaded with the pytools python code to the running kernel.
2018-11-02 06:32:10 -05:00
John Miller
78994fbe58 Always return an info object, don't always log a completer error.
I am expecting that `ein:completions--prepare-oinfo' will error out depending on
the type of python object we are looking at, so no need to log an error every
time this happens as it will unnecessarily fill the ein log buffer and generate
lots of annoying notifications in the notebook buffer.
2018-11-01 20:59:23 -05:00
John Miller
3df0552104 Get rid of log messages, fix some ein.py blunders.
*ein:log-all* will grow very quickly if we keep these log commands in.
2018-11-01 20:29:13 -05:00
John Miller
db310073c4 Robustly build oinfo cache.
EIN tries to build a cached of pdef's for all potential completion symbols. This
is problematic because not all completion symbols have a pdef and can cause
python to throw exceptions in entertaining and hard to catch ways. We take a
liberal approach and ignore anything that throws an exception when we try to
inspect it.

Eldoc support should also be more robust because of these changes as well.
2018-11-01 20:26:42 -05:00
dickmao
aaeffa4596 end deferred chain on bad login 2018-10-28 13:48:53 -04:00
dickmao
b950bd3a4c Fix "Kernel is busy..." bug
One line change to fix header not updating after cell execution
(keeps saying "Kernel is busy").

The bug does not manifest when running with `ein:debug` true since
EMACS's display loop updates more frequently with debug messages.

In tracking this bug, noticed eldoc support isn't quite there.
`__import__('ein').print_object_info_for(%s)` appears in
`ein-completer` and `ein-pytools`, and is invalid python syntax
afaict.  Took a few steps to make it whole, but incomplete.
2018-10-27 23:04:04 -04:00
John Miller
a3482660a2 Support eldoc.
Really basic support for eldoc, buidling off the oinfo cache code written to
support function annotations for the ein company backend. In theory should also
work the other completion backends, but untested at the moment.
2018-09-18 21:48:07 -05:00
Sam Steingold
5cb717a9c2 fix typos in the last patch 2018-09-04 10:35:35 -04:00
John Miller
7320c16b47 ein-company: Function annotations via oinfo db
As ein builds completions for company it will build a database of object-info
data that can later be used for function annotations.
2018-09-03 16:06:15 -05:00
John Miller
8b7f26d668 Refactor object info for company annotations. 2018-09-02 23:24:21 -05:00
Sam Steingold
9cb9dd7345 now that auto-complete is an official dependency, we can require it unconditionally
this allows us to get rid of the ugly eval on a macro
2018-05-31 19:55:45 -04:00
John Miller
08d2792d69 Better interface for customizing code completion in ein.
Please see the new variable `ein:completion-backend'. Use this variable to
configure which completion backend to use in ein. Currently we support
auto-complete, company-mode, and jedi using auto-complete.
2017-07-14 19:53:14 -05:00
John Miller
261576f94b Fix Issue #67.
Only six months late. Jupyter changed callback signature for
complete_request, breaking ein's autocomplete code. Missed this for so
long because I am lazy and almost exclusively used jedi for
autocompletion. Ugh.
2016-02-03 22:26:53 -06:00
Takafumi Arakaki
5ab8e39d7c Change ein:completer-complete call signature 2012-12-06 17:48:05 +01:00
Takafumi Arakaki
b501948d6d Do not expand common part by ein:completer-dot-complete
* Change the call signature of completer callback, to
  pass arguments to completer callback.
* Use expand option to suppress auto expansion when
  used as dot-complete.
2012-12-06 16:52:56 +01:00
Takafumi Arakaki
42508f6bc3 Docstring for ein:completer-complete 2012-12-05 22:13:11 +01:00
Takafumi Arakaki
4efb68e226 Refactoring: ein:completer-complete can take CALLBACKS argument 2012-11-19 20:46:09 +01:00
Takafumi Arakaki
ca8c1678fe (require 'ein-utils) -> (require 'ein-core) 2012-08-28 15:26:32 +02:00
Takafumi Arakaki
c55e4c83c0 Move completion functions to ein-completer.el
Unify functions in ein-notebook.el and ein-connect.el.
2012-08-19 23:04:00 +02:00
Takafumi Arakaki
12fae49898 Fix arguments of other callbacks
Any callbacks called from ein:kernel--handle-shell-reply are passed
metadata.  Therefore, complete/tooltip callbacks must be changed.
2012-08-08 23:27:07 +02:00
Takafumi Arakaki
99c0441992 Respect ein:use-auto-complete in ein:completer-choose 2012-07-23 20:37:32 +02:00
Takafumi Arakaki
182cfe8672 Add debug logs in finish-completing functions 2012-07-23 20:33:46 +02:00
Takafumi Arakaki
d1031fd61e mv *ein*.el ein.py lisp/
fixes #6
2012-07-02 16:47:20 +02:00
Renamed from ein-completer.el (Browse further)