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

Monitoring project state (wait until fully loaded etc.) #1580

Open
paiden opened this issue Aug 8, 2019 · 0 comments
Open

Monitoring project state (wait until fully loaded etc.) #1580

paiden opened this issue Aug 8, 2019 · 0 comments

Comments

@paiden
Copy link

paiden commented Aug 8, 2019

Im currently developing an OmniSharp plugin that implements new endpoints for some project analysis actions, that require the whole project to be loaded. E.g. one of this endpoints does a variant of a 'FindAllReferences' operation.

Currently I think I have quite a few problems because of inconsistent project state.

  1. If OmniSharp loads a quite large solution and I invoke this endpoint quite early from the client side, no references are found. If I do the exact same call 30 seconds later, it works like a charm.

  2. The client sends /fileschanged for various files and project in the solution. Also after that often the new endpoint call delivers inconsistent results for some time.

So my question is how can I implement behavior like this

class MyEndpointHandler : IRequestHandler<Input, Result>
{
   private readonly OmniSharpWorkspace omniWorkspace;
  public async Task<Result> Handle(Input inp)
  {
     await this.workspace.WaitUntilFullyLoaded(); // <--- Is something like this possible
     
    // And now run the logic that requires the fully loaded Roslyn solution
    // Maybe even take a snapshot of the project state beforehand?
    ... 
  }
}

Is this possible at all?
Is there some other issue going on?
Are there viable workarounds?

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

No branches or pull requests

1 participant