You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think you will find that this is ultimately the same as #151/#152, the fundamental problem is that the syntax, like so many others, is really about highlighting keywords, and leaving the rest to the lint, but linting cannot catch the above, because break is a valid unquoted literal/text at that location, but its also a keyword, just not there.
The problem is, with syntax highlighting taken to the extreme, is if you only wanted to highlight a small excerpt out of something larger, without knowing the enclosing scope, the highlighter may not highlight some keywords that have limited use, for example, in or else, but not break as break is a valid keyword as long as its the first token on a statement.
So, while I am trying to work (an experiment) on a version of the PowerShell syntax that is more closely resembling what the tokenizer actually does, I expect that it will cause some problems that are unexpected.
Erdem (@rifaterdemsahin), FYI, I've posted a PR (a while ago now) of the expirement I have been doing in a full statement syntaxing approach. PR #156. It would resolve this issue. From your example (with variations):
The PR is still a WIP, but you could sample it if you want. You can get a VS Code ready JSON version of the syntax file here (rename the original VS Code file, and put this one in its place.)
Activity
msftrncs commentedon Jan 1, 2019
I think you will find that this is ultimately the same as #151/#152, the fundamental problem is that the syntax, like so many others, is really about highlighting keywords, and leaving the rest to the lint, but linting cannot catch the above, because
breakis a valid unquoted literal/text at that location, but its also a keyword, just not there.The problem is, with syntax highlighting taken to the extreme, is if you only wanted to highlight a small excerpt out of something larger, without knowing the enclosing scope, the highlighter may not highlight some keywords that have limited use, for example,
inorelse, but notbreakasbreakis a valid keyword as long as its the first token on a statement.So, while I am trying to work (an experiment) on a version of the PowerShell syntax that is more closely resembling what the tokenizer actually does, I expect that it will cause some problems that are unexpected.
msftrncs commentedon Apr 28, 2019
Erdem (@rifaterdemsahin), FYI, I've posted a PR (a while ago now) of the expirement I have been doing in a full statement syntaxing approach. PR #156. It would resolve this issue. From your example (with variations):
The PR is still a WIP, but you could sample it if you want. You can get a VS Code ready JSON version of the syntax file here (rename the original VS Code file, and put this one in its place.)