Commit Graph
19 Commits
Author SHA1 Message Date
Matthias Bussonnier a9e2cd5a74 Reformat and move imports to top level. 2020-08-03 08:24:24 -07:00
Matthias Bussonnier 20be4f02c8 Turn print into warning to simplify silencing them. 2020-07-27 11:28:05 -07:00
Matthias Bussonnier 5329f95096 Attempt at a test of completion of filepath after ~.
I'm not quite sure how this will behave on windows, and we can't really
create a tempdir (as we don't want to mess with path on home.

One possibility would be to mock/monkeypatch scandir, listdir and
os.path.expanduser or set $HOME in env; but I'm quite unsure we want to
go that route.
2019-08-25 19:55:33 +02:00
Matthias Bussonnier 9a3f41e63b Complete path after ~.
Note this is mostly to discuss as if I understood one of your message on
Twitter, this was not possible without fuzzy completion.

I tried with just this patch and that works great.

Note that unlike IPython that right now does :

    ~/<tab> -> /Full/Path/to/user/home

But with this patch this just complete things correctly without
expanding the tab. And I think not expanding the tab is actually better.

Anyway, open that to better understand the why you were waiting for
fuzzy completion.
2019-08-23 17:57:12 +02:00
Matthias Bussonnier f47211c129 Use scandir on py3.5+ for less disk access on filename completion
On Python 3.5+, we can make use of scandir that not only list the
content of the directory as an iterator but caches some infomations (for
example, `is_dir()`; this avoid extra stats call to the underlying
filesytem and can be – according to pep 471 –  2x to 20 time faster
especially on NFS filesystem where stats call is expensive.

From a quick this is the only place where scandir would make sens, as
most other places only require the name.

Fixes 1381
2019-08-12 17:56:29 -07:00
Matthias Bussonnier ecca190462 Remove forgotten debug/print in filename completion. (#1380)
This is in the latest 0.15, and when forwarding path completions to
jedi, print a lot of stuff on the screen.
2019-08-12 12:37:21 +02:00
Matthias Bussonnier 6f1ee0cfa8 Use stacklevel in warnings or filters don't work.
In particular with the right stacklevel IPython will display the warning
if code is directly entered by the user. Without this info it does not.

Use the opportunity to add in the warning since when things are
deprecated. This leads to one less lookup of information for the user.
2017-04-29 20:13:19 +02:00
Matthias Bussonnier b0f10081d4 Fix : Jedi do not complete numpy arrays in dictionary
Fix ipython/ipython#10468
2017-04-21 13:14:07 +02:00
Matthias Bussonnier 9a851165ad Lookup optimisation
avoid a couple of dynamic lookup in the core of the parsing loop.
Performance improvement will be minimal, but adding a little many time
can be consequent.
2017-03-14 23:55:03 +01:00
Matthias Bussonnier bb8fe0b24c A missing docstring. 2017-03-14 23:54:38 +01:00
Matthias Bussonnier fc27ca1b6a 'fix a couple of error locations' 2017-02-24 13:03:03 +01:00
Matthias Bussonnier 784de85b36 Add test for handeling of newline in multiline strings 2017-02-24 00:05:38 +01:00
Matthias Bussonnier 0fb386d7e2 Make sure error token set the new_line flag when necessary
Should solve #855
2017-02-24 00:05:38 +01:00
Matthias Bussonnier ef1b1f41e4 Use start and end position in repr for simpler debugging. 2017-02-14 23:53:53 +01:00
Matthias Bussonnier b72aa41019 Missing assert 2017-02-08 23:40:23 +01:00
Matthias Bussonnier 0f865a17ef Improve some documentation about name with symbols, name and completion. 2017-01-22 18:41:35 -08:00
Matthias Bussonnier d3e8a9bd52 Resolve kewords types as keyword in completions
Closes #833
2017-01-22 18:39:32 -08:00
Matthias Bussonnier e96cccb81c Document a bit more 2016-05-18 16:48:08 -07:00
Matthias Bussonnier 4ba6000f92 Initialize colorama lazily
Will prevent colorama from wrapping stderr/out if not in debug mode,
which leads to some errors.
2016-05-17 16:49:57 -07:00