Browse Source

moved Ambience to NRefactory

newNRvisualizers
Siegfried Pammer 14 years ago
parent
commit
1cf7ecb3f1
  1. 23
      SharpDevelop.sln
  2. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs
  3. 1
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj
  4. 26
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs
  5. 25
      src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpAmbienceTests.cs
  6. 1
      src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj
  7. 1
      src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj
  8. 23
      src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAmbience.cs
  9. 7
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  10. 2
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  11. 3
      src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs
  12. 49
      src/Main/Base/Project/Src/Services/AmbienceService/DefaultAmbience.cs
  13. 1
      src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj

23
SharpDevelop.sln

@ -48,8 +48,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartUp", "src\Main\StartUp @@ -48,8 +48,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartUp", "src\Main\StartUp
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} = {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Tests", "src\Main\Base\Test\ICSharpCode.SharpDevelop.Tests.csproj", "{4980B743-B32F-4aba-AABD-45E2CAD3568D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Tests", "src\Main\Core\Test\ICSharpCode.Core.Tests.csproj", "{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{2A232EF1-EB95-41C6-B63A-C106E0C95D3C}"
@ -325,26 +323,6 @@ Global @@ -325,26 +323,6 @@ Global
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|x86.ActiveCfg = Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|Debug.Build.0 = Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|Debug.ActiveCfg = Release|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Win32.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Win32.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|x86.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|x86.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Debug.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Debug.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Any CPU.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Win32.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Win32.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|x86.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|x86.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Debug.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Debug.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4ABA-AABD-45E2CAD3568D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4980B743-B32F-4ABA-AABD-45E2CAD3568D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4ABA-AABD-45E2CAD3568D}.Release|Any CPU.Build.0 = Release|Any CPU
{4980B743-B32F-4ABA-AABD-45E2CAD3568D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}.Debug|Win32.Build.0 = Debug|Any CPU
@ -375,7 +353,6 @@ Global @@ -375,7 +353,6 @@ Global
{2748AD25-9C63-4E12-877B-4DCE96FBED54} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{8035765F-D51F-4A0C-A746-2FD100E19419} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{1152B71B-3C05-4598-B20D-823B5D40559E} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{4980B743-B32F-4aba-AABD-45E2CAD3568D} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5} = {256F5C28-532C-44C0-8AB8-D8EC5E492E01}
{D68133BD-1E63-496E-9EDE-4FBDBF77B486} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}
{E5A0F4D8-37FD-4A30-BEB0-4409DC4E0865} = {2A232EF1-EB95-41C6-B63A-C106E0C95D3C}

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs

@ -7,6 +7,8 @@ using System.ComponentModel; @@ -7,6 +7,8 @@ using System.ComponentModel;
using System.IO;
using System.Linq;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;

1
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj

@ -169,6 +169,7 @@ @@ -169,6 +169,7 @@
<Compile Include="Formatter\CSharpFormattingOptions.cs" />
<Compile Include="Formatter\Indent.cs" />
<Compile Include="Formatter\ITextEditorAdapter.cs" />
<Compile Include="OutputVisitor\CSharpAmbience.cs" />
<Compile Include="OutputVisitor\InsertParenthesesVisitor.cs" />
<Compile Include="OutputVisitor\IOutputFormatter.cs" />
<Compile Include="OutputVisitor\OutputVisitor.cs" />

26
src/Main/Base/Project/Src/Services/AmbienceService/CSharpAmbience.cs → src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs

@ -1,18 +1,28 @@ @@ -1,18 +1,28 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
using ICSharpCode.SharpDevelop.Parser;
namespace ICSharpCode.SharpDevelop
namespace ICSharpCode.NRefactory.CSharp
{
/// <summary>
/// C# ambience.

25
src/Main/Base/Test/CSharpAmbienceTests.cs → src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpAmbienceTests.cs

@ -1,16 +1,29 @@ @@ -1,16 +1,29 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
using ICSharpCode.SharpDevelop.Parser;
using NUnit.Framework;
namespace ICSharpCode.SharpDevelop.Tests
namespace ICSharpCode.NRefactory.CSharp
{
[TestFixture]
public class CSharpAmbienceTests
@ -23,7 +36,7 @@ namespace ICSharpCode.SharpDevelop.Tests @@ -23,7 +36,7 @@ namespace ICSharpCode.SharpDevelop.Tests
public CSharpAmbienceTests()
{
ambience = new CSharpAmbience();
mscorlib = AssemblyParserService.GetAssembly(FileName.Create(typeof(object).Assembly.Location));
mscorlib = CecilLoaderTests.Mscorlib;
var loader = new CecilLoader();
loader.IncludeInternalMembers = true;
myLib = loader.LoadAssemblyFile(typeof(CSharpAmbienceTests).Assembly.Location);

1
src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj

@ -78,6 +78,7 @@ @@ -78,6 +78,7 @@
<ItemGroup>
<Compile Include="CSharp\Analysis\DefiniteAssignmentTests.cs" />
<Compile Include="CSharp\AstStructureTests.cs" />
<Compile Include="CSharp\CSharpAmbienceTests.cs" />
<Compile Include="CSharp\InsertParenthesesVisitorTests.cs" />
<Compile Include="CSharp\OutputVisitorTests.cs" />
<Compile Include="CSharp\Parser\Expression\AnonymousTypeCreateExpressionTests.cs" />

1
src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj

@ -103,6 +103,7 @@ @@ -103,6 +103,7 @@
<Compile Include="TypeSystem\EntityType.cs" />
<Compile Include="TypeSystem\ExtensionMethods.cs" />
<Compile Include="TypeSystem\IAccessor.cs" />
<Compile Include="TypeSystem\IAmbience.cs" />
<Compile Include="TypeSystem\IAttribute.cs" />
<Compile Include="TypeSystem\IConstantValue.cs" />
<Compile Include="TypeSystem\IDocumentationProvider.cs" />

23
src/Main/Base/Project/Src/Services/AmbienceService/IAmbience.cs → src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAmbience.cs

@ -1,10 +1,24 @@ @@ -1,10 +1,24 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.SharpDevelop
namespace ICSharpCode.NRefactory.TypeSystem
{
[Flags]
public enum ConversionFlags
@ -76,6 +90,5 @@ namespace ICSharpCode.SharpDevelop @@ -76,6 +90,5 @@ namespace ICSharpCode.SharpDevelop
string WrapAttribute(string attribute);
string WrapComment(string comment);
}
}

7
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -301,8 +301,7 @@ @@ -301,8 +301,7 @@
<Compile Include="Src\Project\ProjectPropertyChangedEventArgs.cs" />
<Compile Include="Src\Project\Solution\Project_TypeGuids.cs" />
<Compile Include="Src\Project\TargetFramework.cs" />
<Compile Include="Src\Services\AmbienceService\CSharpAmbience.cs" />
<Compile Include="Src\Services\AmbienceService\IAmbience.cs" />
<Compile Include="Src\Services\AmbienceService\DefaultAmbience.cs" />
<Compile Include="Src\Services\Debugger\BreakpointBookmark.cs" />
<Compile Include="Src\Services\Debugger\BreakpointBookmarkEventArgs.cs" />
<Compile Include="Src\Services\Debugger\DecompiledBreakpointBookmark.cs" />
@ -807,10 +806,6 @@ @@ -807,10 +806,6 @@
<Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
<Name>Mono.Cecil</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
<Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
<Name>ICSharpCode.NRefactory.CSharp</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
<Name>ICSharpCode.NRefactory</Name>

2
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -638,7 +638,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -638,7 +638,7 @@ namespace ICSharpCode.SharpDevelop.Project
public virtual IAmbience GetAmbience()
{
return new CSharpAmbience();
return new DefaultAmbience();
}
public virtual Refactoring.ISymbolSearch PrepareSymbolSearch(IEntity entity)

3
src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop
@ -70,7 +71,7 @@ namespace ICSharpCode.SharpDevelop @@ -70,7 +71,7 @@ namespace ICSharpCode.SharpDevelop
if (ambience == null && Gui.WorkbenchSingleton.MainWin32Window != null) {
MessageService.ShowError("${res:ICSharpCode.SharpDevelop.Services.AmbienceService.AmbienceNotFoundError}");
}
return ambience ?? new CSharpAmbience();
return ambience ?? new DefaultAmbience();
}
public static string DefaultAmbienceName {

49
src/Main/Base/Project/Src/Services/AmbienceService/DefaultAmbience.cs

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop
{
/// <summary>
/// Description of DefaultAmbience.
/// </summary>
internal class DefaultAmbience : IAmbience
{
public ConversionFlags ConversionFlags { get; set; }
public string ConvertEntity(ICSharpCode.NRefactory.TypeSystem.IEntity e, ICSharpCode.NRefactory.TypeSystem.ITypeResolveContext context)
{
return e.Name;
}
public string ConvertType(ICSharpCode.NRefactory.TypeSystem.IType type)
{
return type.Name;
}
public string ConvertType(ICSharpCode.NRefactory.TypeSystem.ITypeReference type, ICSharpCode.NRefactory.TypeSystem.ITypeResolveContext context)
{
return type.Resolve(context).Name;
}
public string ConvertVariable(ICSharpCode.NRefactory.TypeSystem.IVariable variable, ICSharpCode.NRefactory.TypeSystem.ITypeResolveContext context)
{
return variable.Name;
}
public string WrapAttribute(string attribute)
{
return attribute;
}
public string WrapComment(string comment)
{
return "// " + comment;
}
}
}

1
src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj

@ -67,7 +67,6 @@ @@ -67,7 +67,6 @@
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CheckAssemblyFlags.cs" />
<Compile Include="CodeConverterTests.cs" />
<Compile Include="CSharpAmbienceTests.cs" />
<Compile Include="ExceptionClassOverridesTestFixture.cs" />
<Compile Include="GenerateOverrideMethodTests.cs" />
<Compile Include="GetElementByReflectionNameTests.cs" />

Loading…
Cancel
Save