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

Syntax highlighting improvements and tests #1014

Merged
merged 4 commits into from
Dec 6, 2016

Conversation

ivanz
Copy link
Contributor

@ivanz ivanz commented Dec 4, 2016

  1. Syntax highlighting support for class/interface generic constrains + tests.
  2. Much improved fields syntax highlighting + tests.

Fixes: #757, #960

Class Declaration and Inheritance

Screenshots are from before I made the above changes around generics, but you get the gist.

Before

image

After

image

Class Generic Constraints

Before

image

After

image

Fields

Before

image

After

image

@ivanz ivanz changed the title Syntax highlighting support for class/interface generic constrains Syntax highlighting improvements and tests Dec 4, 2016
@@ -123,6 +160,43 @@
}
]
},
"genericConstraints": {
"begin": "(where)\\s*(\\w+)\\s*:",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't matter in practice, but shouldn't the \\s* after (where) above technically be \\s+? Otherwise, wouldn't it match whereImCool:?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed.

}
},
{
"match": "([\\w<>]+)\\s*(?=,|where|{)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does matching [\\w<>]+ mean that it won't work for generic types with multiple parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I need to think how to handle this better. Whitespace handling is a pain in the a**. :) Will update the pull request.

@DustinCampbell DustinCampbell added this to the 1.6 milestone Dec 5, 2016
@ivanz ivanz force-pushed the ivan-class-syntax-improvements branch from e0eb3a0 to 5ca75df Compare December 5, 2016 21:00
@ivanz
Copy link
Contributor Author

ivanz commented Dec 6, 2016

I've done some updates and it's now again ready for review.

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better!

@ivanz
Copy link
Contributor Author

ivanz commented Dec 6, 2016

I saw you approved this pull (thanks!), but heads up that I don't have merge permissions, so you will have to merge it when ready 👍

@DustinCampbell
Copy link
Member

Yup. I was waiting to merge when I got into the office.

@DustinCampbell DustinCampbell merged commit 82142c6 into dotnet:master Dec 6, 2016
@ivanz ivanz deleted the ivan-class-syntax-improvements branch December 6, 2016 21:41
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 this pull request may close these issues.

3 participants