PowerShell / EditorSyntax

PowerShell syntax highlighting for editors (VS Code, Atom, SublimeText, TextMate, etc.) and GitHub!
MIT License
131 stars 42 forks source link

Syntax highlighting fails for `using module <relative-path>` #191

Open chriskuech opened 4 years ago

chriskuech commented 4 years ago

System Details

Can provide if necessary

Issue Description

Syntax highlighting does not work for relative path modules with the using module syntax.

Expected Behaviour

Syntax highlighting like this (ignore the warning) image

Actual Behaviour

The statement is white. image

Attached Logs

N/A

msftrncs commented 4 years ago

Yes, the syntax is very limited (too conservative) for the using keyword. The \ causes the entire syntaxing to fail, as its not acceptable per the grammar. I haven't made any improvement in this area either, with my PR #155 or #156, though I have in some others such as comment based help arguments.

chriskuech commented 4 years ago

The \ causes the entire syntaxing to fail, as its not acceptable per the grammar.

Ironic because due to a bug, \ is required for relative path imports.

msftrncs commented 4 years ago

😄 , I don't think that is a bug, I think it is by-design as a defense in depth measure, but definitely ironic.

I might try to look in to improving the 'using' keyword's syntaxing logic. I've done some already for the namespace portion in my PR's, but not for module.