1
0
forked from VimPlug/jedi
Commit Graph

183 Commits

Author SHA1 Message Date
David Halter b6e9f16a01 fix a completion problem on docstrings 2013-07-17 16:48:50 +02:00
Laurens Van Houtven bb0a4e0d0a Fix indentation according to PEP8 in api.py 2013-07-11 14:55:36 +02:00
Laurens Van Houtven 3817110717 Remove unneccessary pass statement 2013-07-11 14:55:16 +02:00
Laurens Van Houtven cdc41128b4 (Mostly) whitespace fixes 2013-07-10 14:45:47 +02:00
Takafumi Arakaki a4922774c0 Fix the previous error 2013-05-23 15:32:32 +02:00
David Halter 384334ae06 goto on import statement (only import) raised an error 2013-05-19 20:40:54 +04:30
Takafumi Arakaki 6acf34efd3 Fix: api.defined_names was run against wrong scope
when there is only one class is defined in the module.
2013-05-19 05:08:18 +02:00
Takafumi Arakaki 5f2477d5bf Merge branch 'interpreter-api' into dev
Conflicts:
	jedi/__init__.py
	test/test_regression.py

See: #145
2013-05-18 22:28:56 +02:00
David Halter 15885e8685 preload_module function for IDEs, to control which modules to load on startup, refs #102 2013-05-13 09:13:59 +04:30
Takafumi Arakaki 19b3fef0c5 Remove fast option from api.Script 2013-05-11 21:59:39 +02:00
Takafumi Arakaki a870fece0f Use fast parser in api.Interpreter 2013-05-11 21:47:55 +02:00
Takafumi Arakaki 2846fe980b Remove api._quick_complete 2013-05-11 21:40:00 +02:00
Takafumi Arakaki 08f8dcfae4 Do not repeat defaults in Interpreter.__init__ 2013-05-11 21:37:53 +02:00
Takafumi Arakaki 6af2a0677d Compute default line/column/source_path in api.Script 2013-05-11 21:36:43 +02:00
Takafumi Arakaki 633f582184 Add jedi.interpret.ObjectImporter
and move scope manipulation functions in api.Interpreter to there.
2013-05-11 21:33:57 +02:00
Takafumi Arakaki e8914e7856 Document api.Interpreter 2013-05-04 17:45:34 +02:00
Takafumi Arakaki 8fc396371c Respect settings.fast_parser 2013-05-04 17:44:59 +02:00
Takafumi Arakaki dc47d15de0 Use locals() for tests in TestInterpreterAPI
It is better to check that Interpreter does not fail with the
real name space.  Previously the doctest using locals() failed
because of the bug in _import_raw_namespace.
2013-05-04 17:44:59 +02:00
Takafumi Arakaki a93016db1b Python 2.5 compatibility fix 2013-05-04 17:44:59 +02:00
Takafumi Arakaki af10891096 Document api.Interpreter._genname 2013-05-04 17:44:59 +02:00
Takafumi Arakaki fc79f0e258 Support case like from os.path import join as pjoin 2013-05-04 17:44:59 +02:00
Takafumi Arakaki 6fb42e5f4b Document _import_raw_namespace more 2013-05-04 17:44:59 +02:00
Takafumi Arakaki 12ac71b1fd Document api.Interpreter 2013-05-04 17:44:59 +02:00
Takafumi Arakaki 45cad4c83b Fake imports should locate before fake statements 2013-05-04 17:44:59 +02:00
Takafumi Arakaki 06c03cafa2 Implement the case where raw object is an instance
There is still a bug in this implementation.
The corresponding test fails.
2013-05-04 17:44:58 +02:00
Takafumi Arakaki 11abd92d2b Support alias in _make_fakeimport 2013-05-04 17:44:58 +02:00
Takafumi Arakaki cf48d1272d Use proper interface to add fake Import object 2013-05-04 17:44:58 +02:00
Takafumi Arakaki 17770356e2 Implement the case where raw object is a module
Previously failing test_complete_raw_module is passed.
2013-05-04 17:44:58 +02:00
Takafumi Arakaki 3266aa2d00 Improve api.Interpreter docstring 2013-05-04 17:43:37 +02:00
Takafumi Arakaki 842fbfce8a Add api.Interpreter: Jedi API for Python REPLs 2013-05-04 17:43:37 +02:00
David Halter 4d0417f591 change some definition usages to goto_definitions in tests and docs 2013-05-03 21:35:01 +04:30
David Halter 7c8fee1257 removed a lot of the goto usages, used goto_assignments instead. Did the same also for a lot of definition uses 2013-05-03 21:26:29 +04:30
David Halter edd0a08351 api_classes.RelatedName -> Usage 2013-05-03 21:06:56 +04:30
David Halter efeeee9706 removed related_names occurences in favor of usages 2013-05-03 21:04:36 +04:30
David Halter 49e51f5a1a deprecated api_classes.Completion.word in favor of name 2013-05-03 20:38:37 +04:30
David Halter beae920177 Script.complete has been deprecated, therefore changed all usages / documatation to Script.completions 2013-05-03 20:28:11 +04:30
David Halter c912428f78 deprecation process for a nice api design (as discussed in #124)
deprecate:

- definition
- goto
- complete
- related_names
- function_definition

in favor of:

- goto_definitions
- goto_assignments
- completions
- usages
- call_signatures

Thank you @dbrgn and @tkf for the fruitful discussion!
2013-05-03 20:15:36 +04:30
David Halter 88e60b85e0 best patch in a long time, deleted all the part_parser stuff which was necessary for fast function_definitions, but with the new parser Jedi's fast enough -> fixes #136 2013-05-03 19:33:24 +04:30
Danilo Bargen 86d775324b Fix most flake8 issues (fixes #205) 2013-04-27 15:40:36 +02:00
David Halter 09f39d891a remove __all__ from api, because not needed, fixes #180 2013-03-18 08:25:14 +04:30
David Halter cd513590ab Merge pull request #176 from tkf/basedefinition-type
More detailed BaseDefinition.type (fixes #169)
2013-03-15 10:36:53 -07:00
Takafumi Arakaki df08122639 Fix a failure when run with Python 3 2013-03-15 14:51:59 +01:00
David Halter 7b6a4c9a2b some corrections of imports 2013-03-15 16:01:23 +04:30
David Halter 9ad9c806bb rename non-cycling imports to 'from jedi import ..' 2013-03-15 15:02:33 +04:30
Takafumi Arakaki 7cf70a3f0a Do not clear cache in __del__
Prior to this change, running
`py.test --assert=rewrite test/test_integration.py` fails with errors
due to:

```py
cls = <class 'jedi.recursion.ExecutionRecursionDecorator'>

    @classmethod
    def cleanup(cls):
>       cls.parent_execution_funcs.pop()
E       IndexError: pop from empty list

recursion.py:127: IndexError
```

Similar errors occurred in travis occasionally:
- https://travis-ci.org/davidhalter/jedi/jobs/5449831
- https://travis-ci.org/davidhalter/jedi/jobs/5512538

I think this is because GC calls __del__ at random point during
actual execution of ExecutionRecursionDecorator.__call__.
As --assert=rewrite works by AST dynamically, I guess that it
is harder for Python's GC to clean up code and therefore GC
happens sometime later.  Although this is just a random guess,
as `tox -- --assert=rewrite` works with this patch now, I think
this is a good change.
2013-03-15 00:21:46 +01:00
Takafumi Arakaki dccda224ab Hide api_classes.defined_names 2013-03-13 22:18:50 +01:00
Takafumi Arakaki 0e99c33c67 Don't use NotFoundError in _func_call_and_param_index
This makes it simpler.
2013-03-10 21:27:34 +01:00
Takafumi Arakaki 7ce0e1c178 Rename it to _func_call_and_param_index 2013-03-10 21:27:34 +01:00
Takafumi Arakaki d9b3bb4016 Refactor _get_function_call_and_param_index_at_point 2013-03-10 21:27:34 +01:00
Takafumi Arakaki 9490730d59 Treat case like f() 2013-03-10 21:27:34 +01:00