Граф коммитов

13105 Коммитов

Автор SHA1 Сообщение Дата
David Wengier 8120409176 Fix build, and a tiny bit of nuget.config cleanup 2024-01-19 13:27:56 +11:00
David Wengier ff88736b85 Update cohost endpoints to specify the language (which is just default) 2024-01-19 11:52:08 +11:00
David Wengier 0c3d8c825a Merge remote-tracking branch 'upstream/main' into GenerationFromTextDocument 2024-01-19 11:44:31 +11:00
David Wengier 3db6752c58 Respond to Roslyn using its own protocol types 2024-01-19 11:28:59 +11:00
David Wengier 971268d27d Respond to breaking changes to CLaSP 2024-01-19 11:28:48 +11:00
David Wengier 99c35f28b8 Update endpoints to specify the language (which is just default) 2024-01-19 08:20:15 +11:00
David Wengier 6bab09ce40
Don't register cohost types with the Razor project system (#9830)
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1939874

After talking to Dustin this morning I decided to slightly
change tact with cohosting, and not worry about having it be able to
co-exist with the current language server. That means this RPS
regression is easy to fix just by disconnecting the cohost
OpenDocumentGenerator from that system. Yes, that means co-hosting is
now slightly worse, but if we move away from co-existence, then it
matters a lot less, as we no longer expect it to fully work, it just
needs to work enough to let us all get our work done. This PR doesn't
change that.

In reality what this change does is that if cohosting is on, and the old
server is off, then semantic tokens won't be correct for files that were
already open when you stared VS. You have to close and reopen the file.
No big deal IMO
2024-01-19 07:42:29 +11:00
David Wengier f19210950d Bump Roslyn to 4.10.0-1.24067.21 2024-01-18 21:49:04 +11:00
David Wengier 24b594e6f9 Don't register cohost types with the Razor project system 2024-01-18 13:50:28 +11:00
Phil Allen 6566bbb906
Add telemetry for time-to-first diagnostic (#9795)
* Add telemetry for time-to-first diagnostic

By adding this Diagnostic kind to our set of capabilities, the VS Win system lights up to gather the time to first diagnostic event, so we can track changes in that time.  This will effectively be for our entire diagnostic process, not just syntactic diagnostics as the name of the constants implies.
Adds a simple unittest for the endpoint.
2024-01-17 15:54:35 -08:00
Chris Sienkiewicz cd0eeb4465
Fix incrementalism when suppressed: (#9717)
* Fix incrementalism when suppressed:
- Previously when going from unsuppressed -> suppressed we cleared certain caches
- This meant that when going from suppressed -> unsuppressed we were always re compiling every razor file
- Now instead, we produce nothing *until* the generator is unsuppressed, after which we just say that whatever is in the caches is up to date if we're suppressed.
- This ensures no downstream processing takes place when the generator is suppressed, but there is still data to incrementally update when unsuppressed
- We still remove the generated files at the last step when suppressed, so there is no output, but don't have to recompile anything to get the output back again.
2024-01-17 15:35:11 -08:00
Dustin Campbell 6f5814d2f7
Unify IErrorReporter instances (#9824)
This change unifies the IErrorReporter instances used in Razor tooling.
It turns out that there were extras that might cause some errors to not
be reported at all.

### Summary of the changes

1. I've removed the `ErrorReporter.Instance` property. This was a simple
`IErrorReporter` instance that did nothing at all. However, it was
passed into the `ProjectSnapshotManager` used in the language server.
So, any errors from the server's `ProjectSnapshotMangager` wouildn't
actually be reported anywhere useful. Now, the server's
`ProjectSnapshotManager` will use the correct `IErrorReporter` instance,
which reports errors to an `ILogger`.
2. `IErrorReporter` is no longer a Roslyn workspace service. So,
everyplace that retrieved an instance from the workspace is updated to
import an `IErrorReporter` from the DI host (i.e. MEF in VS, and
MS.Extensions.DependencyInjection in the language server).
3. In VS, because `IErrorReporter` isn't exported as a Roslyn workspace
service, that means that there are no longer _two_ `IErrorReporter`
instances in VS. There's now just the one.
2024-01-17 15:34:32 -08:00
Dustin Campbell 6c63314cbf Unify IErrorReporter instances
This change unifies the IErrorReporter instances used in Razor tooling.
It turns out that there were extras that might cause some errors to
not be reported at all.

1. I've removed the `ErrorReporter.Instance` property. This was a
simple `IErrorReporter` instance that did nothing at all. However, it
was passed into the `ProjectSnapshotManager` used in the language
server. So, any errors from the server's `ProjectSnapshotMangager`
wouildn't actually be reported anywhere useful. Now, the server's
`ProjectSnapshotManager` will use the correct `IErrorReporter` instance,
which reports errors to an `ILogger`.
2. `IErrorReporter` is no longer a Roslyn workspace service. So,
everyplace that retrieved an instance from the workspace is updated to
import an `IErrorReporter` from the DI host (i.e. MEF in VS, and
MS.Extensions.DependencyInjection in the language server).
3. In VS, because `IErrorReporter` isn't exported as a Roslyn workspace
service, that means that there are no longer _two_ `IErrorReporter`
instances in VS. There's now just the one.
2024-01-17 11:30:19 -08:00
Dustin Campbell 19f4ca1173
Fix and clean up `DocumentVersionCache` (#9810)
While investigating `ProjectSnapshotManagerDispatcher`, I encountered an
issue with `DocumentVersionCache` where it would never exit an
upgradeable read lock. This pull request fixes that issue and makes
several other changes.

1. `DocumentVersionCache` no longer exposes internal data structures for
unit tests. Instead, it provides a `TestAccessor` to avoid allowing
unfettered access to a dictionary that should only be accessed within a
lock.
2. Tests now use a real dispatcher to modify `ProjectSnapshotManager`,
which exposes the issue fixed in this PR.
3. Asserts have been added to verify that methods are called with the
correct lock being held.
4. Structs are no longer passed around to indicate the lock state. These
were a little broken anyway because they are mutable structs that track
their dispose state. However, if they were disposed by an inner method,
the dispose state wouldn't be observed by an outer call because the
structs were passed by value.

Since I've moved some code around, it might be helpful to review
commit-by-commit.
2024-01-17 10:59:37 -08:00
Dustin Campbell 187f0c6a7e Apply code review feedback for DocumentVersionCache 2024-01-17 08:32:53 -08:00
Dustin Campbell 31a2739c7a Stop passing structs around in DocumentVersionCache 2024-01-17 08:32:52 -08:00
Dustin Campbell f7a643007f Fix misspelled method name 2024-01-17 08:32:51 -08:00
Dustin Campbell 47be1a969c Add Debug.Asserts to make expected locking states clear 2024-01-17 08:32:51 -08:00
Dustin Campbell 5b3cc44d03 Move another method to DocumentVersionCache.TestAccessor 2024-01-17 08:32:50 -08:00
Dustin Campbell 4e8cabcbb0 Rework DocumentVersionCache tests to use real ProjectSnapshotManagerDispatcher
Changing these tests detected and fixed a locking bug in
DocumentVersionCache.
2024-01-17 08:32:50 -08:00
Dustin Campbell dc6eac1dd6 Expose TestAccessor from DocumentVersionCache rather than direct access to internals 2024-01-17 08:32:36 -08:00
David Wengier 33eb116b0a Reference VS protocol from workspaces (because it's not transitively brought in by Roslyn any more) 2024-01-17 13:30:41 +11:00
David Wengier 0b081ae120 Use the Roslyn project system for generating code for open documents 2024-01-17 13:30:21 +11:00
Dustin Campbell 71bfe681f7
Convert RazorProjectService to an interface (#9819)
Just converting another pure abstract class to an interface.
2024-01-16 08:31:00 -08:00
David Wengier 3afb7ffffa
[main] Update dependencies from dotnet/source-build-reference-packages (#9821) 2024-01-16 05:49:27 +11:00
dotnet-maestro[bot] 5fbbd9fd90 Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240109.3
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 9.0.0-alpha.1.23627.2 -> To Version 9.0.0-alpha.1.24059.3
2024-01-15 14:05:29 +00:00
David Wengier 55489b88e5
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2352694 (#9818) 2024-01-13 10:53:26 +11:00
Dustin Campbell acc5d9fb60 Convert RazorProjectService to an interface
Just converting another pure abstract class to an interface.
2024-01-12 12:26:25 -08:00
dotnet bot 093fe7a8d8 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2352653 2024-01-12 21:22:25 +01:00
Andrew Hall c2e01a21c8
Async hook up change in options (#9809)
Unified settings is an async package, which means any service it provides has to be loaded asynchronously or incurr a JTF.Run. Since MEF constructors are free threaded, this can cause a block. Use async hook up of change events to mitigate any threading concerns
2024-01-12 12:11:09 -08:00
David Wengier e89aa9a570
Use Roslyn project info in cohost endpoints (#9805) 2024-01-13 07:07:05 +11:00
David Wengier 48e767f93a
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2352215 (#9815) 2024-01-12 22:45:47 +11:00
dotnet bot 18555cc34f Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2352215 2024-01-12 10:58:19 +01:00
dotnet bot 5e7cb0d357 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2352215 2024-01-12 10:57:53 +01:00
Jan Jones ed0238db07
Update ASP.NET Core runtime used in tests to v8 GA (#9793)
* Update ASP.NET Core runtime used in tests to v8 GA

* Update a baseline
2024-01-12 10:44:06 +01:00
David Wengier 484bf6e8b1 PR Feedback 2024-01-12 11:05:13 +11:00
David Wengier 813b80ccca Fake the document version for now 2024-01-11 15:03:23 +11:00
David Wengier 7dffc15cb8 Use the new system for the current cohost endpoints 2024-01-11 15:03:23 +11:00
David Wengier 2d8218ea20 Fill out related documents properties 2024-01-11 15:03:23 +11:00
David Wengier 209295ef1e Fill out tag helpers 2024-01-11 15:03:23 +11:00
David Wengier 92f1ff3d46 Fill out RazorConfiguration and ProjectEngine properties 2024-01-11 15:03:23 +11:00
David Wengier 1c9c4d174b Finish off the CohostDocumentSnapshot by sharing reusing code from DocumentState 2024-01-11 15:03:22 +11:00
David Wengier b2fc07d9dc Create a DocumentContextFactory for cohosting that uses the new factories 2024-01-11 15:03:22 +11:00
David Wengier 61e378d8e5 Create snapshots and factories that use Roslyn project info instead of our own 2024-01-11 15:03:22 +11:00
David Wengier 569c9c50f3
Don't generate documents for cohosting if we're not cohosting (#9799) 2024-01-11 07:05:31 +11:00
Dustin Campbell 8ccf4a64b4
Move JSON serialization into shared project (#9792)
JSON.NET is no longer used by the majority of Razor product code. The
only components that use NewtonSoft.Json are LiveShare, benchmarks, and
the testing infrastructure. So, I've moved the JSON serialization
support code into a shared project that is linked into the appropriate
places, rather than compiled into `ProjectEngineHost`.
2024-01-10 08:58:40 -08:00
dotnet-maestro[bot] 70eb74af5c
Update dependencies from https://github.com/dotnet/arcade build 20240109.4 (#9801)
Microsoft.DotNet.Arcade.Sdk
 From Version 8.0.0-beta.23620.2 -> To Version 8.0.0-beta.24059.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-01-10 12:15:46 +00:00
Alexander Köplinger bd698a5bc7
Move to non-deprecated NuGetAuthenticate@1 task (#9800)
See https://github.com/dotnet/arcade/pull/14314
2024-01-10 13:14:00 +01:00
David Wengier 60d15d1a04 Don't do anything if we're not cohosting 2024-01-10 21:06:32 +11:00
Jan Jones 9f235c9362
Handle nested type parameters (#9689)
* Add tests

* Handle nested type parameters

* Add more tests

* Find type parameters in globally qualified name

* Test `dynamic`

* Keep only type parameters defined by the component

* Add comments
2024-01-10 09:33:41 +00:00