Rob Holt

Results 253 comments of Rob Holt

The fix we'd want to make is here: https://github.com/PowerShell/PowerShell/blob/55ccbb6803162965eead3a08aace37f11ea7630b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs#L4442-L4472 Everywhere there where quotes are tested for and replaced, we should be looking for all the kinds of quotes the tokeniser...

> ~15 such patterns are in the file :-) Yeah the way we generally handle quotation in the completers is badly done and ideally we would fix it all. But...

We should consider fixing this for RC.1

Yes, after discussing with @SteveL-MSFT, this behaviour seems to be quite explicitly coded for: https://github.com/PowerShell/PowerShell/blob/a3319d7580dabbae6a9bb06a16771fc6f6f1d4ff/src/System.Management.Automation/engine/parser/tokenizer.cs#L2311-L2315 > Alas, no joy here - notice the syntax highlighting which indicates that the parser...

So just to expand on this a bit, since we discussed it. PowerShell uses dynamic scope. That means that a variable's value depends on the runtime stack. If you show...

Yeah it's possible. It should be done on a per-scriptblock basis (the AST visitor should build a stack of dictionaries of variables as it visits each scriptblock down a lexical...

> So PSScriptAnalyzer doesn't technically do syntax parsing on the text itself as text? PSScriptAnalyzer takes the script text and uses the [Parser API](https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.language.parser) to get the AST and tokens...

You might find [this blog post](https://devblogs.microsoft.com/scripting/psscriptanalyzer-deep-dive-part-1-of-4/) to be a helpful introduction on how PSSA works

There's no such rule today, for the reasons I describe above.