diff options
author | Mike Krüger <mkrueger@novell.com> | 2011-06-17 16:32:26 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2011-06-17 17:04:23 +0400 |
commit | e08728d8c6be8d20d7aee5179ca4bdf0a16a0cb2 (patch) | |
tree | c2f03df720d7638c7b2b1c92587dceece8230384 /main/src/addins/NUnit | |
parent | 38d81de01fa7ce9c670921738086255895dc6c14 (diff) |
Converted type system.
Diffstat (limited to 'main/src/addins/NUnit')
-rw-r--r-- | main/src/addins/NUnit/Makefile.am | 1 | ||||
-rw-r--r-- | main/src/addins/NUnit/MonoDevelop.NUnit.csproj | 4 | ||||
-rw-r--r-- | main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs | 23 |
3 files changed, 21 insertions, 7 deletions
diff --git a/main/src/addins/NUnit/Makefile.am b/main/src/addins/NUnit/Makefile.am index a68a08ea78..029caf68c4 100644 --- a/main/src/addins/NUnit/Makefile.am +++ b/main/src/addins/NUnit/Makefile.am @@ -5,6 +5,7 @@ ASSEMBLY = $(ADDIN_BUILD)/MonoDevelop.NUnit.dll DEPS = \ $(top_builddir)/build/AddIns/NUnit/NUnitRunner.dll \ + $(top_builddir)/build/bin/ICSharpCode.NRefactory.dll \ $(top_builddir)/build/bin/MonoDevelop.Core.dll \ $(top_builddir)/build/bin/MonoDevelop.Ide.dll diff --git a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj index 7ee13dd320..3b388dbf93 100644 --- a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj +++ b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj @@ -90,6 +90,10 @@ <Name>NUnitRunner</Name> <Private>False</Private> </ProjectReference> + <ProjectReference Include="..\..\..\contrib\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj"> + <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project> + <Name>ICSharpCode.NRefactory</Name> + </ProjectReference> </ItemGroup> <ItemGroup> <EmbeddedResource Include="templates\NUnitAssemblyGroup.xpt.xml"> diff --git a/main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs b/main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs index 5ddaa52773..a257d61efd 100644 --- a/main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs +++ b/main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs @@ -31,9 +31,9 @@ using System.IO; using System.Collections.Generic; using MonoDevelop.Projects; -using MonoDevelop.Projects.Dom; -using MonoDevelop.Projects.Dom.Parser; using MonoDevelop.Ide; +using MonoDevelop.TypeSystem; +using System; namespace MonoDevelop.NUnit { @@ -63,16 +63,25 @@ namespace MonoDevelop.NUnit protected override SourceCodeLocation GetSourceCodeLocation (string fullClassName, string methodName) { - ProjectDom ctx = ProjectDomService.GetProjectDom (project); - IType cls = ctx.GetType (fullClassName); + var ctx = TypeSystemService.GetProjectContext (project); + string ns, name; + int idx = fullClassName.LastIndexOf ('.'); + if (idx < 0) { + ns = ""; + name = fullClassName; + } else { + ns = fullClassName.Substring (0, idx); + name = fullClassName.Substring (idx + 1); + } + var cls = ctx.GetClass (ns, name, 0, StringComparer.Ordinal); if (cls == null) return null; - foreach (IMethod met in cls.Methods) { + foreach (var met in cls.GetMethods (ctx)) { if (met.Name == methodName) - return new SourceCodeLocation (cls.CompilationUnit.FileName, met.Location.Line, met.Location.Column); + return new SourceCodeLocation (cls.GetDefinition ().Region.FileName, met.Region.BeginLine, met.Region.BeginColumn); } - return new SourceCodeLocation (cls.CompilationUnit.FileName, cls.Location.Line, cls.Location.Column); + return new SourceCodeLocation (cls.GetDefinition ().Region.FileName, cls.Region.BeginLine, cls.Region.BeginColumn); } public override void Dispose () |