* Stop crashing VS when logging errors.
- Ultimately this is more of a workaround for this issue: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1405849. But let me share some insight as to how we got here. When I initially ["protected VS from crashing"](95b33df1d6) due to the compiler bug I added logic that would `LogError` in the case that unexpected exceptions would occur. Now the problem with my approach is that our Language Server logger can potentially explode if the language server is in the midst of shutting down. Therefore, what would happen is the compiler would unexpectedly throw, we'd then try to log an error and if we were in a shutting down state that logging of an error would then throw again resulting in VS crashing.
- Went from logging an error to an unobserved task exception. This means things will still throw; however, they'll be translated into unobserved task exceptions.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1420246
* Address code review comments.
- Saw that automation was having a hard time auto-merging and noticed some stale / incorrect dependencies. Ran a few darc commands to fix things up.
- Razor no longer depends on Configuration.Json so could remove & needed to update the Extensiosn.Configuration package to have a coherent parent dependency to match.
- Marked the `RenameHandler` as `#nullable enable` and cleaned up some of the null handling in the rename flow.
- Removed an unnecessary throw if cancellation requested (the following `await` would have captured it anyhow).
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
Part of #5017
- Marked the `OnAutoInsertHandler` as `#nullable enable`. Some of the fallout from this was that I also had to mark the HTML C# language server as nullable enable as well and react accordingly. Ultimately this made things a lot more clear on when null could be returned.
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
Part of #5017
- When we fail to talk to a semantic endpoint we now indicate that we're out-of-sync.
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
Part of #5017
- Updated some logging language + severities
- Removed some unnecessary null checks
- In the pull diagnostic handler removed a comment on long-term goals (we do want to talk to multiple servers)
- Since the request diagnostics on all servers API utilizes `IAsyncEnumerable` I modified the pull diagnostic signature from returning an array which is mutable to an `IReadOnlyList` so I could build a list and then return it in an immutable format.
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
#5017
- Had to utilize our LSP document manager on the client to lookup the appropriate `TextBuffer` for translated diagnostic requests.
- Marked translation APIs as `nullable` since our new delegation APIs were. Updated callsites accordingly.
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
Part of #5017
- One issue with migrating our pre-existing code action resolve logic to the new APIs is that we needed to know what document a code action resolve request was for. To account for this I had to update all of our resolve code action APIs to flow the corresponding Razor host document so we could look it up on the client when re-invoking. This is the bulk of this changeset.
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
Part of #5017
- Had to update our completion resolve handler to take in our LSP document manager to ensure we can resolve corresponding text documents so on re-invocation the LSP platform knows which server to talk to.
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
Part of #5017
- Added a `ReinvocationResponse` extension to extract results or log to make reinvocation responses easier to handle.
- Updated the tests to reflect the new dependency on document snapshots and their virtual documents.
Part of #5017
Microsoft.CodeAnalysis.Razor , Microsoft.AspNetCore.Testing , Microsoft.AspNetCore.Razor.Language , Microsoft.AspNetCore.Razor.Internal.Transport , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X , Microsoft.AspNetCore.Mvc.Razor.Extensions
From Version 6.0.0-rtm.21518.12 -> To Version 6.0.0-rtm.21518.18
- Migrated projection and document mapping APIs to use new re-invocation APIs. Typically these two APIs will use the top-level Razor buffer as their inspection point for requesting custom messages (language query, document edit remap) so the top-level API's for the two classes didn't really have to change because we could lookup the document snapshot and grab its buffer directly.
- Update the `LSPProjectionProvider` and `LSPDocumentMappingProvider` APIs to be `nullable`
- Updated tests to reflect the new requirement of a document snapshot / `ITextBuffer` callpoint. The tests overall are in awful shape (way toooo mocky) but that's a problem for another day.
Part of #5017