-
Notifications
You must be signed in to change notification settings - Fork 222
[release/dev18.0] Source code updates from dotnet/dotnet #12364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dotnet-maestro
wants to merge
18
commits into
release/dev18.0
Choose a base branch
from
darc-release/dev18.0-830e1908-4b4f-4fc9-ab65-c5292641c8d2
base: release/dev18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2
−2
Open
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2150c99
Backflow from https://github.com/dotnet/dotnet / c737522 build 287652
dotnet-maestro[bot] cb22add
Update dependencies from https://github.com/dotnet/dotnet build 287652
dotnet-maestro[bot] 300e798
Update dependencies from https://github.com/dotnet/dotnet build 287710
dotnet-maestro[bot] c6013d3
Update dependencies from https://github.com/dotnet/dotnet build 287756
dotnet-maestro[bot] 0f3a896
Update dependencies from https://github.com/dotnet/dotnet build 287866
dotnet-maestro[bot] ebdc6be
Update dependencies from https://github.com/dotnet/dotnet build 287966
dotnet-maestro[bot] ba750bd
Update dependencies from https://github.com/dotnet/dotnet build 288065
dotnet-maestro[bot] f34067d
Update dependencies from https://github.com/dotnet/dotnet build 288391
dotnet-maestro[bot] fdf7d17
Update dependencies from https://github.com/dotnet/dotnet build 288435
dotnet-maestro[bot] a082c77
Update dependencies from https://github.com/dotnet/dotnet build 288919
dotnet-maestro[bot] 02f8b9e
Update dependencies from https://github.com/dotnet/dotnet build 289051
dotnet-maestro[bot] 92376d2
Update dependencies from https://github.com/dotnet/dotnet build 289152
dotnet-maestro[bot] f08e0eb
Update dependencies from https://github.com/dotnet/dotnet build 289521
dotnet-maestro[bot] 2395754
Update dependencies from https://github.com/dotnet/dotnet build 289695
dotnet-maestro[bot] ecf25ba
Revert unnecessary file addition
jjonescz 685b9e7
Update dependencies from https://github.com/dotnet/dotnet build 290631
dotnet-maestro[bot] df8bcae
Update dependencies from https://github.com/dotnet/dotnet build 290774
dotnet-maestro[bot] bf0ef07
Update dependencies from https://github.com/dotnet/dotnet build 291265
dotnet-maestro[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...isualStudio.LanguageServices.Razor/LanguageClient/Cohost/SemanticTokensRefreshNotifier.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
| using System.ComponentModel.Composition; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Microsoft.CodeAnalysis.ExternalAccess.Razor; | ||
| using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; | ||
| using Microsoft.CodeAnalysis.Razor.Workspaces.Settings; | ||
| using Microsoft.VisualStudio.Razor.LanguageClient.Cohost; | ||
| using Microsoft.VisualStudio.Threading; | ||
|
|
||
| namespace Microsoft.AspNetCore.Razor.LanguageServer; | ||
|
|
||
| [Export(typeof(IRazorCohostStartupService))] | ||
| [method: ImportingConstructor] | ||
| internal sealed class SemanticTokensRefreshNotifier(IClientSettingsManager clientSettingsManager) : IRazorCohostStartupService, IDisposable | ||
| { | ||
| private readonly IClientSettingsManager _clientSettingsManager = clientSettingsManager; | ||
|
|
||
| private IRazorClientLanguageServerManager? _razorClientLanguageServerManager; | ||
| private bool _lastColorBackground; | ||
|
|
||
| public int Order => WellKnownStartupOrder.Default; | ||
|
|
||
| public Task StartupAsync(VSInternalClientCapabilities clientCapabilities, RazorCohostRequestContext requestContext, CancellationToken cancellationToken) | ||
| { | ||
| _razorClientLanguageServerManager = requestContext.GetRequiredService<IRazorClientLanguageServerManager>(); | ||
|
|
||
| if (clientCapabilities.Workspace?.SemanticTokens?.RefreshSupport ?? false) | ||
| { | ||
| _lastColorBackground = _clientSettingsManager.GetClientSettings().AdvancedSettings.ColorBackground; | ||
| _clientSettingsManager.ClientSettingsChanged += ClientSettingsManager_ClientSettingsChanged; | ||
| } | ||
|
|
||
| return Task.CompletedTask; | ||
| } | ||
|
|
||
| private void ClientSettingsManager_ClientSettingsChanged(object sender, EventArgs e) | ||
| { | ||
| var colorBackground = _clientSettingsManager.GetClientSettings().AdvancedSettings.ColorBackground; | ||
| if (colorBackground == _lastColorBackground) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| _lastColorBackground = colorBackground; | ||
| _razorClientLanguageServerManager.AssumeNotNull().SendNotificationAsync(Methods.WorkspaceSemanticTokensRefreshName, CancellationToken.None).Forget(); | ||
| } | ||
|
|
||
| public void Dispose() | ||
| { | ||
| _clientSettingsManager.ClientSettingsChanged -= ClientSettingsManager_ClientSettingsChanged; | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this was added via dotnet/dotnet#2927. There was a commit "revert Razor changes" (dotnet/dotnet@ce92a87) but it seems to have missed this file, I assume unintentionally.