Format specifiers in f-strings don't highlight the entire thing in a consistent manner
還沒有人認領這個 Issue。
評估
研究方向
首先在使用 MagicPython 1.1.1 的 Sublime Text 3.2.1 中重現兩個 f-string 範例,並檢查它們的語法 scope,將其與一般的 {test:.2f} 範例進行比較。當回報案例中的格式指定符獲得一致的 scope,或該行為被記錄為有意設計時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- JavaScript
- 星號
- 1.4k
- 分支
- 98
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MagicStack/MagicPython 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 58/100
MagicStack/MagicPython#275 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 48/100
MagicStack/MagicPython#273 · 7 個 reaction ·
-
難度 4/5 3-5 天 新手友好度 25/100
MagicStack/MagicPython#269 ·
-
難度 3/5 1-2 天 新手友好度 42/100
MagicStack/MagicPython#267 ·
-
難度 3/5 1-2 天 新手友好度 42/100
MagicStack/MagicPython#265 · 2 則留言 ·
查看 MagicStack/MagicPython 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
-
難度 2/5 1-3 小時 新手友好度 86/100
sugarlabs/musicblocks#8847 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
-
Request: SumUp 未關閉new icon permissions in review
難度 2/5 1-3 小時 新手友好度 72/100
simple-icons/simple-icons#15027 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
TheOdinProject/curriculum#31408 ·