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: redirect.github.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:4e70ec47-bb68-f525-f606-6a62866c794b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC8A:29BF78:1E5883:2693B3:696BA99B |
| html-safe-nonce | 017a8a97da7d3d8064b07794bab37d5588b5e29400fe5eed72e7715cda86f93c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzhBOjI5QkY3ODoxRTU4ODM6MjY5M0IzOjY5NkJBOTlCIiwidmlzaXRvcl9pZCI6IjYxMDkyMjU5MzgxNzMyNzQ1MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bb5836e8e0f480a492b7fec4383c2533011905c5cfe2ffd567537c3115dab844 |
| 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 | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width