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

15470 Коммитов

Автор SHA1 Сообщение Дата
Dustin Campbell 72be23494e Add IEnumerable<T> OrderAsArray extension methods 2024-08-12 14:06:14 -07:00
Dustin Campbell a3c13752ee Add IReadOnlyList<T> OrderAsArray extension methods 2024-08-12 12:25:45 -07:00
Dustin Campbell 4c0c2795de Un-nest ComparerHelper<T> and DescendingComparer<T> 2024-08-12 11:45:40 -07:00
Dustin Campbell 45e64fbcba Add ImmutableArray<T>.Unsafe() extension with in-place order methods 2024-08-12 11:40:44 -07:00
Dustin Campbell 027dd045a1 Add XML doc comments to ImmutableArray Order extensions 2024-08-12 10:52:39 -07:00
Dustin Campbell aedbb64730 Add CopyTo(Span<T>) extension methods to Utilities.Shared 2024-08-12 10:44:02 -07:00
Dustin Campbell 3920563359
Remove ItemCollection from TagHelperDescriptorProviderContext (#10720)
Every `TagHelperDescriptorProviderContext` creates an `ItemCollection`
to hold onto, at most, two objects: a `Compilation` and a target
`ISymbol`. This is enormously wasteful because an `ItemCollection`
internally creates a `ConcurrentDictionary<object, object>`. So, I've
changed `TagHelperDescriptorProviderContext` to just hold onto a
compilation and a target symbol and avoid the `ItemCollection`
altogether.

I recommend reviewing commit-by-commit.

Also, I bumped into a long standing compiler bug in
`EventHandlerTagHelperDescriptorProvider` that was recently filed by a
customer: https://github.com/dotnet/razor/issues/10497. I opted to stay
on target and not fix this issue, but I made it painfully obvious where
the fix would go. 😄
2024-08-12 07:49:40 -07:00
dotnet-maestro[bot] 204efc45d2 Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240805.2
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 9.0.0-alpha.1.24374.1 -> To Version 9.0.0-alpha.1.24405.2
2024-08-12 12:42:48 +00:00
dotnet-maestro[bot] ae5c378660 Failed to perform coherency update for one or more dependencies. 2024-08-10 12:07:16 +00:00
David Wengier 9044af2a6d
Unskip and fix rename integration tests (#10722) 2024-08-10 09:32:00 +10:00
Jared Parsons cd1f82be21
Move to central package pinning (#10716)
* Move to central package pinning

This should make it much easier for us to respond to CG alerts in the
future. All that will need to be done is add an entry in
Directory.Packages.props and it will automatically impact all consumers
of it.

Consider this example in Roslyn for how to respond to a CG issue

https://github.com/dotnet/roslyn/pull/74653
2024-08-09 15:26:39 -07:00
dotnet-maestro[bot] a8ead71685 Update dependencies from https://github.com/dotnet/arcade build 20240808.2
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24408.1 -> To Version 9.0.0-beta.24408.2
2024-08-09 12:42:08 +00:00
David Wengier ed8dceef5c Try to fix rename tests 2024-08-09 21:43:33 +10:00
David Wengier 4441e1da03 Unskip rename tests 2024-08-09 21:43:26 +10:00
David Wengier 4bbedc61a7 Fix after rebase 2024-08-09 12:30:20 +10:00
David Wengier 1297fea58a Extract some common code 2024-08-09 11:31:36 +10:00
David Wengier ef49d716d3 Fix up tests because sometimes you ask Visual Studio to compile and it decides to skip a few things 2024-08-09 11:31:36 +10:00
David Wengier ee44c75030 Rename TryGetTextDocumentChanges to something better, and cleanup, and remove duplicate 2024-08-09 11:31:36 +10:00
David Wengier 3308f4f4fc Add C# rename test 2024-08-09 11:31:36 +10:00
David Wengier 6e0bb7004f Move EditMappingService, and create Remote and Lsp versions that do document lookups 2024-08-09 11:31:36 +10:00
David Wengier fb8702671f Add component rename test to validate Razor behaviour 2024-08-09 11:31:36 +10:00
David Wengier 7d514b3faf Add rename endpoint 2024-08-09 11:31:36 +10:00
David Wengier c1e718153e Sync the ReturnCodeActionAndRenamePathsWithPrefixedSlash flag to OOP 2024-08-09 11:31:36 +10:00
David Wengier 47665e0d26 Create a remote rename service, and dependencies, to perform the rename 2024-08-09 11:31:36 +10:00
David Wengier f3881562f7 Cleanups and tweaks 2024-08-09 11:31:35 +10:00
David Wengier 17671b6cde Extract rename functionality to a separate service 2024-08-09 11:31:35 +10:00
David Wengier d5cfe11b00
Don't pass `RazorCodeDocument` and `SourceText` around together (#10719)
because it's really easy to get one from the other.

While working on rename in cohosting, I noticed this unnecessary extra
bit of work while calling `GetPositionInfo`, so I fixed it. Then I
thought I'd see where else `GetSourceTextAsync` was used in an non-ideal
way, and that was clearly going to be too big for the rename PR so I
separated it out into it's own PR. Then I heard Dustin say he was
changing `DocumentSnapshot` so the unnecessary work will end up being
much less wasteful anyway, plus we'd probably just have conflicts, so I
pared the whole thing right back to just this minor removal of a couple
of unnecessary parameters. Enjoy.
2024-08-09 09:15:19 +10:00
David Wengier 79b2d26a80 I spent 10 minutes looking up cool Mr Freeze catch phrases for this commit message, and I didn't like any of them. 2024-08-09 08:46:36 +10:00
Dustin Campbell 9f6c7b6186 Clean up CompilationTagHelperResolver 2024-08-08 13:16:01 -07:00
Dustin Campbell 5fbfc0d454 Clean up all ITagHelperDescriptorProviders a bit (and found a bug!)
- Enable nullability
- Mark all as sealed
- Use `Lazy<T>` for singleton `ITagHelperDescriptorProviders`
- Introduce `TagHelperDescriptorProviderBase`
- Inherit from `TagHelperDescriptorProviderBase`
- Remove unnecessary properties
- Remove unnecessary property setters

In addition, I spotted a bug in `EventHandlerTagDescriptorProvider` while addressing nullability warnings. The buggy code is right here:

fb84ae5d9b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/EventHandlerTagHelperDescriptorProvider.cs (L70-L76)

When reading the constructor arguments of an `EventHandlerAttribute` it appears that we swap the last two arguments of the 4-argument variant. The constructor is defined like so:

```C#
EventHandlerAttribute(string attributeName, Type eventArgsType, bool enableStopPropagation, bool enablePreventDefault);
```

Unfortunately, the compiler reads the third parameter as `enablePreventDefaeult` and the fourth parameter as `enableStopPropagation`.

This has been broken since support for the 4-argument constructor variant was added in 7635bba6ef. Fixing this bug is tracked by https://github.com/dotnet/razor/issues/10497.
2024-08-08 12:28:46 -07:00
Dustin Campbell eae0d53793 Make ExcludeHidden and IncludeDocumentation init-only properties 2024-08-08 10:19:35 -07:00
Dustin Campbell 9476634170 Swap TagHelperDescriptorProviderContext.Create methods for constructors 2024-08-08 10:14:05 -07:00
Dustin Campbell 45625bc1a2 Remove TagHelperDescriptorProviderContext.Items property
This can be safely removed now that there are no more references.
2024-08-08 10:09:29 -07:00
Dustin Campbell ec5cd16335 Make TargetSymbol a TagHelperDescriptorProviderContext property 2024-08-08 10:07:39 -07:00
Dustin Campbell adff92a959 Make Compilation a TagHelperDescriptorProviderContext property
Every single `TagHelperDescriptorProviderContext` created in Razor compiler or tooling code adds a valid compilation. So, adding the compilation to the `ItemsCollection` is pure overhead and no `ITagHelperDescriptorProvider` needs to check it for null.

I removed a single test that verified the behavior if a compilation was never set. Now that a compilation is required, this test is no longer needed.
2024-08-08 10:05:46 -07:00
Dustin Campbell 53ec3abbf2 Merge TagHelperDescriptorProviderContext and DefaultContext 2024-08-08 09:44:38 -07:00
dotnet-maestro[bot] 60926b85aa Update dependencies from https://github.com/dotnet/arcade build 20240808.1
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24405.1 -> To Version 9.0.0-beta.24408.1
2024-08-08 12:47:14 +00:00
David Wengier 00e584a722 Don't pass code document and source text around in diagnostics translator, plus some cleanup 2024-08-08 21:15:00 +10:00
David Wengier 2c0e2528ae Remove unnecessary parameter, because it can be trivially retrieved 2024-08-08 17:03:26 +10:00
David Wengier f9c15e44b5
Add simple telemetry to initialize endpoint (#10715)
Adds a single telemetry point so that we if we receive feedback that
something unusual behavior occurs, we can determine if Fuse was engaged
or not engaged.
2024-08-08 10:01:22 +10:00
Dustin Campbell fb84ae5d9b
Co-hosting: Add API for mapping a generated document URI and range back to the host document (#10712)
There's a fair amount of refactoring here, but I was careful to separate
everything. So, I recommend reviewing commit-by-commit.
2024-08-07 16:06:53 -07:00
David Wengier e817d39020 PR feedback 2024-08-08 09:03:56 +10:00
Fredric Silberberg b5c4983ae5 Upgrade System.Security.Cryptography.Xml to avoid CG alerts. 2024-08-07 11:42:31 -07:00
Fredric Silberberg f8c1f4552d Update System.Formats.Asn1 to address CG alert. 2024-08-07 11:42:31 -07:00
Dustin Campbell a2c21cfac5 Find razor document correctly in RemoveDocumentMappingService 2024-08-07 09:22:07 -07:00
Dustin Campbell 358c2bfdc6 Add extension methods that convert URIs to Roslyn file paths 2024-08-07 09:22:01 -07:00
dotnet-maestro[bot] b169e89f1f Update dependencies from https://github.com/dotnet/arcade build 20240805.1
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24401.1 -> To Version 9.0.0-beta.24405.1
2024-08-07 12:49:54 +00:00
phil-allen-msft f65c6b609a Add simple telemetry to initialize endpoint 2024-08-06 22:00:13 -07:00
Dustin Campbell e4a6932dfc Use Uri.LocalPath rather than GetAbsoluteOrUNCPath() 2024-08-06 17:25:17 -07:00
Dustin Campbell 50a3d417da Move MapToHostDocuementUriAndRangeAsync to extension methods
This change also removes the `AbstractDocumentMappingService.TryGetCodeDocumentAsync(...)` method that was added in an an early commit.
2024-08-06 17:01:49 -07:00