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

14983 Коммитов

Автор SHA1 Сообщение Дата
David Wengier 8c844423fe
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2500297 (#10663)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2024-07-23 10:42:32 +10:00
Dustin Campbell f54c416bcc
Add latest .NET 8 runtime to global.json (#10659)
Since we updated to a .NET 9 SDK, the
MS.ANC.Razor.Microbenchmarks.Generator unit tests have failed to run
locally. This is because these test use Benchmark.NET, which performs a
builder at runtime targeting .NET 8. This works fine in CI because it
uses a .NET 8 SDK.

This change just adds the most recent .NET 8 runtime version to the list
of runtimes in Razor's global.json. So, it'll get installed into the
.dotnet folder and the Microbenchmarks.Generator will run and stop
reporting a spurious error.
2024-07-22 16:00:48 -07:00
dotnet bot afc5c61067 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2500214 2024-07-22 14:21:50 -07:00
dotnet bot 320824c009 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2500214 2024-07-22 14:21:40 -07:00
Andrew Hall b52ed1a6e5
Always use designtime document for formatting with FUSE (#10640)
Separated commits to functional change and code moving. This moves the
feature flag check into tooling instead of relying on the compiler to
know and generate documents differently.

That also allows for correctly doing document generation of
designtime/runtime from the tooling side. If FUSE is enabled tooling
will use runtime in all places except formatting. This is to keep
formatting working as it does today without FUSE and start A/B testing
faster.
2024-07-22 14:02:38 -07:00
Dustin Campbell f3bf643103 Remove Azure pipeline task to install .NET 8 runtime 2024-07-22 13:01:34 -07:00
Dustin Campbell c93ab140bf Add latest .NET 8 runtime to global.json
Since we updated to a .NET 9 SDK, the
MS.ANC.Razor.Microbenchmarks.Generator unit tests have failed to run
locally. This is because these test use Benchmark.NET, which performs a
builder at runtime targeting .NET 8. This works fine in CI because it
uses a .NET 8 SDK.

This change just adds the most recent .NET 8 runtime version to the
list of runtimes in Razor's global.json. So, it'll get installed into
the .dotnet folder and the Microbenchmarks.Generator will run and stop
reporting a spurious error.
2024-07-22 11:54:51 -07:00
Dustin Campbell cb90af2a06
Set RootNamespace for MS.VS.LanguageServices.Razor (#10653)
All of the types MS.VS.LanguageServices.Razor elide "LanguageServices"
from their namespaces. So, each type has `Microsoft.VisualStudio.Razor`
its root namespace. These have been kept in sync by pure discipline
until this change.

This change updates the `<RootNamespace>` for
MS.VS.LanguageServices.Razor to not include "LanguageServices". That
way, new files in this project will be created with a root namespace of
`Microsoft.VisualStudio.Razor`. Normally, changing the `<RootNamespace>`
should be a painless process. However, it was blocked due to issues
caused by the MS.ANC.Razor.Serialization.Json shared project's embedded
string resources. I've gone ahead and sorted that so that updating the
`<RootNamespace>` is now possible.
2024-07-19 15:49:10 -07:00
Dustin Campbell 7599a58a07 Set RootNamespace for MS.VS.LanguageServices.Razor
All of the types MS.VS.LanguageServices.Razor elide "LanguageServices" from their namespaces. So, each type has `Microsoft.VisualStudio.Razor` its root namespace. These have been kept in sync by pure discipline until this change.

This change updates the `<RootNamespace>` for MS.VS.LanguageServices.Razor to not include "LanguageServices". That way, new files in this project will be created with a root namespace of `Microsoft.VisualStudio.Razor`. Normally, changing the `<RootNamespace>` should be a painless process. However, it was blocked due to issues caused by the MS.ANC.Razor.Serialization.Json shared project's embedded string resources. I've gone ahead and sorted that so that updating the `<RootNamespace>` is now possible.
2024-07-19 13:43:35 -07:00
Dustin Campbell abec8947c6
Revisit Razor logging (#10641)
I recommend reviewing this commit-by-commit.

I took a look at logging to address an integration test issue where we
should ignore any exceptions that occur during logging because xUnit's
`ITestOutputHelper` is no longer available. Previously, we had swallowed
these exceptions across all unit tests as well. However, in unit tests,
these exceptions can be an early warning sign of other problems.

While addressing integration tests, I ended up taking a more thorough
look at logging and ended up re-implementing the log message formatting
to reduce string allocations. In addition, I cleaned up a fair number of
redundant "no-op" loggers and did an audit of all ILoggerProviders to
determine which ones needed to implement IDisposable.
2024-07-19 13:20:05 -07:00
Dustin Campbell fabbeeb5c0 Clean up MemoryBuilder<T>.Grow when checking again ArrayMaxLength 2024-07-19 12:39:26 -07:00
Dustin Campbell 749ded88f0 Add XML doc comments for StreamExtensions.CreateString and SpanAction 2024-07-19 12:15:56 -07:00
Jan Jones 4af4e6f7f0
Fix attribute parsing recovery (#10620)
* Add tests

* Fix attribute parsing recovery

* Update new baselines

* Fix expected missing source mapping

* Update pre-existing baselines

* Simplify code
2024-07-19 09:13:50 +00:00
David Wengier a12e07b8ca
Cohosting tests for Uri presentation (#10642)
Part of https://github.com/dotnet/razor/issues/9519 and
https://github.com/dotnet/razor/issues/10603

After this, all cohost endpoints have test coverage 😁
2024-07-19 13:55:53 +10:00
Fred Silberberg c79c96858c
Move BuildAnalyzers.sln to eng (#10647)
Having two sln files in the root directory means that `dotnet` CLI commands get confused about what sln to use and need to have it specified. To fix, we just move this solution file into eng, since it's only used for full builds anyways.
2024-07-19 03:55:32 +00:00
David Wengier 07ae1ebf22
Cohost: Support signature help (#10595)
Requires https://github.com/dotnet/roslyn/pull/74280, and won't even
compile without it.
Part of https://github.com/dotnet/razor/issues/9519

This brings signature help to Cohosting. It's a pretty simply PR, for a
pretty simple endpoint, as we just delegate, and there is no translation
of delegated info. The interesting part here is that we use
`System.Text.Json` for the remote signature help service, because it
makes more sense to take advantage of the existing Json converters for
the potential complexity of the `SignatureHelp` result type.
2024-07-19 12:44:37 +10:00
David Wengier 3f524c0b60 Tweak names 2024-07-19 10:52:05 +10:00
David Wengier 4670d3ee1b Don't call Html for Uri presentation if it's occuring in a C# region 2024-07-19 08:21:37 +10:00
Fred Silberberg f75ab6018f
Turn off trailing whitespace triming in strings (#10646)
We have tests with baselines that have trailing whitespaces. Our `trimTrailingWhitespace` setting means that those will get modified automatically, breaking those tests. To fix that, I implemented a vscode feature to avoid triming inside regex and strings, so let's use that.
2024-07-18 15:17:49 -07:00
Andrew Hall 0880f25fad
Update src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs
Co-authored-by: Dustin Campbell <dustin@teamcampbell.org>
2024-07-18 15:15:40 -07:00
Andrew Hall 7effa35738
Update src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.ComputedStateTracker.cs 2024-07-18 15:14:51 -07:00
David Wengier 45798d4af9 Merge remote-tracking branch 'upstream/main' into CohostSigHelp
# Conflicts:
#	eng/Versions.props
2024-07-19 07:51:27 +10:00
David Wengier d91189f3b0
Remove dodgy `UpdateSolution` method in cohosting tests (#10627)
Part of https://github.com/dotnet/razor/issues/9519 and
https://github.com/dotnet/razor/issues/10603
Requires https://github.com/dotnet/roslyn/pull/74402

Removes a little more dodginess in the cohosting tests by actually using
the `RazorPinnedSolutionInfoWrapper` for solution checksums, just like
the real OOP services.
2024-07-19 07:34:16 +10:00
David Wengier 2b48ebb7ab Minor cleanup 2024-07-19 07:18:56 +10:00
David Wengier ed318950ca PR Feedback 2024-07-19 07:17:48 +10:00
David Wengier dab39502c8
Update src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs
Co-authored-by: Dustin Campbell <dustin@teamcampbell.org>
2024-07-19 06:57:58 +10:00
David Wengier 9abb3a4c52 Bump Roslyn to inserted version 2024-07-19 06:54:19 +10:00
Dustin Campbell 3b480de903 Use ThrowHelper within ArgHelper 2024-07-18 10:05:22 -07:00
Dustin Campbell bdb1348608 Use static readonly field 2024-07-18 09:11:27 -07:00
Dustin Campbell 6fa6e780c0 Assert that nextCapacity > _memory.Length in MemoryBuilder<T> 2024-07-18 09:05:00 -07:00
Dustin Campbell 4002d45a8d Use static lambda 2024-07-18 09:00:27 -07:00
Dustin Campbell 590205be16 Add comment back to CodeWriter.GenerateString(...) 2024-07-18 08:59:25 -07:00
Dustin Campbell 54f3d279b4 Apply code review feedback for MemoryBuilder<T> 2024-07-18 08:58:10 -07:00
Phil Allen 8fd82a8268
Minor updates for Razor repo (#10576)
* Update name away from now-former nation name

* Update packages to modern versions

* Change package version
2024-07-18 08:09:03 -07:00
dotnet bot 5d75e5e6de
Merge release/dev17.11 to main (#10643)
This is an automatically generated pull request from release/dev17.11
into main.


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.11
- https://github.com/dotnet/razor/find/main

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.11-to-main
git reset --hard upstream/main
git merge upstream/release/dev17.11
# Fix merge conflicts
git commit
git push upstream merges/release/dev17.11-to-main --force
```
2024-07-18 02:29:56 -07:00
Phil Allen f07c7bb8e6
Port AsyncBatchingWorkQueue fix to release/dev17.11 (#10636)
This pull request cherry-picks b8f14d39bf
to `release/dev17.11`
2024-07-17 23:06:26 -07:00
David Wengier b01f6a7b5b Moar tests! 2024-07-18 15:47:37 +10:00
David Wengier a5469810e1 Initial tests 2024-07-18 14:32:45 +10:00
Andrew Hall (METAL) 9e0c256f90 Fix cohosting 2024-07-17 18:03:50 -07:00
Dustin Campbell 6458bc34e5
Add GetPooledArraySpan(...) extension method (#10625)
This change adds a new `GetPooledArraySpan(...)` extension method that
returns a pooled array as a `Span<T>` with the expected length. This can
help avoid bugs that can occur if a pooled array's `Length` is
accidental used.
2024-07-17 17:11:48 -07:00
Andrew Hall (METAL) 1a00a686bf Use the same code document everywhere 2024-07-17 17:03:38 -07:00
Dustin Campbell c945faf887 Use different ILoggerProvider for integration tests and clean up
While adding a new ILoggerProvider for integration tests that ignores messages sent after the output is invalid, I noticed a bunch of things to clean up. Importantly, Razor's ILoggerProvider no longer implements IDisposable as the MS.Extensions.Logging version does.
2024-07-17 16:56:17 -07:00
Andrew Hall (METAL) 19f6059f98 Add some tests 2024-07-17 16:52:06 -07:00
Dustin Campbell cdae4fa4f4 Use same EmptyLoggerFactory throughout Razor 2024-07-17 16:27:40 -07:00
David Wengier 6faa9e93ca File header 2024-07-18 09:18:24 +10:00
Dustin Campbell 5e636341be Use LogMessageFormatter in a couple existing loggers 2024-07-17 16:09:21 -07:00
Dustin Campbell f6bdc0bb50 Extract log message formatting and reduce string allocations 2024-07-17 16:09:18 -07:00
David Wengier 7fc8a12937 Revert and comment 2024-07-18 08:49:32 +10:00
Andrew Hall (METAL) fd2de6a112 Check feature flag and force design time if it's on 2024-07-17 15:48:03 -07:00
David Wengier d0142ace1d Use the right workspace, and everything just works! 2024-07-18 08:43:02 +10:00