MagicStack / MagicStack/MagicPython
Format specifiers in f-strings don't highlight the entire thing in a consistent manner
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 1.4k
- Forks
- 98
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece reproduzindo os dois exemplos de f-string no Sublime Text 3.2.1 com o MagicPython 1.1.1 e inspecione seus escopos de sintaxe, comparando-os com o exemplo regular {test:.2f}. Está concluído quando os especificadores de formato nos casos relatados recebem um escopo consistente ou quando o comportamento é documentado como intencional.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- tooling
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100