PSI element copies exists in special non-physical files (DummyHolders),
and usually references in them cannot be resolved. It led both to exceptions,
when the rest of the code insight didn't expect resolve to happen in files other
than PyFile (PY-46099), and situations when we failed to resolve a usage in
a copy and restore the corresponding import (PY-47633).
Switching to processing original declarations also revealed a problem with
inserting imports -- we might have tried to insert impossible imports for
non-top-level symbols, such as class attributes and methods. Now, these are
ignored.
GitOrigin-RevId: 6816078596a2c0aced7045a80828b7e83ebee8c0
It's not enough to just prepend an arbitrary string with "f" to treat it like
a well-formed f-string. If its part following "IntellijIdeaRulezzz " placeholder
contains special characters, such as "&" in URLs, it can break parsing of
a generated fragment to the extent we are no longer able to recover a string
literal from it (it all gets treated as a single embedded expression).
Forcibly closing a started fragment with "} " seems sufficient to guard against
the subsequent string content.
GitOrigin-RevId: fe682511475b800f013ace5e6e52fca9286cd418
Previously, we accidentally offered immediate attributes of a module only right
after a dot in a non-imported qualified name (i.e., with an empty attribute name).
If a qualified name of a fuzzy variant matched that of a direct attribute, it went
unnoticed. However, if a name was non-trivially exported, as in case of
"_pytest.mark.structures.MARK_GEN" exported as "pytest.mark", its expected name,
as an attribute of pytest module, disappeared immediately as one started typing
anything past the dot in "pytest.".
GitOrigin-RevId: 5fbd7bd77fd1629f4d852b757d350cc182b991d7
Aliases were completed only when the prefix was a fully-typed alias, and it became useless without inserting a dot and calling PyUnresolvedModuleAttributeCompletionContributor afterwards
IJ-MR-6806
GitOrigin-RevId: fc5b5e91911bbc85bda4da0753ad8e6da69951cb
- codeInspection.ui is moved to platform.lang
- PythonUiService has util functions for InspectionOptionsPanel
- js-analysis-impl has an added dependency on platform.lang
GitOrigin-RevId: ecd757277f9509b9d48507c0c39a109cb0f2ce4b
Namely, names such as "numpy.random._examples.numba.extending.numbacall" or
"numpy.testing._private.noseclasses.NumpyDoctest" should no longer be suggested,
unless they are also exported in a public package higher in the hierarchy.
It doesn't not affect definitions from internal modules that belong to project
sources, these are still offered in the lookup.
GitOrigin-RevId: 2be393f30bd7d9905a31bdbe8db101807c136617
PyExportedModuleAttributeIndex.traceKeyHashToVirtualFileMapping is a little
known API of StubIndexExtensions that allows to use IdFilters for extracting
only keys from virtual files that it permits. In this case, it means those
accessible from the current project.
GitOrigin-RevId: bd0e2b65ee0f9fc256e714053c332ce5a120d6d8
It includes several impovements over the existing implementation:
* Full qualifier it considered instead of just its last component, e.g. "foo.bar"
for "foo.bar.Baz<caret>", not just "bar".
* These results are not suggested for references that are themselves qualifiers for
other attributes, e.g. in "foo.ba<caret>r.Baz()".
* Completion is automatically restarted as soon as attribute prefix appears, i.e.
as soon as any extra character is typed in "foo.<caret>".
* Completion uses an apropriate scope, excluding stdlib's tests
* New variants are added incrementally and respecting PCE, not in a batch, to improve
responsiveness
GitOrigin-RevId: d6a84bf3a2096e60fca87794da6ed5836c5b9244
The new stub-based index maps names of all "public" top-level definitions
to the corresponding PSI elements. Fully qualified names are matched by
both definition's short name and an already typed reference qualifier, i.e.
"foo.bar.MyClass" matches "foo.My" and "bar.My" but not "foo.bar". Qualified
names are initially restored directly from VFS without any normalization or
canonization to improve performance, but then properly canonized before
displaying them among completion suggestions.
GitOrigin-RevId: 768ef6d51e535e8102fca0693c7a51db400fc783