Skip to content
Open
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
2 changes: 1 addition & 1 deletion Spring/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
</PropertyGroup>

<Import Project="RiderSdkPackageVersion.props" />
</Project>
</Project>
12 changes: 6 additions & 6 deletions Spring/Spring.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spring", "src\Spring\Spring.csproj", "{5BCAF64C-21D1-489C-ABAE-09011134F2A6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpringTests", "test\src\SpringTests\SpringTests.csproj", "{465BE399-F1C5-4B6C-A77A-79390C45F8DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring", "src\Spring\Spring.csproj", "{DD8EF49C-21F7-4527-94F2-B87C5E9FB0C3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5BCAF64C-21D1-489C-ABAE-09011134F2A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BCAF64C-21D1-489C-ABAE-09011134F2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BCAF64C-21D1-489C-ABAE-09011134F2A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5BCAF64C-21D1-489C-ABAE-09011134F2A6}.Release|Any CPU.Build.0 = Release|Any CPU
{465BE399-F1C5-4B6C-A77A-79390C45F8DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{465BE399-F1C5-4B6C-A77A-79390C45F8DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{465BE399-F1C5-4B6C-A77A-79390C45F8DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{465BE399-F1C5-4B6C-A77A-79390C45F8DB}.Release|Any CPU.Build.0 = Release|Any CPU
{DD8EF49C-21F7-4527-94F2-B87C5E9FB0C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD8EF49C-21F7-4527-94F2-B87C5E9FB0C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD8EF49C-21F7-4527-94F2-B87C5E9FB0C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD8EF49C-21F7-4527-94F2-B87C5E9FB0C3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 3 additions & 1 deletion Spring/src/Spring/Spring.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
<RootNamespace>JetBrains.ReSharper.Plugins.Spring</RootNamespace>
<AssemblyName>JetBrains.ReSharper.Plugins.Spring</AssemblyName>
<JetTestProject>True</JetTestProject>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Rider.SDK" Version="$(RiderSDKVersion)" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<PackageReference Include="Microsoft.Win32.SystemEvents" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="$(ValueTupleVersion)" />
<PackageReference Include="NUnit.Console" Version="3.10.0" />
<CsLex Include="src/Sample.lex" />
</ItemGroup>
<Import Project="$(DotNetSdkPath)\Build\SubplatformReference.Psi.Features_test_Framework.Props" Condition="Exists('$(DotNetSdkPath)\Build\SubplatformReference.Psi.Features_test_Framework.Props')" />
</Project>
50 changes: 50 additions & 0 deletions Spring/src/Spring/src/CustomMarker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using JetBrains.ReSharper.Psi.ExtensionsAPI.Tree;
using JetBrains.ReSharper.Psi.TreeBuilder;

namespace JetBrains.ReSharper.Plugins.Spring
{
public struct Marker
{
public const int InvalidPointer = -1;
public readonly MarkerType Type;
public NodeType ElementType;
public int FirstChild;
public int LastChild;
public int LexemeIndex;
public int NextMarker;
public int OppositeMarker;
public int ParentMarker;
public object UserData;

public Marker(MarkerType type, int lexemeIndex)
{
Type = type;
LexemeIndex = lexemeIndex;
OppositeMarker = -1;
FirstChild = -1;
LastChild = -1;
ParentMarker = 0;
NextMarker = 0;
ElementType = null;
UserData = null;
}

public static void AddChild(TreeBuilder builder, int node, int child)
{
var marker1 = builder.MyProduction[node];
if (marker1.FirstChild == -1)
{
marker1.FirstChild = child;
marker1.LastChild = child;
}
else
{
var marker2 = builder.MyProduction[marker1.LastChild];
marker2.NextMarker = child;
builder.MyProduction[marker1.LastChild] = marker2;
marker1.LastChild = child;
}
builder.MyProduction[node] = marker1;
}
}
}
Loading