Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 3d539c8

Browse files
Merge branch 'autocompletebox-fix' into autocompletebox-implementation
2 parents c40b757 + 4c97d48 commit 3d539c8

File tree

109 files changed

+13723
-5234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+13723
-5234
lines changed

src/GitHub.Api/GraphQLClient.cs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Threading;
99
using System.Threading.Tasks;
1010
using GitHub.Extensions;
11-
using Microsoft.VisualStudio.Threading;
1211
using Octokit.GraphQL;
1312
using Octokit.GraphQL.Core;
1413

@@ -28,12 +27,10 @@ public GraphQLClient(
2827
this.cache = cache;
2928
}
3029

31-
public async Task ClearCache(string regionName)
30+
public Task ClearCache(string regionName)
3231
{
3332
// Switch to background thread because FileCache does not provide an async API.
34-
await TaskScheduler.Default;
35-
36-
cache.ClearRegion(GetFullRegionName(regionName));
33+
return Task.Run(() => cache.ClearRegion(GetFullRegionName(regionName)));
3734
}
3835

3936
public Task<T> Run<T>(
@@ -131,28 +128,29 @@ public CachingWrapper(
131128

132129
public Uri Uri => owner.connection.Uri;
133130

134-
public async Task<string> Run(string query, CancellationToken cancellationToken = default)
131+
public Task<string> Run(string query, CancellationToken cancellationToken = default)
135132
{
136133
// Switch to background thread because FileCache does not provide an async API.
137-
await TaskScheduler.Default;
138-
139-
var hash = GetHash(query);
140-
141-
if (refresh)
134+
return Task.Run(async () =>
142135
{
143-
owner.cache.Remove(hash, regionName);
144-
}
136+
var hash = GetHash(query);
145137

146-
var data = (string)owner.cache.Get(hash, regionName);
138+
if (refresh)
139+
{
140+
owner.cache.Remove(hash, regionName);
141+
}
147142

148-
if (data != null)
149-
{
150-
return data;
151-
}
143+
var data = (string) owner.cache.Get(hash, regionName);
144+
145+
if (data != null)
146+
{
147+
return data;
148+
}
152149

153-
var result = await owner.connection.Run(query, cancellationToken);
154-
owner.cache.Add(hash, result, DateTimeOffset.Now + cacheDuration, regionName);
155-
return result;
150+
var result = await owner.connection.Run(query, cancellationToken);
151+
owner.cache.Add(hash, result, DateTimeOffset.Now + cacheDuration, regionName);
152+
return result;
153+
}, cancellationToken);
156154
}
157155
}
158156
}
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<ResourceDictionary
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
4-
54
<ResourceDictionary.MergedDictionaries>
6-
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Styles/VsColorsBlue.xaml" />
7-
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Styles/VsBrushesBlue.xaml" />
8-
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Styles/ThemeBlue.xaml" />
9-
</ResourceDictionary.MergedDictionaries>
5+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/VsBrushes.xaml" />
6+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/VsColors.xaml" />
7+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/CommonControlsColors.xaml" />
8+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/ThemedDialogColors.xaml" />
9+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/EnvironmentColors.xaml" />
10+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/Dark/TreeViewColors.xaml" />
11+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/CommonControlsButtonStyle.xaml" />
12+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/CommonControlsCheckboxStyle.xaml" />
13+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/CommonControlsComboboxStyle.xaml" />
14+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/CommonControlsTextboxStyle.xaml" />
15+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Themes/ThemedDialogStyles.xaml" />
1016

17+
<!-- Set this theme to match the Visual Studio theme above -->
18+
<ResourceDictionary Source="pack://application:,,,/GitHub.VisualStudio.UI;component/Styles/ThemeDark.xaml" />
19+
</ResourceDictionary.MergedDictionaries>
20+
<ResourceDictionary x:Key="ThemedDialogDefaultStylesKey" Source="/Themes/ThemedDialogDefaultStyles.xaml" />
1121
</ResourceDictionary>

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ public async Task<string> GetGraphQLPullRequestId(
716716
string repositoryOwner,
717717
int number)
718718
{
719-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
719+
var address = HostAddress.Create(localRepository.CloneUrl);
720720
var graphql = await graphqlFactory.CreateConnection(address);
721721

722722
var query = new Query()
@@ -775,7 +775,7 @@ public async Task<PullRequestDetailModel> CreatePendingReview(
775775
LocalRepositoryModel localRepository,
776776
string pullRequestId)
777777
{
778-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
778+
var address = HostAddress.Create(localRepository.CloneUrl);
779779
var graphql = await graphqlFactory.CreateConnection(address);
780780
var (_, owner, number) = await CreatePendingReviewCore(localRepository, pullRequestId);
781781
var detail = await ReadPullRequestDetail(address, owner, localRepository.Name, number, true);
@@ -790,7 +790,7 @@ public async Task<PullRequestDetailModel> CancelPendingReview(
790790
LocalRepositoryModel localRepository,
791791
string reviewId)
792792
{
793-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
793+
var address = HostAddress.Create(localRepository.CloneUrl);
794794
var graphql = await graphqlFactory.CreateConnection(address);
795795

796796
var delete = new DeletePullRequestReviewInput
@@ -818,7 +818,7 @@ public async Task<PullRequestDetailModel> PostReview(
818818
string body,
819819
PullRequestReviewEvent e)
820820
{
821-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
821+
var address = HostAddress.Create(localRepository.CloneUrl);
822822
var graphql = await graphqlFactory.CreateConnection(address);
823823

824824
var addReview = new AddPullRequestReviewInput
@@ -848,7 +848,7 @@ public async Task<PullRequestDetailModel> SubmitPendingReview(
848848
string body,
849849
PullRequestReviewEvent e)
850850
{
851-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
851+
var address = HostAddress.Create(localRepository.CloneUrl);
852852
var graphql = await graphqlFactory.CreateConnection(address);
853853

854854
var submit = new SubmitPullRequestReviewInput
@@ -880,7 +880,7 @@ public async Task<PullRequestDetailModel> PostPendingReviewComment(
880880
string path,
881881
int position)
882882
{
883-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
883+
var address = HostAddress.Create(localRepository.CloneUrl);
884884
var graphql = await graphqlFactory.CreateConnection(address);
885885

886886
var comment = new AddPullRequestReviewCommentInput
@@ -912,7 +912,7 @@ public async Task<PullRequestDetailModel> PostPendingReviewCommentReply(
912912
string body,
913913
string inReplyTo)
914914
{
915-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
915+
var address = HostAddress.Create(localRepository.CloneUrl);
916916
var graphql = await graphqlFactory.CreateConnection(address);
917917

918918
var comment = new AddPullRequestReviewCommentInput
@@ -944,7 +944,7 @@ public async Task<PullRequestDetailModel> PostStandaloneReviewComment(
944944
string path,
945945
int position)
946946
{
947-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
947+
var address = HostAddress.Create(localRepository.CloneUrl);
948948
var graphql = await graphqlFactory.CreateConnection(address);
949949

950950
var addReview = new AddPullRequestReviewInput
@@ -995,7 +995,7 @@ public async Task<PullRequestDetailModel> DeleteComment(
995995
int pullRequestId,
996996
int commentDatabaseId)
997997
{
998-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
998+
var address = HostAddress.Create(localRepository.CloneUrl);
999999
var apiClient = await apiClientFactory.Create(address);
10001000

10011001
await apiClient.DeletePullRequestReviewComment(
@@ -1013,7 +1013,7 @@ public async Task<PullRequestDetailModel> EditComment(LocalRepositoryModel local
10131013
string commentNodeId,
10141014
string body)
10151015
{
1016-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
1016+
var address = HostAddress.Create(localRepository.CloneUrl);
10171017
var graphql = await graphqlFactory.CreateConnection(address);
10181018

10191019
var updatePullRequestReviewCommentInput = new UpdatePullRequestReviewCommentInput
@@ -1036,7 +1036,7 @@ public async Task<PullRequestDetailModel> EditComment(LocalRepositoryModel local
10361036

10371037
async Task<(string id, string owner, int number)> CreatePendingReviewCore(LocalRepositoryModel localRepository, string pullRequestId)
10381038
{
1039-
var address = HostAddress.Create(localRepository.CloneUrl.Host);
1039+
var address = HostAddress.Create(localRepository.CloneUrl);
10401040
var graphql = await graphqlFactory.CreateConnection(address);
10411041

10421042
var input = new AddPullRequestReviewInput

src/GitHub.UI.Reactive/Assets/Controls.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<ResourceDictionary Source="Controls\Validation\UserErrorMessages.xaml" />
1010
<ResourceDictionary Source="Controls\Validation\ValidationMessage.xaml" />
1111
<ResourceDictionary Source="Controls\GitHubTabControl.xaml" />
12-
<ResourceDictionary Source="Controls\FilteredComboBox.xaml" />
1312
<ResourceDictionary Source="Controls\GitHubComboBox.xaml" />
1413
</ResourceDictionary.MergedDictionaries>
1514
</ResourceDictionary>

src/GitHub.UI.Reactive/Assets/Controls/FilteredComboBox.xaml

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)