Skip to content

Fix https://github.com/mono/monodevelop/issues/4820#27007

Merged
sharwell merged 1 commit intodotnet:masterfrom
DavidKarlas:fixClassification
May 29, 2018
Merged

Fix https://github.com/mono/monodevelop/issues/4820#27007
sharwell merged 1 commit intodotnet:masterfrom
DavidKarlas:fixClassification

Conversation

@DavidKarlas
Copy link
Copy Markdown
Contributor

MonoDevelop(VSfM) recently switched from using Microsoft.CodeAnalysis.Classification.Classifier to using IAccurateClassifier from VS API.
But with this switch some classifications that were added in #24931 stopped working. Reason for this is that in that commit new classifications were filtered out by converting back to classification that was used before ClassificationTypeNames.Identifier so VS Windows would continue working fine. But later in #25723 this ClassificationTypes were added so I assume with removing this filtering VS Windows will work just fine since ClassificationTypes that were added #25723 have BaseType ClassificationTypeNames.Identifier.

Customer scenario

In VSfM some themes differentiate between property and method name highlighting, and this is considered regression, hence this PR.

Bugs this fixes

It's actually in monodevelop repository: mono/monodevelop#4820 I can open another one here if you want...

Workarounds, if any

None.

Risk

I'm not sure if this will cause any regression in VS Windows.

Performance impact

None to minimal improvement.

Is this a regression from a previous update?

No.

Root cause analysis

This was done intentionally so even if tests were added it wouldn't discover this problem.

How was the bug found?

Internal dogfooding of VSfM.

Test documentation updated?

This seems like too specific problem to be manually tested.

@DavidKarlas DavidKarlas requested a review from a team as a code owner May 21, 2018 10:24
@jcouv jcouv added the Area-IDE label May 21, 2018
@sharwell sharwell added this to the 15.8 milestone May 21, 2018
@sharwell sharwell self-assigned this May 21, 2018
@jasonmalinowski
Copy link
Copy Markdown
Member

MonoDevelop(VSfM) recently switched from using Microsoft.CodeAnalysis.Classification.Classifier to using IAccurateClassifier from VS API.

Was mostly curious what this means precisely -- is Roslyn's IAccurateClassifier (through that interface itself) is now being called directly in the Visual Studio for Mac case? Or you're calling something else?

@KirillOsenkov
Copy link
Copy Markdown
Member

This is the VSMac PR that switches to Roslyn classification:
mono/monodevelop#4740

Copy link
Copy Markdown
Contributor

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

Two of the integration test failures are caused by the change in behavior. These will need to be updated.

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

hey @KirillOsenkov Could you clarify why IAccurateClassifier being used? It is like IAccurateTagger? If so, are you guys using it for GetAllTags, or for GetTags? The former is good for purposes like printing (where you want accurate and up to date tags. but the latter is much better for performance as it is fully async.

Thanks!

@DavidKarlas
Copy link
Copy Markdown
Contributor Author

Sorry for confusion, we are using GetTags so it's IClassifier...

We were using Roslyn classification before that PR but now it's using Microsoft.VisualStudio.Text.Classification.IViewClassifierAggregatorService which has benefit of Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider implementation(so we don't call GetSemantcModelAsync on UI Thread(to get classification) and merging syntactical and semantic classifications...

@jasonmalinowski
Copy link
Copy Markdown
Member

@DavidKarlas OK, awesome, good. Gave me a heart attack there for a moment!

@sharwell
Copy link
Copy Markdown
Contributor

@jinujoseph for approval

@jinujoseph
Copy link
Copy Markdown
Contributor

jinujoseph commented May 24, 2018

Pre-Approved to merge for 15.8.preview3 provided Dustins feedback is addressed

Copy link
Copy Markdown
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.

There's another change that needs to be made to the VerifyProjectConfigChange integration test. After it switches to Release, Bar should be classified as a "method name"

@sharwell
Copy link
Copy Markdown
Contributor

@DustinCampbell integration tests are enabled again and I unskipped the relevant tests in #27106 so we should get good information from the build currently in progress 👍

@DavidKarlas DavidKarlas force-pushed the fixClassification branch 2 times, most recently from 9ee5b72 to ce74111 Compare May 25, 2018 17:22
MonoDevelop(VSfM) recently switched from using `Microsoft.CodeAnalysis.Classification.Classifier` to using `IAccurateClassifier` from VS API.
But with this switch some classifications that were added in dotnet#24931 stopped working. Reason for this is that in that commit new classifications were filtered out by converting back to classification that was used before `ClassificationTypeNames.Identifier` so VS Windows would continue working fine. But later in dotnet#25723 this ClassificationTypes were added so I assume with removing this filtering VS Windows will work just fine since ClassificationTypes that were added dotnet#25723 have BaseType `ClassificationTypeNames.Identifier`.
@DavidKarlas
Copy link
Copy Markdown
Contributor Author

@DustinCampbell all tests passed.

@KirillOsenkov
Copy link
Copy Markdown
Member

Please let us know how we can help to move this forward. VSMac needs this change. Thanks!

Copy link
Copy Markdown
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.

Looks like everything is green!

@sharwell sharwell merged commit 309b9fe into dotnet:master May 29, 2018
@KirillOsenkov
Copy link
Copy Markdown
Member

👍 wonderful, thank you all!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants