Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public override async Task InitializeAsync()

VisualStudioLogging.AddCustomLoggers();

// Our expected test results have spaces not tabs
await TestServices.Shell.SetInsertSpacesAsync(ControlledHangMitigatingCancellationToken);

_projectFilePath = await CreateAndOpenBlazorProjectAsync(ControlledHangMitigatingCancellationToken);

await TestServices.SolutionExplorer.RestoreNuGetPackagesAsync(ControlledHangMitigatingCancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Razor;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TextManager.Interop;
using Xunit;

namespace Microsoft.VisualStudio.Extensibility.Testing;

Expand All @@ -22,4 +25,16 @@ public async Task<string> GetActiveDocumentFileNameAsync(CancellationToken cance
var documentPath = (string)documentPathObj;
return Path.GetFileName(documentPath);
}

public async Task SetInsertSpacesAsync(CancellationToken cancellationToken)
{
var textManager = await GetRequiredGlobalServiceAsync<SVsTextManager, IVsTextManager4>(cancellationToken);

var langPrefs3 = new LANGPREFERENCES3[] { new LANGPREFERENCES3() { guidLang = RazorConstants.RazorLanguageServiceGuid } };
Assert.Equal(VSConstants.S_OK, textManager.GetUserPreferences4(null, langPrefs3, null));

langPrefs3[0].fInsertTabs = 0;

Assert.Equal(VSConstants.S_OK, textManager.SetUserPreferences4(null, langPrefs3, null));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@ private static void FeedbackLoggerInternal(string filePath, params string[] expe
var files = new List<string>();
foreach (var feedbackFileProvider in feedbackFileProviders)
{
files.AddRange(feedbackFileProvider.GetFiles());
try
{
files.AddRange(feedbackFileProvider.GetFiles());
}
catch
{
// If one of the providers has issues, we don't want it causing us to not be able to report our stuff properly
}
}

_ = CollectFeedbackItemsAsync(files, filePath, expectedFileParts);
Expand Down
Loading