Peter Law
599a1c3ee1
Handle generics appearing within quoted return annotations
...
This ensures that these quoted likely forwards references in
return type annotations behave like their non-quoted equivalents.
I suspect there may be other places which will need similar
adjustments, which may mean that we should push the conversion
a layer closer to the parsing (perhaps in `py__annotations__`?).
One case I know that this doesn't solve (but which likely needs
similar adjustment) is generics in return types of comment-style
annotations. They're less likely and may not be worth supporting
since all supported Python versions can use the in-syntax spelling
for annotations at this point.
2021-07-25 15:32:22 +01:00
Peter Law
6787719c28
Ensure *args, **kwargs lookthrough works at module scope too
...
This means that passthrough signatures will be found for top level
functions, which is useful both where they're wrappered by
`functools.wraps` or not.
Fixes https://github.com/davidhalter/jedi/issues/1791 .
2021-07-24 16:58:34 +01:00
Peter Law
bb40390225
Add identifiers to these test strings
...
This makes it easier to work out which one fails when pytest
reports a failure. Mostly useful when introducing failing tests,
which I'm about to do.
2021-07-24 16:15:41 +01:00
Peter Law
0d15347210
Remove confusing comment
...
I'm assuming that this is incorrect given that there _are_ arguments
where the comment suggests there aren't any.
2021-07-24 16:14:20 +01:00
Joseph Birkner
a340fe077e
Fixed ZIP completion.
2021-04-29 09:52:08 +02:00
Dave Halter
387d73990b
Fix issues with getitem on compiled objects that have annotations, see #1719
2021-01-17 13:48:22 +01:00
Dave Halter
47d0318fa6
Paths are the default for modules
2021-01-14 02:00:14 +01:00
Dave Halter
2a8b212af7
Move the module_injector
2021-01-14 01:35:18 +01:00
Dave Halter
837cb1106a
Use Path instead of str if possible
2021-01-14 01:32:57 +01:00
Dave Halter
b6fd81f1e1
Another time avoiding a memory leak, also part of #1723
2021-01-14 01:18:00 +01:00
Dave Halter
b9067ccdbb
Avoid caching parso objects, fixes #1723
2021-01-14 00:29:34 +01:00
Dave Halter
44d77523b3
Fix a test that depended on correct cwd location an dnot having an x.py in a local directory
2021-01-10 16:31:37 +01:00
Dave Halter
6279791b24
Fix an issue with complete_search
2021-01-10 16:08:17 +01:00
Dave Halter
8ef2ce232c
Hopefully fix a Windows issue
2021-01-02 18:11:59 +01:00
Dave Halter
4ab7a53c19
Fix a compatibility issue for Python < 3.8
2021-01-02 17:37:30 +01:00
Dave Halter
c5fb2985a3
Use clearly defined project for tests to avoid scanning the 2000 typeshed files all the time
2021-01-02 15:31:57 +01:00
Dave Halter
2ec3d72151
Use "namespace" as a Name.type
2021-01-02 12:14:28 +01:00
Dave Halter
02d43caa5e
Fix a wrong test about references
2021-01-02 01:17:38 +01:00
Dave Halter
55c7e4eb49
Stdlib modules should not be included in the get_references search, fixes davidhalter/jedi-vim#792
2021-01-02 00:58:50 +01:00
Dave Halter
7d160f96f6
Do not show signatures for properties, fixes #1695
2021-01-01 23:51:41 +01:00
Dave Halter
1ccc63e83d
Make py__iter__ work as well for Interpreter
2021-01-01 17:58:31 +01:00
Dave Halter
971913be35
Make it possible to use __getitem__ in interpreter
2021-01-01 15:57:55 +01:00
Dave Halter
85f45771f1
Fix typing.NewType signature
2021-01-01 04:22:52 +01:00
Dave Halter
30e702de11
Generics don't have signatures
2021-01-01 04:09:49 +01:00
Dave Halter
778442a972
Type aliases should not have a signature
2021-01-01 03:59:28 +01:00
Dave Halter
4f34712858
Fix signatures for TypeVar and cast, fixes #1709
2021-01-01 03:59:12 +01:00
Dave Halter
d821451a64
Upgrade typeshed
2021-01-01 03:18:49 +01:00
Dave Halter
92d96ac336
actually use auto_import_modules correctly
2021-01-01 02:59:42 +01:00
Dave Halter
5d2aed34f4
Fix signatures if a decorator has no signatures, fixes #1705
2020-12-28 00:47:10 +01:00
Dave Halter
04c1c0f871
Fix an issue with api_name of class attributes, fixes #1688
2020-12-28 00:29:30 +01:00
Dave Halter
0f128c6deb
Fix nested comprehension contexts, fixes #1691
2020-12-27 21:09:00 +01:00
Dave Halter
52443daf12
Fix another Windows test on 3.8
2020-12-26 12:19:59 +01:00
Dave Halter
86d57edda4
Some Windows compatibility fixes
2020-12-26 11:52:47 +01:00
Dave Halter
3184264b3b
Try to fix windows
2020-12-26 04:16:32 +01:00
Dave Halter
d4a1657b2e
Better error reporting
2020-12-26 04:03:19 +01:00
Dave Halter
b89f9445c2
Merge pull request #1684 from davidhalter/relative-import
...
Relative imports should work even if they are not within the project
2020-12-22 23:18:46 +01:00
Dave Halter
ce6ddb91de
Merge pull request #1711 from davidhalter/deprecations
...
Remove Deprecations
2020-12-21 22:49:09 +01:00
Dave Halter
f9cec89038
Merge branch 'master' into deprecations
2020-12-12 12:17:25 +01:00
Dave Halter
bc4f6ed9dd
Merge branch 'master' into relative-import
2020-12-12 12:15:13 +01:00
Leo Ryu
fd435a7bbb
Check if string_names is None before returning string_names ( #1708 )
...
* Check if string is None before using string_names
* Add test asserting None string_names returns an empty list
* Remove whitespace to pass flake8
* Add name to authors.txt
Co-authored-by: Leo Ryu <leo@episci.com >
2020-12-12 12:13:31 +01:00
Dave Halter
42a759a7ae
Merge pull request #1706 from ColdGrub1384/master
...
Catch 'PermissionError' for unreadable directories
2020-12-07 22:34:03 +01:00
Adrian Labbé
6dcae857a7
Remove 'test_get_parent_dir_with_file'
2020-12-07 14:50:04 -03:00
Dave Halter
34792c0077
Merge pull request #1707 from Carreau/fix-1702
...
Add tests for #1702 , for a rare numpydoc syntax.
2020-12-07 15:07:53 +01:00
Matthias Bussonnier
06d6776422
Add tests for #1702 , for a rare numpydoc syntax.
...
It looks like numpydoc, and things like masked array docstrings use a
syntax that make jedi crash:
fill_value : {var}, optional
Value used internally for the masked values.
If ``fill_value`` is not None, it supersedes ``endwith``.
Here we add a test that we do not crash jedi.
2020-12-06 18:08:51 -08:00
Yoni Weill
1095820006
add tests for get_completion_prefix_length
2020-12-06 21:09:03 +02:00
Adrian Labbé
47e60107b2
Add tests for 'test_get_parent_dir_with_file' and 'test_is_potential_project'
2020-12-06 15:26:20 -03:00
Dave Halter
a03a093e2c
change the create_stub_module stuff a bit
2020-10-24 10:41:59 +02:00
Dave Halter
6094e7b39a
Fix get_line_code for stubs
2020-10-24 10:12:32 +02:00
Dave Halter
98d0a55a02
Add a few more tests for annotations on self
2020-10-23 23:32:28 +02:00
Dave Halter
6eabde1519
Fix annotations on self attributes, fixes #1681
2020-10-23 23:26:07 +02:00