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 namespace matching is strange when namespace contains square brackets #1317

Closed
CoenraadS opened this issue Mar 1, 2018 · 3 comments

Comments

@CoenraadS
Copy link

CoenraadS commented Mar 1, 2018

Input:

function foo {
    [string[]]$thing 
}

image

I would expect:

[string[]] - Namespace

Another example is:

[OutputType([System.Collections.Generic.List[int]])] => [OutputType([System.Collections.Generic.List[int]

@CoenraadS
Copy link
Author

CoenraadS commented Mar 1, 2018

Here is a regex that matches equal []'s: \[([^[\]]|(?R))*\]

But I read at

// Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
something about not matching array indices but couldn't find an example of when it should not match

@CoenraadS CoenraadS changed the title PowerShell namespace matching is strange when namespace contains brackets PowerShell namespace matching is strange when namespace contains square brackets Mar 1, 2018
@Golmote
Copy link
Contributor

Golmote commented Mar 1, 2018

Hi! Thanks for reporting. The example regexp you provide is not a feature supported by regexps in JS.

But we can surely add support for one level of nested brackets to fix this issue.

@CoenraadS
Copy link
Author

Could two levels be added to support attributes with generic lists, i.e. [OutputType([System.Collections.Generic.List[int]])]

Thanks for this great project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants