Also I removed "Params" title, since Napoleon doesn't support it and
can't render such sections.
Titles that contain multiple words are capitalized on ever word.
Actual set of headers is based on the following user suggestion:
https://youtrack.jetbrains.com/issue/PY-9795#comment=27-1122111.
To avoid completion of headers instead of parameters we require at
least one space indentation inside sections in Google code style
docstrings. Thus parameters references are not inserted falsely and
we still can use the rule "if there is reference under caret don't
suggest section headers".
For Numpy we have nothing to do than to let headers be suggested
under sections (where parameters normally go), since it's not really
obvious how to distinguish incomplete parameter references from
incomplete headers there (thanks to its zero section indentation).
Otherwise if caret is in the middle of reference, standard dummy identifier
will break docstring format and existing references used for completion
will be lost.
For example previously line "param (int) : foo" became
"paraIntellijIdeaRulezzz m (int) : foo" and Google code style docstring
parser wasn't able to reparse it and extract necessary parameter
reference.
To use alternative dummy identifier I moved populating completion
variants from DocString*Reference classes to PyDocstringCompletionContributor.
Also moved test data for PythonCompletionTest#testPy255 in its own directory
because previously it had awkwardly used whole "completion" directory as a
package.
They mostly duplicate each other for scopes of local functions. For
structural types we add only implicit variants obtained from a
name-based class guess.
The test data for seenMembers has been updated in order not to clash
with structural types completion.
* Outside of import statement do not suggest names of not imported
submodules for namespace packages (PY-14385). It has been done so for
normal packages (with __init__.py) already, now the same policy
applies to namespace packages.
* While searching for imported submodules, use only immediate
children of package, not arbitrary descendants (PY-14387).
* Names defined in __init__.py for indirectly imported (intermediate)
packages are included in completion list (PY-14388).
* Removed custom collecting of submodule names from PyModuleType,
use only PyModuleType#collectImportedSubmodules for this purpose.
As result duplicate undecorated entries are no longer included
in completion list for namespace packages (PY-14335).
Consider the case when we are trying to invoke auto completion in
"import foo.bar.<caret>". Previously (mistakenly) type of
qualifier "foo.bar" was PyImportedModuleType(bar), which could not be
successfully resolved unless there is some other top-level "bar" module
under project roots. Now it's correct PyImportModuleType(foo.bar).