Format specifiers in f-strings don't highlight the entire thing in a consistent manner
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Commencez par reproduire les deux exemples de f-string dans Sublime Text 3.2.1 avec MagicPython 1.1.1 et inspectez leurs scopes syntaxiques en les comparant à l’exemple régulier {test:.2f}. C’est terminé lorsque les spécificateurs de format des cas signalés reçoivent un scope cohérent, ou lorsque le comportement est documenté comme intentionnel.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- JavaScript
- Étoiles
- 1.4k
- Forks
- 98
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de MagicStack/MagicPython
-
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
MagicStack/MagicPython#275 · 1 réaction ·
-
Support for type parameters Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
MagicStack/MagicPython#273 · 7 réactions ·
-
Color python properties Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
MagicStack/MagicPython#269 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
MagicStack/MagicPython#267 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
MagicStack/MagicPython#265 · 2 commentaires ·
Toutes les issues de MagicStack/MagicPython
Issues similaires
-
ai-observability bug team/ai-observability
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
AllTheMods/ATM-10-L#19 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
SignalK/n2k-signalk#345 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
JuliaPluto/PlutoPlotly.jl#72 ·