This is an automatically generated pull request from release/dev17.12
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.12
- 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.12-to-main
git reset --hard upstream/main
git merge upstream/release/dev17.12
# Fix merge conflicts
git commit
git push upstream merges/release/dev17.12-to-main --force
```
This commit is contained in:
dotnet bot 2024-08-13 14:26:43 -07:00 коммит произвёл GitHub
Родитель a01016a112 f9c15e44b5
Коммит 77e74bd705
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -4,14 +4,23 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts;
using Microsoft.AspNetCore.Razor.Telemetry;
using Microsoft.CodeAnalysis.Razor.Workspaces;
using Microsoft.CommonLanguageServerProtocol.Framework;
using Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.AspNetCore.Razor.LanguageServer;
[RazorLanguageServerEndpoint(Methods.InitializeName)]
internal class RazorInitializeEndpoint : IRazorDocumentlessRequestHandler<InitializeParams, InitializeResult>
internal class RazorInitializeEndpoint(
LanguageServerFeatureOptions options,
ITelemetryReporter telemetryReporter) : IRazorDocumentlessRequestHandler<InitializeParams, InitializeResult>
{
private static bool s_reportedFeatureFlagState = false;
private readonly LanguageServerFeatureOptions _options = options;
private readonly ITelemetryReporter _telemetryReporter = telemetryReporter;
public bool MutatesSolutionState { get; } = true;
public Task<InitializeResult> HandleRequestAsync(InitializeParams request, RazorRequestContext requestContext, CancellationToken cancellationToken)
@ -21,6 +30,16 @@ internal class RazorInitializeEndpoint : IRazorDocumentlessRequestHandler<Initia
capabilitiesManager.SetInitializeParams(request);
var serverCapabilities = capabilitiesManager.GetInitializeResult();
// Initialize can be called multiple times in a VS session, but the feature flag can't change in that time, so we only
// need to report once. In VS Code things could change between solution loads, but each solution load starts a new rzls
// process, so the static field gets reset anyway.
if (!s_reportedFeatureFlagState)
{
s_reportedFeatureFlagState = true;
_telemetryReporter.ReportEvent("initialize", Severity.Normal, new
Property(nameof(LanguageServerFeatureOptions.ForceRuntimeCodeGeneration), _options.ForceRuntimeCodeGeneration));
}
return Task.FromResult(serverCapabilities);
}
}

Просмотреть файл

@ -73,7 +73,8 @@
"Description"="Enable combined design time/runtime code generation for Razor files"
"Value"=dword:00000000
"Title"="Force use of runtime code generation for Razor (requires restart)"
"PreviewPaneChannels"="IntPreview,int.main"
"PreviewPaneChannels"="*"
"VisibleToInternalUsersOnlyChannels"="*"
// CacheTag value should be changed when registration file changes
// See https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/39345/Manifest-Build-Deployment-and-Setup-Authoring-In-Depth?anchor=example-pkgdef-key for more infomation