Commit Graph

1 Commits

Author SHA1 Message Date
Mikhail Golubev
b3daaed02f PY-46178 Protect against illegal fragment expression in f-string-like completion
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
2021-03-16 19:37:02 +00:00