* 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
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.
- 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.
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.
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.
This is an automatically generated pull request from release/dev17.8
into release/dev17.10.
Once all conflicts are resolved and all the tests pass, you are free to
merge the pull request. 🐯
## Troubleshooting conflicts
### Identify authors of changes which introduced merge conflicts
Scroll to the bottom, then for each file containing conflicts copy its
path into the following searches:
- https://github.com/dotnet/razor/find/release/dev17.8
- https://github.com/dotnet/razor/find/release/dev17.10
Usually the most recent change to a file between the two branches is
considered to have introduced the conflicts, but sometimes it will be
necessary to look for the conflicting lines and check the blame in each
branch. Generally the author whose change introduced the conflicts
should pull down this PR, fix the conflicts locally, then push up a
commit resolving the conflicts.
### Resolve merge conflicts using your local repo
Sometimes merge conflicts may be present on GitHub but merging locally
will work without conflicts. This is due to differences between the
merge algorithm used in local git versus the one used by GitHub.
``` bash
git fetch --all
git checkout -t upstream/merges/release/dev17.8-to-release/dev17.10
git reset --hard upstream/release/dev17.10
git merge upstream/release/dev17.8
# Fix merge conflicts
git commit
git push upstream merges/release/dev17.8-to-release/dev17.10 --force
```