Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[powershell] A specific regex breaks code colours #36991

Closed
fullenw1 opened this issue Oct 26, 2017 · 6 comments
Closed

[powershell] A specific regex breaks code colours #36991

fullenw1 opened this issue Oct 26, 2017 · 6 comments
Assignees
Labels
grammar Syntax highlighting grammar languages-basic Basic language support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@fullenw1
Copy link

fullenw1 commented Oct 26, 2017

  • 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:

  1. Paste the code below in VSCode.
  2. 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 = 'myemail@mycompany.com',

        [ValidateNotNullOrEmpty()]
        [ValidatePattern("^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$")]
        [string]$To = 'myemail@mycompany.com',

        [ValidateNotNullOrEmpty()]
        [ValidatePattern("^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$")]
        [string]$Cc,

        [ValidateNotNullOrEmpty()]
        [ValidatePattern("^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$")]
        [string]$Bcc = 'myemail@mycompany.com'
    )

    Begin
    {
        $CultureInfo = [System.Globalization.CultureInfo]'en-US'
    }

    Process
    {
        foreach ($IdItem in $Id)
        {
            $Alert = ''
            $Alert = Get-SCOMAlert -Id $IdItem
        }
    }
}

@mjbvz mjbvz added the grammar Syntax highlighting grammar label Oct 26, 2017
@aeschli aeschli assigned daviwil and unassigned aeschli Oct 27, 2017
@aeschli
Copy link
Contributor

aeschli commented Nov 14, 2017

@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?

@aeschli aeschli changed the title A specific regex breaks code colours [posershell] A specific regex breaks code colours Nov 17, 2017
@aeschli aeschli changed the title [posershell] A specific regex breaks code colours [powershell] A specific regex breaks code colours Nov 17, 2017
@aeschli aeschli added the languages-basic Basic language support issues label Nov 17, 2017
@aeschli aeschli added this to the Backlog milestone Nov 17, 2017
@aeschli
Copy link
Contributor

aeschli commented Dec 4, 2017

@rkeithhill Ok if I assign it to you?

@rkeithhill
Copy link

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 @daviwil.

@aeschli aeschli modified the milestones: Backlog, February 2018 Feb 9, 2018
@aeschli
Copy link
Contributor

aeschli commented Feb 9, 2018

Fixed my switching having VSCode use the grammar from https://GitHub.com/powershell/editorsyntax.

@typicode @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
Copy link
Contributor

aeschli commented 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 aeschli added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Feb 27, 2018
@aeschli aeschli modified the milestones: February 2018, Backlog Feb 27, 2018
@aeschli
Copy link
Contributor

aeschli commented Feb 27, 2018

This issue was moved to PowerShell/EditorSyntax#71

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar languages-basic Basic language support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

5 participants