Repository navigation
Closed
Labels
grammarSyntax highlighting grammarlanguages-basicBasic language support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
Milestone
Description
- VSCode Version: Code 1.17.2 (b813d12, 2017-10-16T13:59:46.104Z)
- OS Version: Windows_NT x64 6.1.7601
- Extensions:
| Extension | Author (truncated) | Version |
|---|---|---|
| PowerShell | ms- | 1.4.3 |
| vscode-icons | rob | 7.16.0 |
(2 theme extensions excluded)
Steps to Reproduce:
- Paste the code below in VSCode.
- Look at the code. Starting line 15, code colours are wrong.
The line [validatePattern('^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$')] seems to break code colours.
function New-Foo
{
Param(
[Parameter(
Mandatory,
Position = 0,
ValueFromPipeline,
ValueFromPipelineByPropertyName
)]
[ValidateNotNullOrEmpty()]
[System.Guid]$Id,
[ValidateNotNullOrEmpty()]
[validatePattern('^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$')]
[string]$SmtpServer = 'smtp.mycompany.com',
[ValidateNotNullOrEmpty()]
[ValidateRange(1, 65535)]
[int]$Port = 25,
[ValidateNotNullOrEmpty()]
[ValidatePattern("^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$")]
[string]$From = '[email protected]',
[ValidateNotNullOrEmpty()]
[ValidatePattern("^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$")]
[string]$To = '[email protected]',
[ValidateNotNullOrEmpty()]
[ValidatePattern("^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$")]
[string]$Cc,
[ValidateNotNullOrEmpty()]
[ValidatePattern("^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$")]
[string]$Bcc = '[email protected]'
)
Begin
{
$CultureInfo = [System.Globalization.CultureInfo]'en-US'
}
Process
{
foreach ($IdItem in $Id)
{
$Alert = ''
$Alert = Get-SCOMAlert -Id $IdItem
}
}
}
Metadata
Metadata
Assignees
Labels
grammarSyntax highlighting grammarlanguages-basicBasic language support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
Activity
aeschli commentedon Nov 14, 2017
David Wilson (@daviwil) Hi David, do you still want to own this issue (and other Powershell issues in the vscode repo) or should I reassign? Who would be a good replacement?
[-]A specific regex breaks code colours[/-][+][posershell] A specific regex breaks code colours[/+][-][posershell] A specific regex breaks code colours[/-][+][powershell] A specific regex breaks code colours[/+]aeschli commentedon Dec 4, 2017
Keith Hill (@rkeithhill) Ok if I assign it to you?
rkeithhill commentedon Dec 4, 2017
It would be better to move this issue to https://GitHub.com/powershell/editorsyntax.
For issues specific to the PowerShell extension, @tylerl0706 is taking over for David Wilson (@daviwil).
aeschli commentedon Feb 9, 2018
Fixed my switching having VSCode use the grammar from https://GitHub.com/powershell/editorsyntax.
typicode Keith Hill (@rkeithhill) Note that we now use the powershell/editorsyntax grammar. From what I've see, that results in some coloring changes, but the changes look ok to me and it fixes some issues too.
I'll move incoming requests/ complaints on the powershell grammar to https://GitHub.com/powershell/editorsyntax.
aeschli commentedon Feb 27, 2018
https://GitHub.com/powershell/editorsyntax has changed the grammar to what we had in 1.20. That means this issue is back again. Moving to https://GitHub.com/powershell/editorsyntax.
aeschli commentedon Feb 27, 2018
This issue was moved to PowerShell/EditorSyntax#71
[powershell] switch grammar to powershell/editorsyntax. Fixes microso…