Title: Syntax Highlighting regex+format strings (rf) · Issue #256 · MagicStack/MagicPython · GitHub
Open Graph Title: Syntax Highlighting regex+format strings (rf) · Issue #256 · MagicStack/MagicPython
X Title: Syntax Highlighting regex+format strings (rf) · Issue #256 · MagicStack/MagicPython
Description: Editor name and version: VSCode 1.75.1 Platform: macOS Color scheme: Dark+ (default) MagicPython version: 1.1.0 A sreenshot: 5-10 lines of surrounding code: myString = "baz" MYCONST = "qux" myDict = { "foo": "bar" } correctColoring = rf"...
Open Graph Description: Editor name and version: VSCode 1.75.1 Platform: macOS Color scheme: Dark+ (default) MagicPython version: 1.1.0 A sreenshot: 5-10 lines of surrounding code: myString = "baz" MYCONST = "qux" myDict ...
X Description: Editor name and version: VSCode 1.75.1 Platform: macOS Color scheme: Dark+ (default) MagicPython version: 1.1.0 A sreenshot: 5-10 lines of surrounding code: myString = "baz" MYCONST = &qu...
Opengraph URL: https://github.com/MagicStack/MagicPython/issues/256
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Syntax Highlighting regex+format strings (rf)","articleBody":"* **Editor name and version**: VSCode 1.75.1\r\n* **Platform**: macOS\r\n* **Color scheme**: Dark+ (default)\r\n* **MagicPython version**: 1.1.0\r\n* **A sreenshot**: \r\n\r\n* **5-10 lines of surrounding code**:\r\n```python\r\nmyString = \"baz\"\r\nMYCONST = \"qux\"\r\nmyDict = {\r\n \"foo\": \"bar\"\r\n}\r\n\r\ncorrectColoring = rf\"(?=[\\w]+){myString}{MYCONST}[\\d]+\"\r\n\r\nincorrectDictionary = rf\"(?=[\\w]+){myDict['foo']}[\\d]+\"\r\nregularFString = f\"word{myDict['foo']}number\"\r\n```\r\n\r\nThis is a followup to #186. After upgrading to 1.1.0, I'm very excited that rf strings support both regex style and format string. In the attached screenshot, behold how correctly varied `correctColoring` is. However, any dictionary or class inside of the {} in an rf string is not colored correctly. See how `myDict['foo']` varies between `incorrectDictionary` and `regularFString`. The square brackets should be purple, and 'foo' orange, but instead it is all absorbed into red.","author":{"url":"https://github.com/brownjoel","@type":"Person","name":"brownjoel"},"datePublished":"2023-02-27T12:51:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/256/MagicPython/issues/256"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d6f5c472-bcbe-9446-9cf9-84045aeab570 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E78A:343EA:21214BE:2C73DEF:696ECDEB |
| html-safe-nonce | 523a397afd889386a4eaa7fdbc5e467d7872e446da60e9867448496cd8cfec20 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzhBOjM0M0VBOjIxMjE0QkU6MkM3M0RFRjo2OTZFQ0RFQiIsInZpc2l0b3JfaWQiOiI1OTM2OTMyODMxMTczMjAxMzg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7561a45d98f2983ba1a09f2d0b2284fd701fea1aa92b972ba7a127055de8abdc |
| hovercard-subject-tag | issue:1601126062 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/MagicStack/MagicPython/256/issue_layout |
| twitter:image | https://opengraph.githubassets.com/97bd7755cea38b08af9846d61edc145ef64637975403ed5e3053acf044adcbbb/MagicStack/MagicPython/issues/256 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/97bd7755cea38b08af9846d61edc145ef64637975403ed5e3053acf044adcbbb/MagicStack/MagicPython/issues/256 |
| og:image:alt | Editor name and version: VSCode 1.75.1 Platform: macOS Color scheme: Dark+ (default) MagicPython version: 1.1.0 A sreenshot: 5-10 lines of surrounding code: myString = "baz" MYCONST = "qux" myDict ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brownjoel |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/MagicStack/MagicPython git https://github.com/MagicStack/MagicPython.git |
| octolytics-dimension-user_id | 14324950 |
| octolytics-dimension-user_login | MagicStack |
| octolytics-dimension-repository_id | 43982620 |
| octolytics-dimension-repository_nwo | MagicStack/MagicPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 43982620 |
| octolytics-dimension-repository_network_root_nwo | MagicStack/MagicPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width