Also moved test data for PythonCompletionTest#testPy255 in its own directory
because previously it had awkwardly used whole "completion" directory as a
package.
Previously all optional parameters of super class constructor was
ignored in generated constructor call, but from now on we pass them
there if they exist in constructors of both superclass and subclass.
* Slightly cleaned up in related classes
* PyQuickFixTest#doInspectionTest and Py3QuickFixTest#doInspectionTest
correctly handle argument available=false.
Formatter can insert additional indentation inside multiline string
literal to align it with surrounding statement list. It happens before
live template to edit type annotations is inserted in document, thus
offsets saved previously in PyDoctstringGenerator become invalid. From
now on PyDocstringGenerator stores line and column after first
non-whitespace character for these annotations instead and converts them
to normal offsets considering any additional indentation inserted.
Now we try to filter resolve results for members of an imported module
by only explicitly imported results as we used to do for directories
only. The difference is we do it now for both directories and
__init__.py files and only if we're resolving a member in the same file
where the import for the module is located.
We used to resolve members __init__.py of imported packages using only
the __init__.py itself, i.e. without considering their submodules. Now
we do that and we also don't filter unimported submodules because we
cannot detect them reliably. They might be imported in other modules
via some import chain.
Current solution is very crude, because we can't use standard IDE
facilities to find usages of the import element in the a file, once
that file was moved. And exactly that API MoveFileHandler offers to us.
Check that reference to moved module is contained in PyImportElement
part of a "from import" statement before calling
PyClassRefactoringUtil#updateImportOfElement. Because this method
relies solely on name equality, it can accidentally replace "from
import" of particular symbol from module with the "from import" of that
module itself.
* Added missing final modifiers
* Reformat file
* Element generator is aware of language level
* Moved intention name to the bundle and properly capitalized it
* PythonDemorganLawIntentionTest extends convenient PyIntentionTestCase
and follows its conventions for test data location and naming
We may get stuck in a recursive resolve loop (that results in unresolved
references) if we match arguments to parameters for a call where the
callee is a reference to the named parameter itself.
The loop used to go like this:
1. Get the type of 'foo.bar' in 'foo.bar(foo)'
2. Get the type of 'foo' in 'def f(foo)'
3. Find the structural type for 'foo'
4. Ask nested calls where 'foo' is a parameter
5. Try to match args to params in 'foo.bar(foo)'
6. Resolve 'foo.bar'
7. Get the type of 'foo.bar' in 'foo.bar(foo')
8. Since the 'foo.bar' is evaluating, it's 'null' for preventing
recursion
9. So 'foo.bar' resolves to 'null' which is false