- Drop support for python 3.5 & 3.6 in compatibility inspection
- Fix and remove some outdated tests
- Remove xmls for long-unsupported python 2.6 & 3.5
- Regenerate versions.xml
- Remove mentions of OS-specific modules
GitOrigin-RevId: 3265dd1de8a4f7a41119e10c95bb705ca5845efe
In case of syntactic ambiguity with previous versions of the grammar, such as
"with (expr)" or "with (expr1, expr2)", PyWithStatement is still parsed as
having its own parentheses, not a parenthesized expression or a tuple as
a single context expression. The latter case, even though syntactically legal,
is still reported by the compatibility inspection in Python <3.9.
These changes also include proper formatter and editing support (e.g. not
inserting backslashes on line breaks inside parentheses), as well as
Complete Current Statement, which now takes possible parentheses into account
while inserting a missing colon.
The changes in the formatter are somewhat ad-hoc, intended to minimize the effect
on other constructs. "With" statement is somewhat special in the sense that it's
the first compound statement (having a statement list) with its own list-like
part in parentheses.
Existing tests on with statement processing were expanded and uniformly named.
Co-authored-by: Semyon Proshev <semyon.proshev@jetbrains.com>
GitOrigin-RevId: 15c33e97f177e81b5ed23891063555df016feb05
Modules list has been updated using python on Windows, seems it should be done on all OSes and merged.
GitOrigin-RevId: 621172608fffddc3e830f1133fba89a05d092eba
All its warnings are extracted into the bundle, but they are still poorly
adapted for translation. Each of them in constructed from two separate
messages, a common prefix and an individual feature description, with negation
of the main verb being split. Only the first message can vary depending on
the affected versions number, but both parts of the verb need to agree in many
languages other than English. It's not clear how to address it without
overhauling inspection internals, thus it will be revised later.
I also slightly updated the warnings format. Namely, put "version" in plural,
if a warning applies to multiple Python versions, and removed trailing periods
from single-sentence messages.
GitOrigin-RevId: 51e577201b11fb4e8b6967e1f5ad27143ba9f82e
Additionally, I did the following:
* re-generated lists of supported/unsupported interpreter modules
* updated test data wherever Python versions appear in warnings
GitOrigin-RevId: 66fd298e6051bf91fb894e037a877d0b382da337
Previously it was done unconditionally for all Python versions in StarAnnotator.
I moved the corresponding checks from there to CompatibilityVisitor so that
it was clear in which particular versions it's mandatory.
GitOrigin-RevId: 205de8768431445baed98aecd5f9820efe28d281
Highlight expressions that are invalid by grammar or unacceptable in runtime
Highlight expressions in pythons < 3.8
GitOrigin-RevId: 89acec9db5b3a931da31c33778185e147240ec01
Additionally, I did the following:
* re-generated lists of supported/unsupported interpreter modules
* updated test data wherever Python versions appear in warnings
Still need to figure out, though, why _bz2/bz2 modules were not found
for some old versions of Python, hence information about their presense
should be updated by hand in versions.xml.
Inspection does not register `CompatibilityVisitor` problems for its opened file language because in such a case
`UnsupportedFeatures` will annotate them.
Also `registerOnFirstMatchingVersion` methods were removed because
they could lead to duplication even if languages to register were different.
Additionally, I did the following:
* re-generated lists of supported/unsupported interpreter modules
* updated test data wherever Python versions appear in warnings
Still need to figure out, though, why _bz2/bz2 modules were not found
for some old versions of Python, hence information about their presense
should be updated by hand in versions.xml.
Also, UnsupportedFeatures annotator properly detects the language
level for the analyzed element. Previously, it used Python version of
the containing file for some injected fragments.
So that something like "async def f() -> AsyncIterable[int]" doesn't
return "Coroutine[AsyncIterable[int]]".
Also more reliably detect async generators to warn about non-empty
returns inside them.