Title: Update 'SaveError' in 'Parser.cs' to not depend on LINQ expression tree to get the error id · Issue #6444 · PowerShell/PowerShell · GitHub
Open Graph Title: Update 'SaveError' in 'Parser.cs' to not depend on LINQ expression tree to get the error id · Issue #6444 · PowerShell/PowerShell
X Title: Update 'SaveError' in 'Parser.cs' to not depend on LINQ expression tree to get the error id · Issue #6444 · PowerShell/PowerShell
Description: Quote Jason's comment at https://github.com/PowerShell/PowerShell/pull/6434/files/5b5be3122971552d2ce208858ac84868954b841c#r175933192 I'd suggest removing my ugly hack of using LINQ expression trees in SaveError and related helper method...
Open Graph Description: Quote Jason's comment at https://github.com/PowerShell/PowerShell/pull/6434/files/5b5be3122971552d2ce208858ac84868954b841c#r175933192 I'd suggest removing my ugly hack of using LINQ expression tree...
X Description: Quote Jason's comment at https://github.com/PowerShell/PowerShell/pull/6434/files/5b5be3122971552d2ce208858ac84868954b841c#r175933192 I'd suggest removing my ugly hack of using LINQ express...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/6444
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update 'SaveError' in 'Parser.cs' to not depend on LINQ expression tree to get the error id","articleBody":"Quote Jason's comment at https://github.com/PowerShell/PowerShell/pull/6434/files/5b5be3122971552d2ce208858ac84868954b841c#r175933192\r\n\r\nI'd suggest removing my ugly hack of using LINQ expression trees in `SaveError` and related helper methods, and replace with `nameof(ParserStrings.MissingEndCurlyBrace)`.\r\n\r\nWhen that code was written, `nameof` was not in C#, so the ugly and inefficient code was used because:\r\n* It ensured no typos in the `FullyQualifiedErrorId`.\r\n* It was easy to search for all references to an error message via the property.\r\n* Performance was not deemed important because they were errors.\r\n\r\nPerformance might matter more than I originally assumed given editor scenarios - and given the `nameof` language feature, it's reasonable (but annoying and a little verbose) to change error reporting to look more like:\r\n\r\n```C#\r\nReportIncompleteInput(lCurly.Extent, rCurly.Extent,\r\n ParserStrings.MissingEndCurlyBrace, nameof(ParserStrings.MissingEndCurlyBrace));\r\n```\r\n\r\nIn other words, pass the error text **and** the error id.\r\n\r\nAlternatively you could just pass the error id and use reflection of some sort to load the error string, but that would not be good for performance.","author":{"url":"https://github.com/daxian-dbw","@type":"Person","name":"daxian-dbw"},"datePublished":"2018-03-20T23:25:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/6444/PowerShell/issues/6444"}
| 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:6ffe3abd-dd63-8415-f18b-5bde93fb6916 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9EFC:2511D4:4E9DF1:6AF9DB:6A559B9A |
| html-safe-nonce | b40a628336ff67cbfeab831318b73085354689dbcfe527bf64034419c99dbb9e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUZDOjI1MTFENDo0RTlERjE6NkFGOURCOjZBNTU5QjlBIiwidmlzaXRvcl9pZCI6IjcxNTAxODk4MzQ1MDU5MTkzODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c74b33e0b920c060ac985760b7b4752707c1656e26a61e7f4815f8bf850ba0e5 |
| hovercard-subject-tag | issue:307074167 |
| 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/PowerShell/PowerShell/6444/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1849e86940a7833dd825405176688135329d47759c6d5fe9d55fdf1269692632/PowerShell/PowerShell/issues/6444 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1849e86940a7833dd825405176688135329d47759c6d5fe9d55fdf1269692632/PowerShell/PowerShell/issues/6444 |
| og:image:alt | Quote Jason's comment at https://github.com/PowerShell/PowerShell/pull/6434/files/5b5be3122971552d2ce208858ac84868954b841c#r175933192 I'd suggest removing my ugly hack of using LINQ expression tree... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daxian-dbw |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| 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 | aa21baa44893467b0b640d0300538f84ca8c475b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width