dotnet / project-system

The .NET Project System for Visual Studio
MIT License
972 stars 389 forks source link

Add an API that lets consumers wait on language service to be up-to-date with a given project version #3425

Open davkean opened 6 years ago

davkean commented 6 years ago

We need an API that lets consumers wait on the language service to be up-to-date with a given project version, similar to IProjectTreeService.PublishTree:

Task PublishLatestAsync(
  CancellationToken cancellationToken = default(CancellationToken));

Task PublishAsync(
  IImmutableDictionary<NamedIdentity, IProjectVersionRequirement> minimumRequiredDataSourceVersions,
  CancellationToken cancellationToken = default(CancellationToken));

This lets services such as CodeModel provider to block this before returning a CodeModel item, or the renamer to block on this attempting to rename. Also lets us block VS integration tests on this work before attempting to test state.

Without this, it's impossible to know when ProjectItem.CodeModel is going to return a result.

AbhitejJohn commented 6 years ago

Happy to test this out when we have one.

AbhitejJohn commented 6 years ago

@davkean : Did we get a chance to schedule this work in yet...

davkean commented 6 years ago

We're doing this as part of the language service hookup rewrite in 15.8. First part is in review, but we've only started on 15.8 this week. We're at least a sprint away from it.

japj commented 6 years ago

Any update on this? It seems this is a blocking issue for https://developercommunity.visualstudio.com/content/problem/145930/create-unit-test-context-menu-missing-net-core-pro.html

Pilchie commented 6 years ago

Note also that as part of this work we should use this API to push information to the VS Platform's new Operation Progress API so that we can track the async initialization.

kristianjaeger commented 5 years ago

@davkean Any updates on this? Thank you.

AliBayatGH commented 5 years ago

It is December 30, 2018, and we are still on 15.9.4 with no create unit testing on .NET Core projects.

tolgabalci commented 5 years ago

Looking forward to getting the option for "Create Unit Tests" for our .Net Core apps. This is a great time saver and helps Jr developers be more comfortable with creating unit tests.

kristianjaeger commented 5 years ago

@Pilchie or @davkean Any updates on this? From May 2018 to January 2019 is a long sprint ;) . Thank you.

davkean commented 5 years ago

Appreciate your patience here, but due to the nature of software development it is hard to give a timeframe especially given the feature it was blocked on, only got to the point 5 minutes of ago of being ready to merge. We have tentatively put this in 16.1 timeframe but its priority is behind our focus for that release; .NET Core 3.0.

kristianjaeger commented 5 years ago

Thanks for the update. I think that folks are really looking forward to having feature parity for this. Cheers.

iWangJiaxiang commented 5 years ago

Appreciate your patience here, but due to the nature of software development it is hard to give a timeframe especially given the feature it was blocked on, only got to the point 5 minutes of ago of being ready to merge. We have tentatively put this in 16.1 timeframe but its priority is behind our focus for that release; .NET Core 3.0.

Hello, VS 2019 16.1.0 has been released and the feature to create tests for .Net Core is still not available?

opis-mark commented 5 years ago

It looks as though this issue has been moved to 16.2 milestone. Is there any indication as to whether or not it will gain enough traction to actually be included in 16.2? I would just like to add a vote for the ability to create tests .Net Core projects as well.

duaneking commented 4 years ago

Any updates?

tanveerbadar commented 1 year ago

Running VS 17.4 preview right now, still nothing after more than 4 years.

You folks do awesome work, but a timeline would be good.

drewnoakes commented 1 year ago

@tanveerbadar can you share the scenario for which you need this API?

kristianjaeger commented 1 year ago

@drewnoakes I had to reread this issue since it's been so long but I believe this is related to having the create unit tests option for .NET Core or these days .NET 7 projects I suppose. :). Thanks.

drewnoakes commented 1 year ago

@drewnoakes I had to reread this issue since it's been so long but I believe this is related to having the create unit tests option for .NET Core or these days .NET 7 projects I suppose. :). Thanks.

My reading of the linked ticket suggests that the unit testing team was able to address that without needing the API described here does that not match your experience?

kristianjaeger commented 1 year ago

Thanks @drewnoakes . This issue is so old I had not revisited it recently. That's great if the unit testing team fixed that issue with the 'create unit tests' option! That's mostly what I was interested in not sure about others here. Thanks.

PeterMacej commented 1 year ago

My problem was with ProjectItem.FileCodeModel being null after loading a project with my VS extension. This was reported in #2544. My dirty hack was to wait some time to make sure the FileCodeModel is initialized.

drewnoakes commented 1 year ago

@PeterMacej that makes sense. This is something I hope to implement before long as it would be useful in several places. The challenge is doing it in a way that won't lead to hangs when, for example, configurations are switched.

tanveerbadar commented 1 year ago

@tanveerbadar can you share the scenario for which you need this API?

There was some issue (which I can't recall) about creating unit tests in VS which linked to this and cited it as the blocking reason.

drewnoakes commented 1 year ago

@tanveerbadar that issue is no longer blocked on this.