1
0
forked from VimPlug/jedi
Commit Graph

252 Commits

Author SHA1 Message Date
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 30cfdee325 Some simplifications 2018-02-16 10:21:43 +01:00
Dave Halter 9177c120f4 Merge the implicit namespace improvement (pkgutils.itermodules modification)
There are still a few issues that need to be addressed.
2018-02-15 20:08:58 +01:00
Dave Halter 76df356628 Relative imports should be working again even when used in more special occasions. Fixes #973
There are more fixes needed. Some things are just very unclean and might lead to further bugs.
2018-02-15 14:10:01 +01:00
Dave Halter 276f2d0b52 parent_module is not needed for loading modules 2018-02-14 20:42:53 +01:00
Dave Halter 2a56323c16 Try to avoid CachedMetaClass for modules 2018-02-13 20:47:43 +01:00
Dave Halter 36699b77b2 DOn't check the parser cache, that's parso's responsibility 2018-02-13 19:19:00 +01:00
Dave Halter a52b6edd01 Better module loading 2018-02-12 21:17:21 +01:00
Dave Halter a33cbc8ae3 Try to put all module loading in one place including namespace packages 2018-02-12 20:49:45 +01:00
Dave Halter 9fec494e84 Unify load_module access 2018-02-12 20:39:42 +01:00
Dave Halter 514eaf89c3 Prepare a test to eventually solve a relative import problem 2018-02-12 20:33:48 +01:00
Dave Halter 26774c79fb Add a module cache that has a bit more capabilites 2018-02-10 21:21:25 +01:00
Anton Zub c2bb795151 Fix typo in docstring for imports.py 2018-02-03 11:55:53 +01:00
Dave Halter 68f15c90ac Undo most of the namespace changes and use module again
Is a module like every other module, because if you import an empty
folder foobar it will be available as an object:
<module 'foobar' (namespace)>.

See #1033.
2018-01-25 20:51:55 +01:00
Dave Halter 04fba28d35 Differentiate between namespace and module as a type
Also fixed a bug related to implicit namespace contexts, fixes #1033.
2018-01-25 20:35:54 +01:00
Dave Halter d986c44b94 Merge with master
The deprecation of Python2.6 and the insertion of environments made it quite difficult to merge.
2018-01-20 19:32:59 +01:00
Dave Halter 877383b110 Add a test to avoid encoding issues. Fixes #1003 2018-01-20 18:28:29 +01:00
Dave Halter 16b463a646 Refactor to avoid having unicode decode errors by default 2018-01-19 19:23:11 +01:00
Dave Halter 9b5e3447d9 Make the new project API fully work in tests 2018-01-17 09:54:11 +01:00
Dave Halter fe813292cf Try to migrate to the new project API 2018-01-16 23:56:35 +01:00
Dave Halter f36f5ec234 Merge with master 2018-01-06 12:31:29 +01:00
Maxim Novikov 78cbad0d08 Fix implicit namespace autocompletion. Resolves: #959 2018-01-02 18:17:48 +01:00
Dave Halter b716fb7dc6 Use the parser to check for certain namedtuple features
This fixes tests that are used with python 2 but a different environment
2017-12-30 04:41:19 +01:00
Dave Halter 7de04fb28d Move the module name searching to the subprocess 2017-12-29 21:10:00 +01:00
Dave Halter 35158f693d Remove some of the last py27 errors that were caused in combination with 3.6 2017-12-29 02:45:11 +01:00
Dave Halter 59c44fe499 Use force_unicode for all sys paths 2017-12-29 01:28:23 +01:00
Dave Halter 87666d72a1 Move the import logic to the subprocess 2017-12-23 17:59:56 +01:00
Dave Halter 473be114f3 Move even more import stuff to a separate function 2017-12-23 17:10:57 +01:00
Dave Halter e2f8d53ee4 Move some import parts around to refactor it 2017-12-23 16:16:17 +01:00
Dave Halter 4ab7f7a0b0 Make ImplicitNamespaceContext a bit cleaner 2017-12-21 23:43:47 +01:00
Dave Halter 890dd2213d Use better error messages for import errors 2017-12-19 23:51:05 +01:00
Daniel Hahler adace8d7cb sys_path_with_modifications: append local file
This fixes "goto" preferring a local module instead of a global one.

Fixes https://github.com/davidhalter/jedi/issues/995.
2017-12-19 20:51:20 +01:00
Dave Halter 6780eba157 Fix sys_path propagation for builtins load_module 2017-12-18 20:16:58 +01:00
Dave Halter aa40ef3140 A small refactoring 2017-12-18 20:03:23 +01:00
Dave Halter 7db6d11c49 Create a way of accessing access objects through a subprocess 2017-12-06 14:18:10 +01:00
Dave Halter 542644ad19 Move load_module a bit around 2017-12-04 19:18:30 +01:00
Dave Halter 96a0003cb5 Progress in executing builtin stuff in submodules. 2017-11-20 21:02:40 +01:00
Dave Halter 8658ac5c28 Using additional_dynamic_modules sometimes led to weird behavior of using modules twice. 2017-10-09 20:28:39 +02:00
Dave Halter 8dba08eeb2 Small sys path refactoring. 2017-10-06 09:01:15 +02:00
Dave Halter 383f749026 Move the initial sys path generation into a new project class. 2017-10-02 20:19:55 +02:00
Dave Halter 3c75f27376 Move the base Context stuff to another module to keep context free for imports. 2017-09-30 16:46:07 +02:00
Dave Halter 5f613ece28 Move the namespace to a separate module. 2017-09-29 15:31:26 +02:00
Dave Halter 8f177eea07 Move the ModuleContext to a separate module. 2017-09-29 13:24:48 +02:00
Dave Halter b74c8cb033 To be able to customize ContextSet, move a subclass to evaluate.context 2017-09-27 09:20:58 +02:00
Dave Halter ee52cc7501 Fix most dynamic array issues. 2017-09-26 17:26:33 +02:00
Dave Halter 174eff5875 Replace a lot more of empty sets and unite calls. 2017-09-25 23:08:59 +02:00
Dave Halter 5328d1e700 Add a ContextSet.
This is not bug free yet, but it's going to be a good abstraction for a lot of small things.
2017-09-25 11:04:09 +02:00
Dave Halter a433ee7a7e Move common to evaluate.utils. 2017-09-20 20:33:01 +02:00
Dave Halter 0c01a3b823 The sys.modules implementation did not work properly with newly created files.
Fixes #886.
2017-09-20 10:06:02 +02:00