Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format specifiers in f-strings don't highlight the entire thing in a consistent manner #181

Open
Rapptz opened this issue Apr 28, 2019 · 0 comments

Comments

@Rapptz
Copy link

@Rapptz Rapptz commented Apr 28, 2019

Hello. Sometimes the :... aspect of a format string is highlighted in its entirety but often times it's not. I would like to know if it's possible to make it so it's all under the same consistent scope or if it's by design that it doesn't. My main use case has to do with types using a custom __format__.

For example:


I would have imagined both of these to fall under the same scope but they're not.

The first screenshot goes source.python > meta.fstring.python > storage.type.format.python
The second screenshot goes source.python > meta.function-call.python > meta.function-call.arguments.python > meta.fstring.python

A regular line of code without using custom __format__ (e.g. {test:.2f}) goes as source.python > meta.function-call.python > meta.function-call.arguments.python > meta.fstring.python > storage.type.format.python which is what I would expect the other two to return as well, unless it's meant to be treated differently.

  • Editor name and version: Sublime Text 3.2.1 Build 3207
  • Platform: Windows 8.1
  • Color scheme: Custom
  • MagicPython version: 1.1.1
  • A sreenshot: See above
  • 5-10 lines of surrounding code: In the screenshot hopefully
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.