Skip to content

Commit

Permalink
Merge release/dev17.12 to main (#10732)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
dotnet-bot authored Aug 13, 2024
2 parents a01016a + f9c15e4 commit 77e74bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -21,6 +30,16 @@ public Task<InitializeResult> HandleRequestAsync(InitializeParams request, Razor
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 77e74bd

Please sign in to comment.