python-syntax icon indicating copy to clipboard operation
python-syntax copied to clipboard

Require format strings to use .format

Open Lilja opened this issue 4 years ago • 2 comments

First stab at #65. Defines a new root level matcher, pythonStringFormat. The name of this matcher I hope should resemble a string with an accompanying .format-function. Naming is a bit tricky since pythonFormat and pythonStrFormat are both taken.

This matcher tries to do a positive lookahead of .format if there are also strings begining with with ' or ".

No python 2 support. Personally I don't feel it's worth to add it, but if I can be persuaded to do so 😄

Before: bild

After: bild

Lilja avatar May 05 '20 20:05 Lilja

cc @nfnty

Lilja avatar May 05 '20 20:05 Lilja

I'd love for this functionality, but as it currently stands it's just not working correctly. If you want to tinker with this look for pythonString and try to implement a similar but custom syn-region but only for strings ending with .format(.

nfnty avatar Dec 02 '20 19:12 nfnty