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

Change progression providers to use capabilities instead of IntelliSe…nse type. This enables them to work on both .Net core projects and legacy projects. #15935

Closed
wants to merge 6 commits into from

Conversation

RaulPerez1
Copy link

Customer scenario

.Net core projects don't implement IntelliSense type so progression features don't work in those (i.e. seeing the types in a file in solution explorer)

Bugs this fixes:

dotnet/project-system#592

Workarounds, if any

No workarounds

Risk

Low. No actual changes to the code here other than move the provider to use capabilities instead of IntelliSense type on the MEF export.

Performance impact

Low - See above for details.

Is this a regression from a previous update?

Not a regression.

Root cause analysis:

Not a bug in Roslyn per-se. The change to support capabilities was added to progression in Dev15.

How was the bug found?

Dogfooding

…nse type. This enables them to work on both .Net core projects and legacy projects.
@RaulPerez1
Copy link
Author

@Pilchie @jasonmalinowski - This are the changes I was asking about. I'm not sure that I moved them to the right .Next assembly so please let me know what the right place would be if this isn't it.

@@ -12,7 +11,7 @@

namespace Microsoft.VisualStudio.LanguageServices.CSharp.Progression
{
[GraphProvider(Name = "CSharpRoslynProvider", IntellisenseType = Guids.CSharpProjectRootIdString)]
[GraphProvider(Name = "CSharpRoslynProvider", ProjectCapability = "CSharp")]
Copy link
Member

Choose a reason for hiding this comment

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

Should be LanguageNames.CSharp.

Copy link
Author

Choose a reason for hiding this comment

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

That constant resolves to C# not CSharp which is the project capability. Those constants are defined in CPS but I'm presuming that we don't really want to take a CPS dependency here just for these strings

"Microsoft.VisualStudio.Shell.Immutable.10.0": "15.0.25413-Preview5",
"RoslynDependencies.Microsoft.VisualStudio.GraphModel": {
"version": "15.0.25726-Preview5",
"suppressParent": "all"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you should need suppressParent here.


namespace Microsoft.VisualStudio.LanguageServices.CSharp.Progression
{
[GraphProvider(Name = "VisualBasicRoslynProvider", ProjectCapability = "VisualBasic")]
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, I'm not sure that we have a constant that has "VisualBasic" with no space :(

internal sealed class VisualBasicGraphProvider : AbstractGraphProvider
{
[ImportingConstructor]
public VisualBasicGraphProvider(
Copy link
Member

Choose a reason for hiding this comment

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

Given that this is identical to the C# one, is it possible to have a single provider instead that is tagged with both Capabilities? Doing that would make it more understandable why these are in the language neutral assembly.

If not, can you add a comment explaining why they are where they are?

Copy link
Author

Choose a reason for hiding this comment

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

I'll try it out, originally there were two (on different assemblies) so I'm presuming they were both needed.

Copy link
Author

Choose a reason for hiding this comment

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

Single provider worked well with the or on the capability.

@Pilchie
Copy link
Member

Pilchie commented Dec 15, 2016

Also tagging the rest of @dotnet/roslyn-ide

@RaulPerez1
Copy link
Author

@dotnet/roslyn-ide - Can someone shed some light on how this part is supposed to work:

14:25:23 Verifying project.json contents
14:25:25 Error! Package RoslynDependencies.Microsoft.VisualStudio.GraphModel has different versions:
14:25:25 src\VisualStudio\Core\Def\project.json at 14.3.25407
14:25:25 src\VisualStudio\Core\Next\project.json at 15.0.25726-Preview5
14:25:25 The versions must be the same or one must be explicitly listed as fixed in RepoData.json

I didn't see any RepoData.json in the enlistment so I'm guessing this is a build machine thing?

@Pilchie Pilchie added this to the 2.0 (RC.3) milestone Dec 21, 2016
Copy link
Member

@Pilchie Pilchie left a comment

Choose a reason for hiding this comment

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

Thanks!

"Microsoft.VisualStudio.Shell.Immutable.10.0": "15.0.25413-Preview5",
"RoslynDependencies.Microsoft.VisualStudio.GraphModel": {
"version": "15.0.25726-Preview5",
"suppressParent": "all"
Copy link
Member

Choose a reason for hiding this comment

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

I still don't think you want suppressParent here.

Copy link
Member

Choose a reason for hiding this comment

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

@Pilchie is right, suppress parent isn't needed.

Why isn't this being delivered via NuGet? Looks like it's on MyGet instead.

Copy link
Author

Choose a reason for hiding this comment

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

I'll remove it, I added it back seeing if that would fix the other issue.

@Pilchie
Copy link
Member

Pilchie commented Dec 21, 2016

The RepoUtil config is at build/config/RepoUtilData.json.

You'll need to add this to the fixedPackages list.

@jaredpar any chance you could include the config path in the errors?

@RaulPerez1 any ideas how to make the error message more actionable?

@RaulPerez1
Copy link
Author

@Pilchie - This is what I would write in that error message:

The versions must be the same or one must be explicitly listed as fixed under fixedPackages in build\config\RepoUtilData.json

You may not even need the full path there, if it had mentioned RepoUtilData.json I could have found it and figured it out from there.

@jaredpar - If the question was for me, no idea. I just added the dependency as it was from the other project but with the Preview3 version.

@Pilchie
Copy link
Member

Pilchie commented Dec 29, 2016

Note that @jaredpar is changing a bunch of project.json stuff in #16142. Might want to make sure this aligns with that.

@@ -7,6 +7,7 @@
"System.Collections.Immutable": "1.1.36",
"Microsoft.VisualStudio.CoreUtility": [ "14.3.25407", "15.0.25726-Preview5" ],
"Microsoft.VisualStudio.Editor": [ "14.3.25407", "15.0.25726-Preview5" ],
"Microsoft.VisualStudio.GraphModel": [ "14.3.25407", "15.0.25726-Preview5" ],
Copy link
Member

Choose a reason for hiding this comment

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

Where is this package uploaded to? I didn't see it on NuGet.org.

Copy link
Author

Choose a reason for hiding this comment

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

I'll follow up with the owners and get back to you on that.

Copy link
Member

Choose a reason for hiding this comment

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

@RaulPerez1 if you rebase off of this PR you shouldn't need any changes here #16305

"version": "15.0.25726-Preview5",
"suppressParent": "all"
}
"RoslynDependencies.Microsoft.VisualStudio.GraphModel": "15.0.25726-Preview5"
Copy link
Member

Choose a reason for hiding this comment

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

This package name doesn't line up with the entries in the config file. Typo?

@MattGertz MattGertz modified the milestones: 2.0 (RTM), 2.0 (RC.3) Jan 14, 2017
@RaulPerez1 RaulPerez1 closed this Jan 18, 2017
@RaulPerez1 RaulPerez1 deleted the ProgressionCapabilities branch January 18, 2017 00:35
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.

None yet

6 participants