From 4dcc6437e3550002660836992287b13e39342e31 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 20 Dec 2019 12:37:23 +0100 Subject: [PATCH 1/3] Update submodule pythonx/parso c0ace63...fb010f2 * pythonx/parso c0ace63...fb010f2 (22): > Add a release date to the Changelog > Prepare the next release v0.5.2 > Merge pull request #93 from yangyangxcf/fstring_tokenize > Add information about named expressions (#90) to the Changelog > Use a lower pytest version so python3.4 is able to pass > Use Python 3.8 on travis for testing > Whitespace changes > Fix: Add more cases for named expression errors, see #89, #90 > Add Python 3.8 to tested environments for tox > Fix: Catch some additional cases named expr errors, see #89, #90 > Make sure that function executions are errors as well, see #90 > Some minor refactorings for #90 > Merge https://github.com/JarryShaw/parso into master > Fix trailing comma error > Remove debug print statement > Fix typo (#84) > Fix is_definition test > Add include_setitem for get_defined_names, is_definition and get_definition > Make is_definition work on setitem modifications, see #66 > ENH: update grammar for py39 (#78) > Refactor the ambiguity tests a bit, see #70 > Make pgen2's grammar ambiguity detection handle more cases --- pythonx/parso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonx/parso b/pythonx/parso index c0ace63..fb010f2 160000 --- a/pythonx/parso +++ b/pythonx/parso @@ -1 +1 @@ -Subproject commit c0ace63a6905500e18d8ac06af1a0a9057e63498 +Subproject commit fb010f2b5d67a7b284962e1059e4ebadf87792d0 From fab26f4551c3b54786795345d6b9962febc41192 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 20 Dec 2019 12:37:26 +0100 Subject: [PATCH 2/3] Update submodule pythonx/jedi 005f6939...afbd8cad * pythonx/jedi 005f6939...afbd8cad (208): > Don't test Python 3.4 in tox anymore by default > Add the release date to Changelog > Jedi needs at least parso 0.5.2 now > Fix a rb byte literal test > Goto definition doesn't work on strings anymore, fixes microsoft/vscode#81520 > Make sure that sequence literals have the right generic classes, fixes #1416 > Improved Generic subclass matching > Make sure overload checks work for TypeAlias, see #1416 > Avoid recursion in a specific example, see also #1458 > Fix simple typo: wheter -> whether (#1460) > Completions.complete returns None for fuzzy completions #1409 > Cleanup fuzzy tests a bit, see #1409 > Add fuzzy completions to Changelog > Merge branch 'feature_827_fuzzy_search' of https://github.com/jmfrank63/jedi > Python 2 compatibility > Make sure that the definition order in stubs are ignored > Make sure that a goto on stubs even without the implementation is possible > Fix a goto case with nested pyi files > Catch some cases were _sqlite3.Connection was misidentified as sqlite3.Connection > Rename goto_changes to options > Fix: Stubs in typeshed weren't loaded properly sometimes, fixes #1434 > Files bigger than one MB (about 20kLOC) get cropped to avoid getting stuck completely > Upgrade typeshed, fixes #1084 > Add a typeshed README > Make sure param annotation completions work > Make sure that you can select virtualenvs more precisely, fixes #1407 > Python 2 compatibility > Make sure goto definitions works on with, fixes #1280 > Make sure that __getattr__ is always working with Interpreter > qualified names can be None, so we need to handle it > Cleanup some callbacks > Make sure that Python 2 passes a test on more systems > Make sure warnings are not shown if a property is executed, fixes #1383 > Fix RecursionError: global statements in modules should just be ignored, fixes #1457 > Make it possible to infer Callable TypeVars, fixes #1449 > Account for sys path potentially not being all unicode in typeshed, fixes #1456 > Make sure docstrings can always be inferred for builtins modules, fixes #1432 > Forgot to add some test files > Get the context of a class name right, fixes #1396 > Make sure classmethod signatures don't include cls, fixes #1455 > Add a test to show that type var inference also works for tuples > Don't use globals anymore > Remove a duplicate method > More docstrings > A bit better documentation > Refactor so typing uses BaseTypingValueWithGenerics > Make some more classes private for inference.gradual.base > Use _create_instance_with_generics > The generics manager is now part of DefineGenericBase > Remove get_index_and_execute and use something else > _InstanceWrapper to _GenericInstanceWrapper > Another rename for readability > Merge GenericClass and _AbstractAnnotatedClass > Use the generics manager for all the typing classes > Start using generic managers, for #1413 > Start working on generic managers, see #1413 > Move iter_over_arguments to a separate file > value_of_index -> context_of_index > Try to prepare DefineGenericBase for a more general usage > Make AbstractAnnotatedClass private > Move parts of AbstractAnnotatedClass to the new class DefineGenericBase > Formatting > Rename two classes to make some things clearer > Make some lines shorter > Remove an unused InstanceArguments > Move more stuff from gradual/typing.py to gradual/base.py > Remove TypingName, it looks like it's not used > Start splitting up gradual/typing.py > Make sure Callable TypeVars are better identified, solves a part of #1413 > Remove a TODO that was implemented > Pin colorama to a version that works for Python 3.4 > Find active conda environment and set it as default (if there is one) (#1440) > Remove Python 3.4 test from appveyor > Make sure overload signatures work, see #1417 > Shorten a line to < 100 chars > Fix a tuple test > Make sure that Tuple autocompletes properly, fixes #1389 > Avoid more Python 2 > Fix issues with interpreter completions on unittest.mock. > Start writing the changelog > Improve call signature detection by a lot > Make sure we use the right context in case of goto with decorators, fixes #1427 > Python 2 still sucks. > Make sure an assert no longer causes unnecessary trouble > Make sure that decorator signature completion is working, see #1433 > Avoid wrong random call signature completion, fixes #1433 > Make sure py__iter__ has the right signature > Remove probably dead code > Python 2 > Make sure execute_function_slots and get_function_slots is defined for all instances > Upgrade typeshed to the latest commits > Make sure that the differences are calculated a bit more reliable, fixes #1429 > Unfortunately commited something that should not have been committed > Fix Python 2 issues > A CompiledInstance is not really compiled, it's an instance of a compiled class value > Remove is_package on contexts > Fix some more package issues > Get rid of py__package__ from contexts > Make is_package a function and call it consistently > Make sure code_lines works on stubs, even if they are builtins > Fix the MixedContext and also use MixedModuleContext > Separate CompiledModuleContext from CompiledContext, fixes #1428 > Fix contextualizing of subscriptlist > Fix a globals context issue, fixes #1435 > Remove Python 2 implicit relative imports feature > A small rename of a value that is actually a context > Merge pull request #1451 from pappasam/FIX_SHOW_SYSTEM_FOLDERS > Add __ne__ to BaseValueSet. Might have caused issues in Python 2, see #1442 > Avoid finding submodules for compiled objects, because it's at least not implemented > Make sure that goto on a subscript colon doesn't crash > Fix getitem in compiled > Make sure py__get__ is defined on all values > Fix file name completions when file name is too long > Fix an issue around completions in comments before strings > Fix missing inference for typing.Type[typing.TypeVar] (#1448) > Remove Python 3.9 dev build from travis, it's not needed > Start to use Python 3.8 in the normal CI pipeline > Fix the pow test for Python 3.8 > Fix inference from type comment for function parameter with dot > Fix annotation string generated from wrong object > Fix a small issue created in #1398 > fix static analysis test skips with latest pytest > Fixed rST in changelog > test: test_completion: Dynamically resolve current directory name. > Skip Python 2 tests for some array issues > Skip some param resolving tests in Python 2/3.4 > Add a few tests for a previous assertion failure > Make sure a compiled instance is is_compiled > Reenable a test > Disable a test in Python2 > Remove a few unused imports > Move eval_node to one place > Avoid creating the same object twice > Move inference_state.goto to the name and _follow_error_node_imports_if_possible away from inference_state > Make some dynamic array variables private > ContextualizedName -> TreeNameDefinition > Use create_name instead of duplicated logic > Replace obj with value > Remove get_object, it's not needed anymore > Implement properties properly > Make arguments private for instance > Refactor dynamic params a bit > Revert "Refactor some dynamic function arguments things" > Refactor some dynamic function arguments things > Move some annotation inferring code to proper functions > Remove an unneeded list cast > SimpleParamName -> AnonymousParamName > Make create_instance_context a lot more understandable (and shorter) > Make sure a self variable is only defined in a function not outside > get_first_non_keyword_argument_values is not really used anymore > A simplification > Fix recursion issues about dynamic param lookups and defaults work again > Refactor search_param_names interface > Use get_executed_param_names if get_executed_param_names_and_issues is not necessary > Don't use get_executed_param_names_and_issues as an attribute on arguments > Remvoe AnonymousArguments > Refactor AnonymousInstance/TreeInstance, so that the anonymous instance doesn't have to use arguments > Separate tree/compiled instances better > Get rid of create_init_executions > Implement super() properly > Start using AnonymousMethodExecutionContext instead of the normal function execution context with arguments > Prepare instance for AnonymousMethodExecutionContext > Use the function execution filters with proper inheritance > Deal with inheritance properly when dealing with function executions > Separate FunctionExecution and AnonymousFunctionExecution > Fix static analysis for params > Add get_param_names to the function execution, which is needed to do some filtering > Move the normal anonymous arguments case over to names > Prefer annotations in SimpleParamName > Add some dynamic inference checks for annotations > Avoid using arguments.get_executed_param_names_and_issues > Remove get_executed_param_names_and_issues from FunctionExecution > Use function/arguments intead of execution > Make FunctionExecutionContext.arguments private > _ArrayInstance -> _DynamicArrayAdditions > var_args -> arguments > Fix the final issues about parameter arguments > Fix infering of dynamic params > Remove an unnecessary piece of code from goto > Use Context.create_name instead of weird playing with params everywhere > Use SimpleParamName everywhere it's needed > Refactor params and what execution contexts need > Fix a TODO > Make the order of overloaded functions correct > Get py__simple_getitem__ working on dicts that have a dict as a param, see #1385 > Move some code from SequenceLiteralValue to DictLiteralValue > Fix usages in context of the new parso parameter include_setitem=True > execution_allowed should be called with nodes > Move a repr function > Fix cases where dicts are passed to dicts and generics were not properly applied > Small rename > Change a test so it works with generics > Get py__simple_getitem__ modifications working for list/dict instances > Random objects should not be affected by list/dict modifications > Add a way how dict setitem can be understood > Move the dynamic module to dynamic_params > Move the dynamic arrays code > Add a comment about how _ArrayInstance is used > check_array_additions -> _check_array_additions > Remove methods that are not used > Create separate classes for FakeSequence > Remove _FakeArray, because it's no longer needed > Enable a sys path test that is working now > Reenable some tests > Add a method implementation, that doesn't seem to be used, but it might one day be. > Merge branch 'refactoring' > Merge branch 'master' of github.com:davidhalter/jedi > Bump version --- pythonx/jedi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonx/jedi b/pythonx/jedi index 005f693..afbd8ca 160000 --- a/pythonx/jedi +++ b/pythonx/jedi @@ -1 +1 @@ -Subproject commit 005f69390c4b1a3b864e7373cfcbdaf95e65411d +Subproject commit afbd8cad8938331ff89dac34126b4960809dc75b From d57edde2e87899b50cfc8aeca56579dbf224af6c Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 20 Dec 2019 17:20:02 +0100 Subject: [PATCH 3/3] Update tests --- test/vspec/signatures.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/vspec/signatures.vim b/test/vspec/signatures.vim index 22bfb73..933df1c 100644 --- a/test/vspec/signatures.vim +++ b/test/vspec/signatures.vim @@ -41,7 +41,7 @@ describe 'signatures' doautocmd CursorHoldI noautocmd normal istaticmethod() doautocmd CursorHoldI - Expect getline(1) == '?!?jedi=0, ?!? (*_*f: Callable*_*) ?!?jedi?!?' + Expect getline(1) == '?!?jedi=0, ?!? (*_*f: Callable[..., Any]*_*) ?!?jedi?!?' end it 'highlights correct argument' @@ -54,14 +54,14 @@ describe 'signatures' " Move to "=" - hightlights "sep=...". noautocmd normal 5h doautocmd CursorHoldI - Expect getline(1) =~# '\V\^?!?jedi=0, ?!? (*values: object, *_*sep: Text=...*_*' + Expect getline(1) =~# '\V\^?!?jedi=0, ?!? (*values: object, *_*sep: Optional[Text]=...*_*' " Move left to "=" - hightlights first argument ("values"). " NOTE: it is arguable that maybe "sep=..." should be highlighted " still, but this tests for the cache to be "busted", and that " fresh results are retrieved from Jedi. noautocmd normal h doautocmd CursorHoldI - Expect getline(1) =~# '\V\^?!?jedi=0, ?!? (*_**values: object*_*, sep: Text=...,' + Expect getline(1) =~# '\V\^?!?jedi=0, ?!? (*_**values: object*_*, sep: Optional[Text]=...,' end it 'no signature' @@ -88,7 +88,7 @@ describe 'signatures' redir => msg Python jedi_vim.show_call_signatures() redir END - Expect msg == "\nstaticmethod(f: Callable)" + Expect msg == "\nstaticmethod(f: Callable[..., Any])" redir => msg doautocmd InsertLeave