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

Generic types are not handled correctly #3

Open
nerosnm opened this issue Feb 25, 2017 · 3 comments · Fixed by #7
Open

Generic types are not handled correctly #3

nerosnm opened this issue Feb 25, 2017 · 3 comments · Fixed by #7

Comments

@nerosnm
Copy link

nerosnm commented Feb 25, 2017

A type with a generic type annotation is not handled correctly (the generic type is not recognised).

For example:

struct STError<T: ErrorKind>: Error, CustomStringConvertible {
    // ...
}

produces this:

screen shot 2017-02-25 at 14 09 56

@yoshimkd
Copy link
Owner

I tried adapting the regex to fix the issue for this case, but I can't get it to work without breaking the other cases. :(
If you want you can take a look at it at line 68 in rubyResources/helpers.rb...
Thanks for noticing this issue

@ivanfoong
Copy link
Contributor

ivanfoong commented Aug 17, 2017

I think I managed to fix the regex to ignore the generic declaration by adding an additional group (?<genericPart>(<.*>)?) to match before inheritancePart group, see #7 for the changes

Tested the above given example against the updated regex at https://regex101.com/r/HCX86K/1

@yoshimkd
Copy link
Owner

@sorenmortensen Hello, sorry I accidentally closed the issue. @ivanfoong made a change in a pull request that should fix your issue that you can check out.

@yoshimkd yoshimkd reopened this Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants