Commit Graph

7855 Commits

Author SHA1 Message Date
yuan
ca08365a81 fix typo 2020-05-28 21:29:34 +02:00
Dave Halter
8239328e42 Merge pull request #1599 from isidentical/py38-plus-setuppy
Upgrade setup.py's version parsing for 3.8+
2020-05-28 21:18:51 +02:00
Batuhan Taskaya
b9131c6070 Upgrade setup.py's version parsing for 3.8+ 2020-05-28 15:26:48 +03:00
Dave Halter
2d672d2f28 Merge pull request #1595 from PeterJCLaw/operator-not-in
Explicitly handle `a not in b` operator comparison
2020-05-23 14:48:40 +02:00
Peter Law
c62cbd6654 Explicitly handle a not in b operator comparison
This avoids a `KeyError` from operator_to_magic_method lookup for
this case. Jedi probably could check for `__contains__` here, however
as it doesn't do so for `in` checks I'm following that lead for now.

Fixes https://github.com/davidhalter/jedi/issues/1594.
2020-05-23 12:49:53 +01:00
Christopher Cave-Ayland
860d5e8889 Import FileNotFoundError from jedi._compatibility 2020-05-21 11:45:52 +02:00
Dave Halter
64d131060c Merge pull request #1586 from PeterJCLaw/django-more-fields
Support more Django model fields
2020-05-19 00:39:27 +02:00
Peter Law
b7cdec427e Support OneToOneFields 2020-05-18 22:19:20 +01:00
Peter Law
df66b35444 Support UUIDFields 2020-05-18 22:11:31 +01:00
Peter Law
cd9f2f31ea Support URLFields 2020-05-18 22:10:48 +01:00
Peter Law
b54d7433c7 Support GenericIPAddressFields 2020-05-18 22:10:09 +01:00
Dave Halter
855fb5a936 Fix potential AttributeError in get_defintion_start_position/get_defintion_end_position, see #1584 2020-05-18 19:21:04 +02:00
Dave Halter
8fdf16b316 Fix an error of get_definition_end_pos, see #1584 2020-05-18 01:44:51 +02:00
Dave Halter
fa6194c0a9 Refactor test_definition_start_end_position to use parametrize 2020-05-18 01:41:07 +02:00
Dave Halter
2d17b81313 definition_end_position -> get_definition_end_position, same for start, see #1584 2020-05-18 01:18:22 +02:00
Dave Halter
cb1730f628 Merge pull request #1584 from pappasam/get_definition_position
Add BaseName.definition_[start,end]_position
2020-05-18 01:14:00 +02:00
Sam Roeca
d848047012 Add unit tests for definition_[start,end]_position 2020-05-17 11:48:28 -04:00
Sam Roeca
716beae455 Add BaseName.definition_[start,end]_position
Provides two public (property) methods getting the (row, column) of the
start / end of the definition range. Rows start with 1, columns start
with 0.

:rtype: Tuple[int, int]
2020-05-16 15:08:36 -04:00
Dave Halter
d16355fcf2 Fix tests in Python 2 2020-05-16 17:47:33 +02:00
Dave Halter
cd3d40a3b8 Fix a small issue 2020-05-16 15:42:15 +02:00
Dave Halter
b3fc10a6e4 Magic methods fixes for reverse methods 2020-05-16 15:39:48 +02:00
Dave Halter
09dbbc6361 lists and tuples should not be added 2020-05-16 15:10:47 +02:00
Dave Halter
f5ad561c51 Use __truediv__ instead of __div__
This ignores Python 2, but that shouldn't be an issue, since we are going to drop it anyway.
2020-05-16 14:57:57 +02:00
Dave Halter
0db50b521d Fix an issue with Tuple generics 2020-05-16 14:55:59 +02:00
Dave Halter
9942a3d44c A few class renames 2020-05-16 14:35:15 +02:00
Dave Halter
47637c147c Better debugging 2020-05-16 14:31:31 +02:00
Dave Halter
2fb072532a Skip another non-important Python 2 test that fails on Windows 2020-05-16 01:25:15 +02:00
Dave Halter
70aa7fc917 Fix a namespace issue when getting references 2020-05-16 01:05:39 +02:00
Dave Halter
384b2ad014 Fix an about dict completions 2020-05-16 00:46:46 +02:00
Dave Halter
f2975f9a05 Fix a None issue 2020-05-16 00:27:14 +02:00
Dave Halter
41c146a6f3 Implement magic method return values, fixes #1577 2020-05-15 23:53:44 +02:00
Dave Halter
be594f1498 Remove an unused cache method 2020-05-15 23:53:44 +02:00
Dave Halter
99eba4e0eb Undefined api types should not return a random value 2020-05-15 23:53:44 +02:00
Peter Law
43806f8668 Add support for generic optional parameters (#1559)
* Add support for generic optional parameters

* Tests for passing non-optional arguments to optional parameters

* Remove now-redundant is_class_value handling

This parameter has since been removed from infer_type_vars methods,
much simplifying the code.
2020-05-15 19:56:03 +02:00
Dave Halter
d4aa583e16 Fix inline case where a name was removed without the code being used, fixes #1582 2020-05-14 23:08:37 +02:00
Dave Halter
381fbeda6a Make the diff nicer if there is no ending newline, fixes #1581 2020-05-14 00:20:20 +02:00
Dave Halter
3104443212 Merge pull request #1579 from muffinmad/pseudotreenameclass
Return 'class' as _PseudoTreeNameClass.type (fix #1578)
2020-05-13 18:59:05 +02:00
muffinmad
16e2b86bcf Fix test 2020-05-13 01:18:47 +03:00
Dave Halter
0caee73975 Merge pull request #1572 from davidhalter/classvar
Remove is_class_value from infer_type_vars
2020-05-12 23:56:03 +02:00
Dave Halter
7f25e28d89 Fix tuple issue in 3.6 2020-05-12 23:33:06 +02:00
muffinmad
ce8473ee63 Add author's name to AUTHORS.txt 2020-05-12 23:34:28 +03:00
muffinmad
7ccee7d8fc Add test _PseudoTreeNameClass.type == 'class' 2020-05-12 23:28:46 +03:00
muffinmad
7cd89cff6e Return 'class' as BaseName.type of _PseudoTreeNameClass (fix #1578) 2020-05-12 23:14:32 +03:00
Vlad Serebrennikov
e1c0d2c501 Reduce noise in signatures of compiled params (#1564)
* Remove "typing." prefix from compiled signature param

* Don't print default "None" for Optional params

* Don't remove 'typing.' prefix if symbol doesn't come from typing module

* Revert "Don't print default "None" for Optional params"

This reverts commit 8db334d9bb.

* Make sure "typing." doesn't appear in the middle

* Make sure only "typing." prefix is removed and not it's entries in the middle

* Use inspect.formatannotation() to create an annotation string

* Update AUTHORS.txt

* Add test for compiled param annotation string

* Replace Optional in test with other typing facilities

in order for test to be forward-compatible with 3.9

* Add an empty string fallback for Python 2

* Move _annotation_to_str back to original position
2020-05-10 13:33:36 +02:00
Dave Halter
be7a1346ec Fix #1573 again; a tree_node can be None 2020-05-10 13:29:58 +02:00
Dave Halter
6dbc5e783e Fix argument clinic unpacking, remove dynamic bullshit 2020-05-10 13:27:20 +02:00
Max Mäusezahl
1115cbd94d This fixes two issues with the caching on Windows:
* the cache directory should really be %LOCALAPPDATA%
 * ~ is not a meaningful directory on Windows. It should really be
   os.path.expanduser('~'). To be honest it is probably always safe to
   assume that os.getenv('LOCALAPPDATA') executes to something sensible
   on any Windows system that hasn't been tampered with.
2020-05-10 11:46:29 +02:00
Dave Halter
bf4ec2282f Fix getattr completions on very weird cases, fixes #1573 2020-05-10 11:37:58 +02:00
Dave Halter
e6e43413ff Any -> AnyClass 2020-05-10 03:17:52 +02:00
Dave Halter
e9a0c01af8 TypedDictBase -> TypedDictClass 2020-05-10 03:17:07 +02:00