Skip to content

Commit

Permalink
wave08 support (2017.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulex committed Mar 14, 2017
1 parent 5782eb1 commit 2b144f0
Show file tree
Hide file tree
Showing 12 changed files with 272 additions and 221 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -2,6 +2,7 @@
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio

*.obj
*.exe
*.pdb
Expand Down Expand Up @@ -29,3 +30,7 @@ _ReSharper*/
[Tt]est[Rr]esult*
packages/
doc/out.html

#other
.vs
.idea
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -12,8 +12,8 @@ How it's work:

How do I get it?
---
You can install directly into ReSharper 2016.3 via the Extension Manager in the
ReSharper menu. (2016.2, 2016.1, 10, 9.2, 9.0, 8.2, 8.2 support removed, but binary version still available in ReSharper gallery)
You can install directly into ReSharper 2017.1 via the Extension Manager in the
ReSharper menu. (2016.3, 2016.2, 2016.1, 10, 9.2, 9.0, 8.2, 8.2 support removed, but binary version still available in ReSharper gallery)

Predefined templates
---
Expand Down
124 changes: 79 additions & 45 deletions ZenSharp.Core/ZenSharp.Core.Tests/ExpandTestGenerator.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18449
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
Expand All @@ -19,70 +19,104 @@ public class TemplatesTests
#region Input of ltg
public string _content = @"// C# templates
// Sample file
space ::= "" ""
// Resharper macros
cursor ::= ""$END$""
cursorb ::= ""("" cursor "")""
// Resharper macros:
identifier ::= <name default=""$name$"" macros = ""complete()"">
// really bad working now
// suggType ::= <type default=""$type$"" text=""$type$"" macros = ""completeType()""> suggTypeFollower
//suggTypeFollower ::= """"=""_""
// Auto properties
property ::= accessProperty abstract space type space identifier propertyBody
abstract ::= "" abstract""=a | """"
propertyBody ::= ""{ get;"" lazyPrivateSpec "" set; }""
accessProperty ::= ""public""=p | private=_p | protected=P
lazyPrivateSpec ::= """"=""+"" | ""private ""
// Plain types
arraySpec ::= ""[]""=s | """"
type ::= compType | primType arraySpec
primType ::= string=s | byte=by | bool=b | double=d | int=i | ""System.Guid""=g
// Complex types
genericArg ::= ""<"" primType "">""
scgTypes ::= IList=l | IEnumerable=""~""
generic2Arg ::= ""<"" primType "", "" primType "">""
scg2Types ::= SortedList=sl | IDictionary=di
SCG ::= ""System.Collections.Generic""
compType ::= SCG ""."" scgTypes genericArg | SCG ""."" scg2Types generic2Arg
nunittest ::= ""[Test] public void Test"" identifier ""(){ "" cursor "" }""
identifier2 ::= <name2 default=""$name2$"" macros = ""complete()"">
//
// Types:
//
suggType ::= <type short=""t"" expand=""$type$"" macros = ""complete()"">
// Primive types:
maybeType ::= type | ""void""
type ::= generic | primType (""?""=""?"")? (""[]""=a)? | suggType
primType ::= string=s | byte=by | bool=b | ""System.DateTime""=dt | decimal=dc | double=d | int=i | uint=ui | ""System.Guid""=g | ""System.Uri""=u | ""System.Xml.Linq.XElement""=x |
object=o
taskType ::= ""System.Threading.Tasks.Task""
// Complex types:
generic1 ::= (SCG ""."" (""IList""=l | ""IEnumerable""=""~"")) ""<"" type "">""
generic2 ::= (SCG ""."" (""SortedList""=sl | ""IDictionary""=di)) ""<"" type "", "" type "">""
SCG ::= ""System.Collections.Generic""
generic ::= generic1 | generic2
access ::= (internal=i | public=p | private=_ | protected=P) space
// Auto properties:
property ::= access (""abstract ""=ap | ""static ""=P | ""virtual ""=vp | """"=p) type space identifier propertyBody cursor
propertyBody ::= ""{ get;"" propertySetAccessor "" set; }""
propertySetAccessor ::= ""protected ""=""+p"" | """"=""+"" | ""private ""
// Methods:
methodAttributes ::=
| ""[NUnit.Framework.SetUpAttribute]""=su
| ""[NUnit.Framework.TestFixtureSetUpAttribute]""=tfsu
| ""[NUnit.Framework.TestFixtureTearDownAttribute]""=tftd
| ""[NUnit.Framework.TearDownAttribute]""=td
| ""[NUnit.Framework.TestCaseAttribute]""=tc
| ""[NUnit.Framework.TestAttribute]""=t
method_async ::= (methodAttributes)? access ""async"" space (""virtual ""=vm | ""abstract ""=am | ""static ""=M | """"=m) (taskType ""<""=T type "">"" | taskType """"=T) space identifier methodArgs methodBody
method_generic ::= (methodAttributes)? access (""virtual ""=vm | ""abstract ""=am | ""static ""=M | """"=m) (type | ""void"") space identifier methodArgs methodBody
method ::= method_async | method_generic
methodBody ::= "" { "" cursor "" }""
methodArgs ::= ""("" ((""""="","" | """"=""("") arg)? "")""
arg ::= primType "" "" identifier2
// Consts:
const ::= access ""const ""=c primType space identifier ""= """""" identifier """""";""
// Fields:
field ::= access (""readonly ""=r)? type space identifier (""=""=""="" identifier2 "";"" | "";"")
// Classes:
classAtributes ::= (""[NUnit.Framework.TestFixtureAttribute]"" = tf)?
class ::= classAtributes access (""sealed ""=s)? (""class""=c | ""static class""=C) space classBody
classBody ::= identifier ("" : ""="":"" type)? ""{"" cursor ""}""
//Enums:
enum ::= access space ""enum""=e space identifier ""{"" cursor ""}""
scope ""InCSharpClass"" {
start ::= method | property | field | other
method ::= (private=_ | protected=pr | ""public"") space (""static ""=M | """"=m) (type | ""void"") space identifier methodArgs "" { "" cursor "" }""
methodArgs ::= ""("" cursor "")""
field ::= (""private""=f | ""private readonly""=F) space type space identifier "";""
start ::= method | property | field | const | other
other ::= """"=test nunittest
other ::=
| class
| """"=dbset ""public DBSet<"" identifier "" > "" identifier ""s {get; set; }""
}
scope ""InCSharpTypeAndNamespace"" {
start ::= class
start ::=
| class
| interface
| ""[NUnit.Framework.TestFixture] internal class ""=testf identifier ""{ "" ( nunittest | cursor) "" }""
| enum
class ::= (""internal class""=c | ""public class""=pc | ""private class""=_pc) space classBody
interface ::= ""internal interface""=i space classBody
classBody ::= identifier ""{"" cursor ""}""
interface ::= access ""interface""=i space classBody
}
scope ""InCSharpInterface"" {
accessProperty ::= "" ""=p
propertyBody ::= ""{get; }"" cursor
start ::=
| type space identifier propertyBody cursor
| method
| property
| "" ""=m type space identifier methodArgs
propertyBody ::= ""{ get; }"" | ""{ get; set; }""=""+""
access ::= """"
methodBody ::= "";""
}
scope ""InCSharpStatement"" {
scope ""InCSharpStruct"" {
// start ::= """"
}
scope ""InCSharpStatement"" {
start ::=
| ""if (""=ifr identifier "" == null) return;""
| ""Log.""=l (Fatal=f | Info=i | Error=e | Trace=t | Debug=d) ""("""""" cursor """""");""
}
";
#endregion Input of ltg
private GenerateTree _tree;
Expand Down
24 changes: 1 addition & 23 deletions ZenSharp.Core/ZenSharp.Core.Tests/GetContextTests.cs
@@ -1,23 +1 @@
using System;

using Github.Ulex.ZenSharp.Core;

using NUnit.Framework;

namespace ZenSharp.Core.Tests
{
[TestFixture]
internal sealed class GetContextTests
{
string _testFile = new TemplatesTests()._content;

[Test]
public void TestGetContextForAnyPosition()
{
for (int i = 0; i < _testFile.Length + 4; i++)
{
Console.WriteLine(ErrorContextLocator.GetContext(_testFile, i));
}
}
}
}
using System;using Github.Ulex.ZenSharp.Core;using NUnit.Framework;namespace ZenSharp.Core.Tests{ [TestFixture] internal sealed class GetContextTests { string _testFile = new TemplatesTests()._content; [Test] public void TestGetContextForAnyPosition() { for (int i = 0; i < _testFile.Length + 4; i++) { Console.WriteLine(ErrorContextLocator.GetContext(_testFile, i)); } } }}
Expand Down
5 changes: 4 additions & 1 deletion ZenSharp.Core/ZenSharp.Core.Tests/ZenSharp.Core.Tests.csproj
Expand Up @@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ZenSharp.Core.Tests</RootNamespace>
<AssemblyName>ZenSharp.Core.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -20,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -28,6 +30,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Nemerle" />
Expand Down
2 changes: 1 addition & 1 deletion ZenSharp.Integration/CSharpExtendedScopeProvider.cs
Expand Up @@ -156,4 +156,4 @@ private static bool TestNode<T>(CSharpReparseContext context, string text, bool
return true;
}
}
}
}
7 changes: 3 additions & 4 deletions ZenSharp.Integration/EditConfigActionHandler.cs
Expand Up @@ -2,13 +2,12 @@
using JetBrains.Application.DataContext;
using JetBrains.Application.Settings;
using JetBrains.IDE;
using JetBrains.ProjectModel.DataContext;
using JetBrains.ReSharper.Resources.Shell;
using JetBrains.UI.ActionsRevised;
using JetBrains.UI.MenuGroups;
using JetBrains.Util;

using DataConstants = JetBrains.ProjectModel.DataContext.DataConstants;

namespace Github.Ulex.ZenSharp.Integration
{
[ActionGroup(ActionGroupInsertStyles.Embedded)]
Expand All @@ -24,7 +23,7 @@ public class EditConfigActionHandler : IExecutableAction
{
public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate)
{
var solution = context.GetData(DataConstants.SOLUTION);
var solution = context.GetData(ProjectModelDataConstants.SOLUTION);
return solution != null;
}

Expand All @@ -34,7 +33,7 @@ public void Execute(IDataContext context, DelegateExecute nextExecute)
var ctx = store.BindToContextTransient(ContextRange.ApplicationWide);
var settings = ctx.GetKey<ZenSharpSettings>(SettingsOptimization.DoMeSlowly);

var solution = context.GetData(DataConstants.SOLUTION);
var solution = context.GetData(ProjectModelDataConstants.SOLUTION);
EditorManager.GetInstance(solution)
.OpenFile(
FileSystemPath.CreateByCanonicalPath(ZenSharpSettings.GetTreePath(settings.TreeFilename)),
Expand Down

0 comments on commit 2b144f0

Please sign in to comment.