Title: keywords scoped in places where not actually keywords, IF inside simple interpolation `()` for instance · Issue #152 · PowerShell/EditorSyntax · GitHub
Open Graph Title: keywords scoped in places where not actually keywords, IF inside simple interpolation `()` for instance · Issue #152 · PowerShell/EditorSyntax
X Title: keywords scoped in places where not actually keywords, IF inside simple interpolation `()` for instance · Issue #152 · PowerShell/EditorSyntax
Description: Environment Editor and Version: VS Code: 1.31 Insiders / 1.30.1 Your primary theme: Monokai Dimmed (modified) Issue Description In the following image and code, the if is being scoped as 'keyword.control', as if it was valid to utilize a...
Open Graph Description: Environment Editor and Version: VS Code: 1.31 Insiders / 1.30.1 Your primary theme: Monokai Dimmed (modified) Issue Description In the following image and code, the if is being scoped as 'keyword.c...
X Description: Environment Editor and Version: VS Code: 1.31 Insiders / 1.30.1 Your primary theme: Monokai Dimmed (modified) Issue Description In the following image and code, the if is being scoped as 'keywo...
Opengraph URL: https://github.com/PowerShell/EditorSyntax/issues/152
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"keywords scoped in places where not actually keywords, IF inside simple interpolation `()` for instance","articleBody":"### Environment\r\n\r\n- Editor and Version: VS Code: 1.31 Insiders / 1.30.1\r\n- Your primary theme: Monokai Dimmed (modified)\r\n\r\n### Issue Description\r\n\r\nIn the following image and code, the `if` is being scoped as 'keyword.control', as if it was valid to utilize an IF statement at this point. However it is not valid, and the code instead causes an error stating that `The term 'if' is not recognized as the name …` No syntax error is reported by EditorServices either. PSReadLine however does indicate that the `if` would be treated as a command instead of a keyword.\r\n\r\n#### Screenshots\r\nVS Code:\r\n\r\nPSReadLine\r\n\r\n(keywords would be green)\r\n\r\n### Expected Behavior\r\n\r\nI would like to expect that this case would not receive 'keyword.control' scoping, so that I am not led to believe the given command might actually be correct. A quick attempt to correct this indicates that this will require some reorganization, because too many items are in the root patterns and not in the repository. \r\n\r\nThis also shows that there is more to argument mode vs. expression mode than I had originally thought. Control statements cannot always be used everywhere a command can be used. This also affects other limited scope keywords, such as `in`, which is scoped as 'keyword.control' in more places than it should be.\r\n\r\n### Code Samples\r\n\r\n```PowerShell\r\n '\u003c?xml version=\"1.0\"' + (if ($encoding) {' encoding=\"' + $encoding + '\"'}) + '?>'\r\n```\r\nThe correct code:\r\n```PowerShell\r\n '\u003c?xml version=\"1.0\"' + $(if ($encoding) {' encoding=\"' + $encoding + '\"'}) + '?>'\r\n```\r\n","author":{"url":"https://github.com/msftrncs","@type":"Person","name":"msftrncs"},"datePublished":"2018-12-29T07:18:47Z","url":"https://github.com/PowerShell/EditorSyntax/issues/152"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:07e16350-a0e8-fad6-68e1-7f280af8d51f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD8C:2FE627:32413:44B9E:6AFE0F2B |
| html-safe-nonce | dbd3912b95402f915dc7ce5393a953eb3bcaf1196f87f242dc8a431a5537617f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDhDOjJGRTYyNzozMjQxMzo0NEI5RTo2QUZFMEYyQiIsInZpc2l0b3JfaWQiOiI4MTQxMTY4MTYyNzA5MDQ5MTMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9d02433f5025448c214c470a1570178433afafb1a050d96dae4f2cce8e942fb4 |
| hovercard-subject-tag | issue:394769590 |
| 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/EditorSyntax/152/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9bdee4b8dc75861f65cd7e4fe7a899d4a94f360284f9e21d47335170e2e0b0ed/PowerShell/EditorSyntax/issues/152 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9bdee4b8dc75861f65cd7e4fe7a899d4a94f360284f9e21d47335170e2e0b0ed/PowerShell/EditorSyntax/issues/152 |
| og:image:alt | Environment Editor and Version: VS Code: 1.31 Insiders / 1.30.1 Your primary theme: Monokai Dimmed (modified) Issue Description In the following image and code, the if is being scoped as 'keyword.c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | msftrncs |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1fd4053be37b4bd545b4f38f1cecad058c343776acf2cbc6806316f26270e55e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/EditorSyntax git https://github.com/PowerShell/EditorSyntax.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 59601299 |
| octolytics-dimension-repository_nwo | PowerShell/EditorSyntax |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 59601299 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/EditorSyntax |
| 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 | 635a57b3d0df6bc21c0f39fc7078888fb90e4066 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width