1
0
forked from VimPlug/jedi
Commit Graph

121 Commits

Author SHA1 Message Date
Dave Halter
83d2af5138 First imports are working with goto. 2014-09-19 01:21:17 +02:00
Dave Halter
1fb9b4bc6b Completion now always takes a NamePart as input. 2014-09-10 18:59:08 +02:00
Dave Halter
110f130741 Make it possible to get previous statements of Calls. 2014-09-09 16:44:56 +02:00
Dave Halter
ff7680c15f Generate the expression_list of a statement in any case.
This is a consequence of being able to have Calls as parents of Names. Otherwise we would have changing Name.parent values.
2014-09-09 12:54:46 +02:00
Dave Halter
2e7e2f0a29 Name parents are now Calls (once their statements have generated the Calls).
This makes the goto function more powerful. Also fixes an issue with the deep_ast_copy, that I tried to fix previously, but failed, because I hadn't tested it.
2014-09-06 12:19:07 +02:00
Dave Halter
cb84bc0829 Start using ExprStmt. 2014-09-06 10:46:59 +02:00
Dave Halter
f57d9ef675 Rename Name.get_parent_stmt to Name.get_definition, because it's not always a statement. Also start using it in the NameFinder. 2014-09-06 10:43:26 +02:00
Dave Halter
99116cdcb7 Add a Name.get_parent_stmt() function. 2014-09-05 22:26:55 +02:00
Dave Halter
6c07c7acfe Create an ExprStatement class to replace the Statement class in the future and separate array parts of actual statements 2014-09-05 22:21:26 +02:00
Dave Halter
7b2e11d71b Rewrote sys_path._paths_from_assignment. 2014-09-04 14:12:10 +02:00
Dave Halter
18204c4c19 By trying to get rid of search_name in usages, we had to fix an issue with imports:
If used like 'follow(is_goto)', it could return a ModuleWrapper instead of a Name, which is what we actually want.
2014-09-03 19:30:00 +02:00
Dave Halter
77673ba986 Add an optional param 'parent' to parser.representation.Simple, which simplifies some calls to that superclass. 2014-08-19 00:30:17 +02:00
Dave Halter
8006d6f190 Change implementation of StatementElement.
Instead of having both next and execution as attributes, we now only have next, because it's an execution if there's an array.
2014-08-18 22:25:55 +02:00
Dave Halter
00d15da143 refactor search_call_signatures. Now we don't need to set Call.next.parent in a strange way anymore and the whole thing seems to be more logical. 2014-08-18 14:51:38 +02:00
Dave Halter
9f38f10366 fix tests. Operators should not equal to other operators with a different position. or even parent. 2014-08-18 13:13:07 +02:00
Dave Halter
1d812c2414 Use the "wrong" parents again for next/execution in StatementElement. This is important for call_signature lookups. We might still be able to change this somewhere in time. 2014-08-18 11:22:38 +02:00
Dave Halter
89ab0ba137 Fix fast_parent_copy. The caching is now more solid than before (and doesn't produce weird side effects. This also solves an issue with Lambdas. However, by fixing all of this we have broken some other things. 2014-08-15 01:55:43 +02:00
Dave Halter
1f9e7ddff8 Remove code in the parser that didn't make sense. 2014-08-14 13:24:26 +02:00
Dave Halter
6b7ce590fa Simplify get_parent_scope 2014-08-12 01:37:58 +02:00
Dave Halter
33e5a3280a Remove IsScope in favor of an is_scope function.
This function was partially implemented anway. Now we've also added a function called 'get_parent_scope', to make it easy to get a scope of a Call, Statement, whatever.
2014-08-12 01:19:19 +02:00
Dave Halter
138fa1b4de deletion of returns from SCOPE_CONTENTS was wrong. 2014-08-06 22:42:38 +02:00
Dave Halter
23c39eff9a fix lambda issues 2014-08-06 12:40:08 +02:00
Dave Halter
c44168f7ad add a Flow.previous attribute to be able to access the if flow from an else clause. 2014-08-05 11:17:18 +02:00
Dave Halter
7bd76022bf get rid of the whole is_callable stuff, because now we can just check for hasattr(obj, 'py__call__') 2014-07-30 15:50:47 +02:00
Dave Halter
440b9b072e Merge pull request #441 from davidhalter/dynamic_inheritance
Dynamic superclasses
2014-07-27 18:26:48 +04:30
Danilo Bargen
e8f479172a Implemented dynamic superclasses 2014-07-27 14:11:48 +02:00
Danilo Bargen
c97e1732ee Operator statement wrapper was missing (fixes #436) 2014-07-27 12:53:18 +02:00
Dave Halter
606b6851ff remove the scope_names_generator stuff again. We should enable it somewhere in time, but for now it just breaks tests. 2014-07-27 09:43:22 +02:00
Dave Halter
c85bdb8ff1 little edge case of modules that don't have a scope_names_generator, which is unfortunately missing, but not really used in Jedi.
At europython's hackathon we played with it and @scoder added a small script to cython/Cython/Compiler/JediTyper.py, which makes it possible to add Cython types to a Python script.
2014-07-26 13:18:04 +02:00
Dave Halter
852cdad754 Operator fixes. Subclass of Simple, now. 2014-07-22 16:02:34 +02:00
Dave Halter
2616143d10 unicode issues with docstrings should be gone, fixes #420 2014-07-18 17:43:25 +02:00
Dave Halter
81f3b940e8 dicts should not be used to check against in get_defined_names, because they cannot contain a defined name (lists and tuples can) so just ignore them., fixes #417 2014-07-18 15:37:10 +02:00
Dave Halter
21341283ca another parser issue, very much related to the last one. sometimes a None element was used as a token.fixes #418 2014-07-18 15:10:10 +02:00
Dave Halter
0dea47b260 def/class keywords after an opening parentheses led to empty arrays without closing brackets, tests & fixes #416 2014-07-18 12:53:06 +02:00
Dave Halter
1fd7acef7a finally able to remove _get_defined_names_for_position 2014-07-03 11:53:51 +02:00
Dave Halter
c1ed3bf38a cleanup NameFinder.scopes, fully use scope_names_generator. 2014-07-03 11:48:26 +02:00
Dave Halter
13ada3154b replace get_defined_names with scope_names_generator in a lot of places (the cleanup still needs to be done, though). 2014-07-02 16:12:49 +02:00
Dave Halter
d752907290 temporary solution for completions in asserts 2014-06-22 11:27:28 +02:00
Dave Halter
ddca14980e introduce an is_scope function to make it easier to work with scopes 2014-06-20 17:47:42 +02:00
Dave Halter
2fc404f99d fix issue with list comprehensions in function calls 2014-06-20 16:28:31 +02:00
Dave Halter
d5758adb2b fix list comprehensions. they were not implemented in a good way 2014-06-12 11:10:10 +02:00
Dave Halter
f8b79b3dd0 work in progress refactoring to make ListComprehension a sublass of ForFlow 2014-06-12 10:13:49 +02:00
Dave Halter
0b926ca454 get rid of is_list_comp boolean in favor of a direct check of ListComprehensionFlow 2014-06-09 20:19:31 +02:00
Dave Halter
4e596060b9 test for is_nested failure 2014-05-16 13:00:13 +02:00
Dave Halter
d59e21f43c new way of gathering statements to evaluate for static analysis 2014-05-16 12:23:09 +02:00
Dave Halter
96386b4578 if something catches an exception, ignore that report 2014-05-12 18:10:17 +02:00
Dave Halter
70d85d1b3a strip_imports -> follow_imports 2014-05-12 11:18:47 +02:00
Dave Halter
13949ec145 move is_nested check from evaluate.imports to the parser 2014-05-12 11:02:57 +02:00
Dave Halter
e0d0572d7f fix for an issue with commas in statements 2014-05-04 02:20:46 +02:00
Dave Halter
c44b88adc3 Error token handling with dots in front. 2014-05-03 12:39:20 +02:00