1
0
forked from VimPlug/jedi
Commit Graph

68 Commits

Author SHA1 Message Date
Dave Halter 8aaa8e0044 Project._python_path -> Project.environment_path 2020-04-14 23:14:07 +02:00
Dave Halter bdd4deedc1 Some code cleanups 2020-04-11 02:11:52 +02:00
Dave Halter 5a3565785c Add pyproject.toml to the list of files to search for projects 2020-04-11 00:51:28 +02:00
Dave Halter f12262881d Some minor docstring improvements 2020-03-19 00:11:02 +01:00
Dave Halter 516b58b287 Fix a lot of sphinx warnings 2020-03-18 10:16:32 +01:00
Dave Halter e53acb4150 Create an autosummary for Jedi's API 2020-03-18 10:03:07 +01:00
Dave Halter d26926a582 Definition -> Name 2020-03-17 09:33:12 +01:00
Dave Halter bdb36ab626 Document projects better 2020-03-14 15:35:41 +01:00
Dave Halter 1a466d9641 Move the Project.save function within the file 2020-03-14 15:25:40 +01:00
Dave Halter 94f99aaeb3 Docs: Document projects 2020-03-14 15:25:03 +01:00
Dave Halter 88c766afb0 Better docstrings for search 2020-03-14 15:00:47 +01:00
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