Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

foo

  • Loading branch information...
commit 3e89a1f8c3c2740ffbd70d99066e457f87fb681c 1 parent 1d84208
@nesteruk nesteruk authored
View
4 src/fsharper/Services.FSharp/src/Analyses/Bulbs/FSharpContextActionDataBuilder.cs
@@ -23,9 +23,7 @@ public IContextActionDataProvider Build(ISolution solution, ITextControl textCon
if (psiFile == null || !psiFile.IsValid() || !psiFile.Language.Is<FSharpLanguage>())
return null;
- // todo
- //return new FSharpContextActionDataProvider(solution, textControl, psiFile);
- return null;
+ return new FSharpContextActionDataProvider(solution, textControl, psiFile);
}
}
}
View
20 src/fsharper/Services.FSharp/src/Analyses/Bulbs/FSharpContextActionDataProvider.cs
@@ -1,28 +1,20 @@
+using JetBrains.ReSharper.Feature.Services.Bulbs;
+
namespace JetBrains.ReSharper.Feature.Services.FSharp
{
- using System;
using ProjectModel;
- using ReSharper.Psi;
using ReSharper.Psi.FSharp;
using ReSharper.Psi.FSharp.Tree;
using TextControl;
- public class FSharpContextActionDataProvider : /* CachedContextActionDataProvider<IFSharpFile>, */ IFSharpContextActionDataProvider
+ public class FSharpContextActionDataProvider : CachedContextActionDataProviderBase<IFSharpFile>, IFSharpContextActionDataProvider
{
- public FSharpContextActionDataProvider(ISolution solution, ITextControl textControl, IFSharpFile psiFile)
+ public FSharpContextActionDataProvider(ISolution solution, ITextControl textControl, IFSharpFile file)
+ : base(solution, textControl, file)
{
- // todo
+
}
public FSharpElementFactory ElementFactory { get { return FSharpElementFactory.GetInstance(PsiModule); } }
-
- public IPsiModule PsiModule
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
}
}
View
41 src/fsharper/Tests/FSharpParserTest.cs
@@ -0,0 +1,41 @@
+using JetBrains.ReSharper.Psi.CSharp;
+using JetBrains.ReSharper.Psi.ExtensionsAPI;
+using JetBrains.ReSharper.Psi.FSharp;
+using JetBrains.ReSharper.Psi.Parsing;
+using JetBrains.ReSharper.TestFramework;
+using NUnit.Framework;
+
+
+namespace Tests
+{
+ [TestFixture, Category("F# Parser")]
+ public class FSharpParserTest : BaseTestWithSingleProject
+ {
+ private string filename;
+
+ protected override string RelativeTestDataPath
+ {
+ get { return @"parsing\fsharp"; }
+ }
+
+ protected override void DoOneTest(string filename)
+ {
+ this.filename = filename;
+ DoTestSolution(filename);
+ }
+
+ protected override void DoTest(JetBrains.ProjectModel.IProject project)
+ {
+ var sourceFile = ParserService.ParseFileDebug(GetTestDataFilePath2(filename + Extension),
+ FSharpLanguage.Instance, Solution.PsiModules().GetPrimaryPsiModule(project));
+
+ ExecuteWithGold(filename, sw =>
+ {
+ if (sourceFile != null && !DebugUtil.HasErrorElements(sourceFile))
+ sw.WriteLine("SUCCESS");
+ else
+ sw.WriteLine("FAILURE");
+ });
+ }
+ }
+}
View
1  src/fsharper/Tests/Tests.csproj
@@ -46,6 +46,7 @@
<ItemGroup>
<Compile Include="FSharpLexerTest.cs" />
<Compile Include="FSharpLexerTestBase.cs" />
+ <None Include="FSharpParserTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Please sign in to comment.
Something went wrong with that request. Please try again.