Title: Add internal source generator for experimental features · Issue #18302 · PowerShell/PowerShell · GitHub
Open Graph Title: Add internal source generator for experimental features · Issue #18302 · PowerShell/PowerShell
X Title: Add internal source generator for experimental features · Issue #18302 · PowerShell/PowerShell
Description: Summary of the new feature / enhancement There's a lot of boiler plate in experimental features, it'd be nice to have a source generator which takes this code: NOTE: Of course this would only benefit folks working on this repo specifical...
Open Graph Description: Summary of the new feature / enhancement There's a lot of boiler plate in experimental features, it'd be nice to have a source generator which takes this code: NOTE: Of course this would only benef...
X Description: Summary of the new feature / enhancement There's a lot of boiler plate in experimental features, it'd be nice to have a source generator which takes this code: NOTE: Of course this would on...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/18302
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add internal source generator for experimental features","articleBody":"### Summary of the new feature / enhancement\n\nThere's a lot of boiler plate in experimental features, it'd be nice to have a source generator which takes this code:\r\n\r\n**NOTE**: Of course this would only benefit folks working on this repo specifically, but it would greatly simplify adding experimental features in the engine and leave less room for typos/missed files.\r\n\r\n```csharp\r\npublic partial class ExperimentalFeature\r\n{\r\n // Probably default to this\r\n [Experiment(Targets = ExperimentTarget.Windows | ExperimentTarget.Linux)]\r\n private static readonly ExperimentalFeature PSDoSomething = new ExperimentalFeature(\r\n nameof(PSDoSomething),\r\n \"The description for the feature\");\r\n\r\n [Experiment(Targets = ExperimentTarget.Linux)]\r\n private static readonly ExperimentalFeature PSDoSomething2 = new ExperimentalFeature(\r\n nameof(PSDoSomething2),\r\n \"The description for the feature\");\r\n}\r\n```\r\n\r\nand have it generate:\r\n\r\n```csharp\r\npublic partial class ExperimentalFeature\r\n{\r\n internal static bool IsPSDoSomethingEnabled =\u003e EnabledExperimentalFeatureNames.Contains(nameof(PSDoSomething));\r\n\r\n \r\n internal static bool IsPSDoSomething2Enabled =\u003e EnabledExperimentalFeatureNames.Contains(nameof(PSDoSomething2));\r\n\r\n\t// Replacing the manual bit currently in the static ctor\r\n private static ExperimentalFeature[] CreateFeatureList()\r\n \t=\u003e new[]\r\n {\r\n PSDoSomething,\r\n PSDoSomething2,\r\n };\r\n}\r\n```\r\n\r\nand\r\n\r\n```json\r\n// experimental-feature-linux.json\r\n[\r\n \"PSDoSomething\",\r\n \"PSDoSomething2\"\r\n]\r\n```\r\n\r\n```json\r\n// experimental-feature-windows.json\r\n[\r\n \"PSDoSomething\",\r\n]\r\n```\n\n### Proposed technical implementation details (optional)\n\n_No response_","author":{"url":"https://github.com/SeeminglyScience","@type":"Person","name":"SeeminglyScience"},"datePublished":"2022-10-14T19:03:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/18302/PowerShell/issues/18302"}
| 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:dda968f3-362d-d60d-ead0-7643ce283cb2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8AD4:9BF44:1A282B:24FAC3:6A547AC2 |
| html-safe-nonce | 3ee8efe4c11e19f4c012ac6a5220810306e3c8a340cfb0528d3ea86061700fb6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUQ0OjlCRjQ0OjFBMjgyQjoyNEZBQzM6NkE1NDdBQzIiLCJ2aXNpdG9yX2lkIjoiMTA1NTM1MTc2Nzk1OTg5NDcyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 05240f87fe39c2110683eda741c1b415feee8d3eceb2e35cf67348996db47b25 |
| hovercard-subject-tag | issue:1409739887 |
| 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/18302/issue_layout |
| twitter:image | https://opengraph.githubassets.com/12b47abc5a4fd848ac2c2323f0ccdfea373f664219c371bdf119940a4af4019a/PowerShell/PowerShell/issues/18302 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/12b47abc5a4fd848ac2c2323f0ccdfea373f664219c371bdf119940a4af4019a/PowerShell/PowerShell/issues/18302 |
| og:image:alt | Summary of the new feature / enhancement There's a lot of boiler plate in experimental features, it'd be nice to have a source generator which takes this code: NOTE: Of course this would only benef... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SeeminglyScience |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width