forked from MarkBorcherding/AgentBdd
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29bc212
commit 3082d98
Showing
6 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,20 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 11.00 | ||
# Visual Studio 2010 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgentBdd", "AgentBdd\AgentBdd.csproj", "{001D4902-AFDE-496F-AFE7-F97A1375D720}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{001D4902-AFDE-496F-AFE7-F97A1375D720}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{001D4902-AFDE-496F-AFE7-F97A1375D720}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{001D4902-AFDE-496F-AFE7-F97A1375D720}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{001D4902-AFDE-496F-AFE7-F97A1375D720}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains 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,74 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{001D4902-AFDE-496F-AFE7-F97A1375D720}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>AgentBdd</RootNamespace> | ||
<AssemblyName>AgentBdd</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="JetBrains.Platform.ReSharper.Shell"> | ||
<HintPath>C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\JetBrains.Platform.ReSharper.Shell.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="JetBrains.Platform.ReSharper.TextControl"> | ||
<HintPath>C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\JetBrains.Platform.ReSharper.TextControl.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="JetBrains.Platform.ReSharper.UI"> | ||
<HintPath>C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\JetBrains.Platform.ReSharper.UI.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="JetBrains.Platform.ReSharper.Util"> | ||
<HintPath>C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\JetBrains.Platform.ReSharper.Util.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="JetBrains.ReSharper.Feature.Services"> | ||
<HintPath>C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\JetBrains.ReSharper.Feature.Services.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Macros\BasicMacro.cs" /> | ||
<Compile Include="Macros\SuggestMethodNameFromVariable.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains 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,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using JetBrains.ReSharper.Feature.Services.LiveTemplates.Hotspots; | ||
using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros; | ||
|
||
namespace AgentBdd.Macros | ||
{ | ||
public abstract class BasicMacro : IMacro | ||
{ | ||
|
||
public string GetPlaceholder() | ||
{ | ||
return "a"; | ||
} | ||
|
||
public bool HandleExpansion(IHotspotContext context, IList<string> arguments) | ||
{ | ||
return false; | ||
} | ||
|
||
public HotspotItems GetLookupItems(IHotspotContext context, IList<string> arguments) | ||
{ | ||
return null; | ||
} | ||
|
||
public abstract string EvaluateQuickResult(IHotspotContext context, IList<string> arguments); | ||
|
||
|
||
public abstract ParameterInfo[] Parameters { get; } | ||
|
||
} | ||
} |
This file contains 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,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using JetBrains.ReSharper.Feature.Services.LiveTemplates.Hotspots; | ||
using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros; | ||
|
||
namespace AgentBdd.Macros | ||
{ | ||
[Macro("suggestMethodName", | ||
ShortDescription = "Suggest a method name for {#0:another variable}", | ||
LongDescription = "Suggest a new method name for the given variable")] | ||
public class SuggestMethodNameFromVariable : BasicMacro | ||
{ | ||
|
||
public override string EvaluateQuickResult(IHotspotContext context, IList<string> arguments) | ||
{ | ||
if (arguments.Count != 1){ | ||
return null; | ||
} | ||
|
||
try | ||
{ | ||
|
||
// Todo: do this better and maybe move to offer the space and camel case version | ||
var result = arguments[0] | ||
.Replace(' ','_') | ||
.Replace(",","") | ||
.Replace("\"","") | ||
.Replace("'",""); | ||
|
||
return result; | ||
} | ||
catch (Exception e) | ||
{ | ||
return "<" + e.Message + ">"; | ||
} | ||
} | ||
|
||
public override ParameterInfo[] Parameters | ||
{ | ||
get { return new[] { new ParameterInfo(ParameterType.VariableReference) }; } | ||
} | ||
} | ||
|
||
} |
This file contains 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,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("AgentBdd")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("AgentBdd")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("738dbab7-8314-4e24-89dc-f6df0e17b655")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains 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,20 @@ | ||
require 'rake' | ||
require 'FileUtils' | ||
|
||
PLUGIN_DIR = File.join( ENV['PROGRAMFILES'], 'JetBrains', 'ReSharper', 'v5.1', 'Bin', 'Plugins','AgentBdd') | ||
BIN_DIR = File.join('.','AgentBdd','bin','debug','.') | ||
|
||
|
||
task :default => [:ensure_directory, :compile, :deploy] | ||
|
||
task :ensure_directory do | ||
mkdir PLUGIN_DIR unless File.exist? PLUGIN_DIR | ||
end | ||
|
||
task :compile do | ||
`msbuild` | ||
end | ||
|
||
task :deploy do | ||
cp_r BIN_DIR, PLUGIN_DIR, :remove_destination => true | ||
end |