Commit Graph

1177 Commits

Author SHA1 Message Date
Dave Halter
9f16555f47 Big refactoring: BaseDefinition._definnition changes to BaseDefinition._name, because it's a NamePart now.
This also includes changes to tests and some simplifications like deleting the old name logic of Definition.
2014-09-11 01:03:30 +02:00
Dave Halter
0eea30f227 NamePart migration of Definition is complete. Now Completion. 2014-09-10 18:29:10 +02:00
Dave Halter
2aa538999e Removed an old test from the days where it was allowed to add Keywords to Definitions. 2014-09-10 18:05:04 +02:00
Dave Halter
43cf1d451f Python 2/3 compatibility issues that were not resolved in the latest commit. 2014-09-09 17:51:39 +02:00
Dave Halter
fdc637c5c4 Add a forgotten test module, test_sys_path.py and fix Python2/3 compatibility issues. 2014-09-09 17:08:22 +02:00
Dave Halter
87aa76678a Goto should work on named params, too. 2014-09-09 16:48:53 +02:00
Dave Halter
45e033c50e Quite a few fixes to be eventually able to use NameParts as Definition inputs. 2014-09-09 15:21:27 +02:00
Dave Halter
740fd0657f Add a goto_assignments test for named params 2014-09-09 00:06:24 +02:00
Dave Halter
0dcb91d236 Add a Definition.is_definition function to be able to check if a name is a definition or not. 2014-09-08 23:44:35 +02:00
Dave Halter
851717a968 Publicize jedi.names and add a first test. 2014-09-08 22:39:47 +02:00
Dave Halter
ca536baf9b Last fixes, because of the Name.get_definition change. The recent parser.representation changes are now fully working and we're ready to improve Evaluator.goto again. 2014-09-06 13:23:00 +02:00
Dave Halter
ece9fdf4ae Fixing most of the issues that existed, because of the recent Name.get_definition/Call.name.parent change. 2014-09-06 13:02:52 +02:00
Dave Halter
7b2e11d71b Rewrote sys_path._paths_from_assignment. 2014-09-04 14:12:10 +02:00
Dave Halter
e872d9e073 Script.goto_assignments now always needs a call_path. Otherwise it raises a NotFoundError.
This change makes Jedi's behavior more consistent.
2014-09-04 00:56:58 +02:00
Dave Halter
bb5ffe9343 CompiledObject.name returns a Name now, not a string. This is more consistent with the Jedi design and doesn't lead to bugs while ducktyping. 2014-09-03 19:43:21 +02:00
Dave Halter
bcc84820fe Fix issues with unreachable flows.
This benefits static analysis as well as autocompletion: Unreachable code (things like code within 'if 0:') should still be resolveable.
2014-09-03 00:05:37 +02:00
Dave Halter
ea5b98905e Make statement_elements_in_statement work with ListComprehensions, Lambdas and 'except foo as' expressions 2014-09-02 14:52:04 +02:00
Dave Halter
38c71fce3f Added tests for statement_elements_in_statement 2014-09-02 12:10:16 +02:00
Dave Halter
76d91ba72a Rename fast_parent_copy to deep_ast_copy. 2014-08-22 00:59:46 +02:00
Dave Halter
0ef030848d refactor fast_parent_copy, use new_elements_default to hand in a dictionary, that contains all the generated duplicates. 2014-08-21 13:17:33 +02:00
Dave Halter
3cf8bfa8e1 Fix a few tests by either fixing the test cases or adding py__bool__ functions to objects that should have such a method. 2014-08-20 17:28:54 +02:00
Dave Halter
f911050300 Rewrote the isistance implementation, so that it works properly with tuples as well as normal classes. 2014-08-20 16:58:19 +02:00
Dave Halter
d6dd7cd55e Move process_precedence_element from the Evaluator to the precedence module. 2014-08-20 15:59:37 +02:00
Dave Halter
7f874620db Start documenting all the py__foo__ methods 2014-08-20 11:31:23 +02:00
Dave Halter
09ca47fa93 Introduce a dedicated isinstance function implementation. 2014-08-19 23:57:59 +02:00
Dave Halter
49163e135c flow_analysis test for isinstance as well as and/or operations. 2014-08-19 01:03:14 +02:00
Dave Halter
8bde89cc58 Fix the remaining issues with the StatementElement.next refactoring. 2014-08-19 00:12:14 +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
1965469050 fast_parent_copy should also change the parent of NameParts. 2014-08-14 23:48:27 +02:00
Dave Halter
425290aa8f Fix an issue with partial keyword inputs. 2014-08-14 12:25:00 +02:00
Dave Halter
f743619fb8 Tests for conditions in descriptors. 2014-08-13 14:49:42 +02:00
Dave Halter
cf32e15f65 Remove the old 'is not' logic to detect if not instances and use them to do branch predictions. This is not necessary anymore, since we now support that in a more general way (flow_analysis). 2014-08-12 18:14:03 +02:00
Dave Halter
eeac77d360 Also support the not operator. 2014-08-12 18:09:59 +02:00
Dave Halter
8ed89e8245 implement !=, ==, is, is not operators to work in if statements (they also work in in non if contexts and return a bool value.), includes tests. 2014-08-12 17:59:19 +02:00
Dave Halter
6f018e4884 introduce maybe_docstr in parse_statement, which should have been introduced way earlier. 2014-08-12 17:13:14 +02:00
Dave Halter
fb1dba269a re-enable the interpretation of the None keyword 2014-08-12 14:38:56 +02:00
Dave Halter
469988be9c actually add tests for the flow analysis of variables. 2014-08-12 09:57:00 +02:00
Dave Halter
968bc45314 even tests should not suffer too much from side effects. 2014-08-12 01:46:07 +02:00
Dave Halter
f1711f8f9c possible direction of branch checks for name resolution. 2014-08-10 13:17:37 +02:00
Dave Halter
01bdd1e4fa Test fixes and for loops need to be handled a awell in flow_analysis. 2014-08-07 15:51:41 +02:00
Dave Halter
0ae9e520c1 flow analysis working for elif statements (even in combination with else) 2014-08-07 15:18:30 +02:00
Dave Halter
743d064e6d exception while using else as a scope 2014-08-07 12:10:31 +02:00
Dave Halter
ee65764c3a more complicated logic working with else 2014-08-07 12:02:08 +02:00
Dave Halter
b7151c1ef9 add a first flow analysis test 2014-08-06 23:35:30 +02:00
Dave Halter
e7e7bd29e8 fix generator tests (multiple yields must be called with an if random. 2014-08-06 12:45:38 +02:00
Dave Halter
23c39eff9a fix lambda issues 2014-08-06 12:40:08 +02:00
Dave Halter
54dce0e3b2 fix strange issues of Python's std lib tokenizer, might be in there as well (not sure, cause I modified a lot). fixes #449 2014-08-04 16:47:36 +02:00
Dave Halter
b2b4827ce3 moved test_token to test_tokenize 2014-08-04 16:25:33 +02:00
Dave Halter
cba100a801 test for #414 which doesn't seem to be failing anymore. 2014-08-04 16:08:47 +02:00
Dave Halter
625e88e851 isinstance checks now also give you type hints in class contexts, fixes #241. 2014-08-04 02:11:30 +02:00