Skip to content

Commit

Permalink
Recompiled with R# SDK 2022.1.0 (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayphi authored Apr 28, 2022
1 parent e7a65dd commit d15dcdf
Show file tree
Hide file tree
Showing 13 changed files with 1,089 additions and 976 deletions.
3 changes: 2 additions & 1 deletion Project/Src/InstallSupport/TestCop.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<id>Resharper.TestCop.R9</id>
<version>0.0.0-internal</version>

<title>TestCop for ReSharper 2021.3</title>
<title>TestCop for ReSharper 2022.1</title>
<authors>Alcaeus</authors>
<description>Easily switch between unit tests and code. Create missing associated files. Includes highlightings and test templates to keep test projects neat and tidy. Works with NUnit, MSTest, xUnit ...</description>
<releaseNotes>
1.10.16.0 Recompiled with R# SDK 2022.1.0
1.10.15.7 Fixed focus issue when logging output
1.10.15.6 Recompiled with R# SDK 2021.3.1
1.10.15.5-EAP Recompiled with R# SDK 2021.3.0-eap07 and applied api changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using JetBrains.TextControl;
using JetBrains.TextControl.DataContext;
using JetBrains.Util;

using NUnit.Framework;
using TestCop.Plugin.Extensions;

Expand Down Expand Up @@ -223,7 +224,8 @@ protected virtual IExecutableAction GetShortcutAction(TextWriter textwriter)

protected ITextControl OpenTextControl(IProjectFile projectFile, int? caretOffset = null)
{
Task<ITextControl> openProjectFileAsync = EditorManager.GetInstance(projectFile.GetSolution()).OpenProjectFileAsync(projectFile, new OpenFileOptions(true));
IEditorManager editorManager = projectFile.GetSolution().GetComponent<IEditorManager>();
Task<ITextControl> openProjectFileAsync = editorManager.OpenProjectFileAsync(projectFile, new OpenFileOptions(true));
openProjectFileAsync.Wait();
return openProjectFileAsync.Result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private static IDeclaredElement FindTypeInFile(ISolution solution, string testFi
throw new Exception("Whilst configuring test I didn't find project item: "+testFile);
}

var document = DocumentManager.GetInstance(solution).GetOrCreateDocument(projectFile);
DocumentManager documentManager = solution.GetComponent<DocumentManager>();
var document = documentManager.GetOrCreateDocument(projectFile);
var findFirstTypeInFile = ResharperHelper.FindDeclaredElementInFile(solution, document, typeSequenceInFile);
return findFirstTypeInFile;
}
Expand Down
752 changes: 387 additions & 365 deletions Project/Src/TestCop.Plugin.Tests/TestCop.Plugin.Tests.csproj

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions Project/Src/TestCop.Plugin.Tests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@
<assemblyIdentity name="Microsoft.VisualStudio.TestPlatform.ObjectModel" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-42.42.42.42" newVersion="42.42.42.42" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.Workspaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-42.42.42.42" newVersion="42.42.42.42" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-42.42.42.42" newVersion="42.42.42.42" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
253 changes: 134 additions & 119 deletions Project/Src/TestCop.Plugin.Tests/packages.config

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions Project/Src/TestCop.Plugin/Helper/JumpToTestMenuHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

namespace TestCop.Plugin.Helper
{
using JetBrains.Util.Media;

public static class JumpToTestMenuHelper
{
//------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -75,13 +77,16 @@ public static void PromptToOpenOrCreateClassFiles(Action<JetPopupMenus, JetPopup
private static void AppendNavigateToMenuItems(Lifetime lifetime, ISolution solution, List<IClrDeclaredElement> clrDeclaredElements,
List<SimpleMenuItem> menuItems)
{
IEditorManager editorManager = solution.GetComponent<IEditorManager>();
DocumentManager documentManager = solution.GetComponent<DocumentManager>();

foreach (var declaredElement in clrDeclaredElements)
{
var simpleMenuItems = DescribeFilesAssociatedWithDeclaredElement(lifetime, DocumentManager.GetInstance(solution),
var simpleMenuItems = DescribeFilesAssociatedWithDeclaredElement(lifetime, documentManager,
declaredElement
,
p => async () =>
await EditorManager.GetInstance(solution).OpenProjectFileAsync(p, new OpenFileOptions(true)).ConfigureAwait(false)
await editorManager.OpenProjectFileAsync(p, new OpenFileOptions(true)).ConfigureAwait(false)
);
menuItems.AddRange(simpleMenuItems);
}
Expand Down Expand Up @@ -229,12 +234,12 @@ private static List<SimpleMenuItem> AddCreateFileMenuItem(Lifetime lifetime, Tes
{
Style = MenuItemStyle.Enabled,
Icon = UnnamedThemedIcons.Agent16x16.Id,
Text = new RichText("Create ", TextStyle.FromForeColor(Color.Green))
Text = new RichText("Create ", TextStyle.FromForeColor(JetRgbaColor.FromArgb(Color.Green.A, Color.Green.R, Color.Green.G, Color.Green.B)))
.Append(targetFile, TextStyle.FromForeColor(TextStyle.DefaultForegroundColor)),
ShortcutText = new RichText("(" + projectItem.Project.GetPresentableProjectPath()
+ projectItem.SubNamespaceFolder.FullPath.RemoveLeading(projectItem.Project.ProjectFileLocation.Directory.FullPath)
+ ")",
TextStyle.FromForeColor(Color.LightGray))
TextStyle.FromForeColor(JetRgbaColor.FromArgb(Color.LightGray.A, Color.LightGray.R, Color.LightGray.G, Color.LightGray.B)))
};
menuItems.Add(result);
return menuItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void CheckForProjectFilesNotInProjectAndWarn(ITreeNode element)

var currentProject = element.GetProject();
ICollection<VirtualFileSystemPath> directoriesToSkip = currentProject.GetOutputDirectories();
directoriesToSkip.AddAll(currentProject.GetIntermidiateDirectories());
directoriesToSkip.AddAll(currentProject.GetIntermediateDirectories());

var allProjectFileLocations = currentProject.GetAllProjectFiles().Select(p => p.Location).ToList();
var allProjectFiles = allProjectFileLocations.Select(loc => loc.FullPath).ToList();
Expand Down
4 changes: 2 additions & 2 deletions Project/Src/TestCop.Plugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.10.15.7")]
[assembly: AssemblyFileVersion("1.10.15.7")]
[assembly: AssemblyVersion("1.10.16.0")]
[assembly: AssemblyFileVersion("1.10.16.0")]

4 changes: 3 additions & 1 deletion Project/Src/TestCop.Plugin/RenameTestFilesTooRefactoring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ public IEnumerable<FileRename> GetFileRenames(IDeclaredElement declaredElement,
continue;
}

IEditorManager editorManager = solution.GetComponent<IEditorManager>();

//TODO EditorManager.GetInstance(solution).OpenProjectFile(projectFileMatch.ProjectFile, new OpenFileOptions(false));
EditorManager.GetInstance(solution).OpenProjectFileAsync(projectFileMatch.ProjectFile, new OpenFileOptions(false));
editorManager.OpenProjectFileAsync(projectFileMatch.ProjectFile, new OpenFileOptions(false));
//need to ensure class within file is renamed tooo
yield return
new FileRename(psiModule.GetPsiServices(), projectFileMatch.ProjectFile, newTestClassName);
Expand Down
Loading

0 comments on commit d15dcdf

Please sign in to comment.