Dave Halter
13254a30df
Docs: Restructure API overview
2020-03-14 14:28:06 +01:00
Dave Halter
bedf3bff0e
Add Project.complete_search instead of the complete param
2020-03-10 08:31:15 +01:00
Dave Halter
53f39c88e4
Try to fix a few more stub issues in search
2020-03-08 15:02:00 +01:00
Dave Halter
d3e3021a3d
Care better about stubs for code search
2020-03-08 13:16:06 +01:00
Dave Halter
a5f7412296
Load stub modules if it's a stub
2020-03-08 11:51:39 +01:00
Dave Halter
f147cb1133
Make it possible to get stdlib modules for project search
2020-03-07 19:42:27 +01:00
Dave Halter
c159b9debd
Get namespace package searches working
2020-03-07 17:14:47 +01:00
Dave Halter
eecdf31601
Make it possible to search folders __init__ files
2020-03-07 13:57:14 +01:00
Dave Halter
7f2f025866
Move get_module_names to api.helpers
2020-03-06 14:32:52 +01:00
Dave Halter
6e3bd38600
Start merging efforts for project search and file search
...
First project tests are passing
2020-03-06 13:32:04 +01:00
Dave Halter
e6bdaea73e
Actually implement symbol search for projects
2020-03-06 11:15:34 +01:00
Dave Halter
ebb9df07f3
Progress for recursive symbol searches
2020-03-06 10:31:48 +01:00
Dave Halter
b4494e588f
A prefixed path should not also be suffixed
2020-02-11 18:34:41 +01:00
Dave Halter
841fe75326
Fix an issue with environment selection
2020-02-06 22:41:11 +01:00
Dave Halter
8ff2ea4b38
Make sure to not load unsafe modules anymore if they are not on the sys path, fixes #760
2020-01-31 13:09:28 +01:00
Dave Halter
e7a77e438d
Remove python_version again, it might not be needed
2020-01-31 02:15:24 +01:00
Dave Halter
a05628443e
Make sure serialization works for projects
2020-01-31 02:14:34 +01:00
Dave Halter
d09882f970
Remove django from the project API
2020-01-31 01:50:52 +01:00
Dave Halter
e5ec2a3adf
Introduce two new Project params: python_path, python_version
2020-01-31 01:46:55 +01:00
Dave Halter
251ff447bc
Add added_sys_path to Project, fixes #1334
2020-01-31 00:08:24 +01:00
Dave Halter
86071dda54
Use a different sys path for import completions and import type inference
...
Fix tests of the #1451 pull request
2019-12-01 00:12:19 +01:00
Sam Roeca
1ba83414a5
Change search strategy for adding parent paths:
...
1. skip dirs with __init__.py
2. Stop immediately when above self._path
2019-11-30 10:14:28 -05:00
Sam Roeca
c2fd7b3104
Fix: upward search omits unnecessary paths
...
In the previous implementation, Jedi's traverse_parents function
traversed parent directories to the system root every time. This would
inadvertently add every folder to the system root every time. Obviously,
this is not the behavior desired for the import system.
This commit collects directories in an upward search until we:
1. Hit any directory without an __init__.py, AND
2. Are above self._path.
2019-11-29 21:12:12 -05:00
Sam Roeca
4bc4f167e9
Revert "Fix: no longer shows folders recursively to root"
...
This reverts commit 03b4177d3d .
2019-11-29 20:11:23 -05:00
Sam Roeca
03b4177d3d
Fix: no longer shows folders recursively to root
...
In the previous implementation, Jedi would's traverse_parents function
traversed parent directories to the system root every time. This would
inadvertently add every folder to the system root every time. Obviously,
this is not the behavior desired for the import system.
This pull request provides a new argument to the traverse_parents
function, "root", which represents the root parent for the search. This
argument defaults to None, thereby preserving the existing behavior of
the function.
I chose to duplicate some code for performance reasons. Since I'm trying
to avoid too much path manipulation magic, we do:
* a search to a valid specified root, OR
* a simple upward search until hitting the system root when there is no
valid root specified.
2019-11-28 23:04:08 -05:00
Dave Halter
03920502c4
infer_state -> inference_state
2019-08-16 11:44:30 +02:00
Dave Halter
a5dff65142
Evaluator -> InferState
2019-08-15 00:37:51 +02:00
Dave Halter
3b4f292464
Move the evaluate package to inference
2019-08-15 00:14:26 +02:00
Dave Halter
c413b486fb
Actually import IsADirectoryError
2019-06-22 15:43:11 +02:00
Dave Halter
3ae4a154f9
Fix project search if a directory is called manage.py, fixes #1314
2019-06-22 14:04:32 +02:00
Dave Halter
8c9ac923c6
Fix import names from sys path generation
2019-04-08 19:35:58 +02:00
Dave Halter
5743f54d69
One more relative import fix
2019-03-08 16:01:56 +01:00
Marc Zimmermann
cc0c4cc308
fixing permission denied errors with project.json
2019-02-16 04:28:26 +01:00
Dave Halter
4b276bae87
The import resolution for namespace packages was wrong
...
With this change we can now include all parents of the script, which will make
relative imports always work.
Now the whole meta_path is scanned and not just importlib's PathFinder.
Fixes #1183 .
2018-07-21 00:16:10 +02:00
Dave Halter
a12d62e9c9
Don't mutate the sys.path. This is pretty nasty bug that fixes #1148
2018-07-04 08:40:05 +02:00
Dave Halter
a972d49e88
Cache default environment
2018-04-15 15:28:05 +02:00
Dave Halter
9f07e7e352
Remove from_executable, were not really using it, yet.
2018-04-14 15:13:02 +02:00
Dave Halter
b8e879bc53
DefaultEnvironment -> SameEnvironment
2018-04-12 09:00:19 +02:00
Dave Halter
074d0d6d07
Include __init__.py files in search for the project directory, fixes #773
2018-03-04 21:36:59 +01:00
Dave Halter
24adebb69d
Add the travere_parents function to a utility directory
2018-02-16 21:07:36 +01:00
Dave Halter
5453566352
Use the project path as a prefix, because many times it's used as a higher priority than other stuff
2018-02-16 20:37:03 +01:00
Dave Halter
424b6ae907
Rename of buildout stuff
2018-02-16 14:56:49 +01:00
Dave Halter
039e7ba07b
Some more sys path corrections.
...
The sys path should be defined more or less in the beginning and not be different for all modules
2018-02-16 14:39:01 +01:00
Dave Halter
6a11b7d89e
Generalize the use of smart import paths
...
Now a lot more parts of the current scripts path are used as a sys path.
2018-02-16 12:40:31 +01:00
Dave Halter
863fbb3702
Better handling of smart sys path
2018-02-16 11:57:58 +01:00
Dave Halter
91d3c1f6d3
Force unicode on django paths
2018-01-30 00:40:50 +01:00
Dave Halter
1304b4f9e8
Reorder some open flags for Python 2
2018-01-26 01:31:47 +01:00
Dave Halter
68f840de60
Refactor django path support
2018-01-24 19:13:05 +01:00
Dave Halter
e4559bef51
Fix project path finding
2018-01-23 20:30:27 +01:00
Dave Halter
e6f934de11
Add a repr for Project
...
Also remove setstate from it, since we intend to serialize it with json.
2018-01-23 19:21:50 +01:00