project-system icon indicating copy to clipboard operation
project-system copied to clipboard

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

Open davkean opened this issue 7 years ago • 23 comments

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.

davkean avatar Mar 28 '18 02:03 davkean

Happy to test this out when we have one.

AbhitejJohn avatar Mar 30 '18 23:03 AbhitejJohn

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

AbhitejJohn avatar May 02 '18 23:05 AbhitejJohn

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.

davkean avatar May 03 '18 04:05 davkean

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

japj avatar Oct 11 '18 04:10 japj

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.

Pilchie avatar Oct 12 '18 21:10 Pilchie

@davkean Any updates on this? Thank you.

kristianjaeger avatar Dec 23 '18 15:12 kristianjaeger

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

AliBayatGH avatar Dec 30 '18 19:12 AliBayatGH

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.

tolgabalci avatar Dec 31 '18 22:12 tolgabalci

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

kristianjaeger avatar Jan 02 '19 21:01 kristianjaeger

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.

davkean avatar Jan 04 '19 06:01 davkean

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

kristianjaeger avatar Jan 04 '19 17:01 kristianjaeger

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?

iWangJiaxiang avatar May 23 '19 07:05 iWangJiaxiang

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.

opis-mark avatar Jun 29 '19 05:06 opis-mark

Any updates?

duaneking avatar Apr 17 '20 21:04 duaneking

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.

tanveerbadar avatar Dec 21 '22 08:12 tanveerbadar

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

drewnoakes avatar Dec 21 '22 10:12 drewnoakes

@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.

kristianjaeger avatar Dec 21 '22 17:12 kristianjaeger

@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?

drewnoakes avatar Dec 21 '22 20:12 drewnoakes

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.

kristianjaeger avatar Dec 21 '22 21:12 kristianjaeger

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.

PeterMacej avatar Dec 21 '22 21:12 PeterMacej

@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.

drewnoakes avatar Dec 21 '22 21:12 drewnoakes

@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.

tanveerbadar avatar Oct 20 '23 14:10 tanveerbadar

@tanveerbadar that issue is no longer blocked on this.

drewnoakes avatar Oct 23 '23 20:10 drewnoakes