Browse Source

Added "comment region" for C++.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5190 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 16 years ago
parent
commit
fd15c48515
  1. 11
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.addin
  2. 4
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj
  3. 27
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppFormattingStrategy.cs
  4. 45
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppLanguageBinding.cs
  5. 39
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppProjectBinding.cs
  6. 4
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/CppProject.cs

11
src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.addin

@ -71,15 +71,22 @@
<Path name="/SharpDevelop/Workbench/ProjectBindings"> <Path name="/SharpDevelop/Workbench/ProjectBindings">
<ProjectBinding id="C++" <ProjectBinding id="C++"
guid="{0E96FCFA-9DAC-4534-AC18-01A90C368873}" guid="{0E96FCFA-9DAC-4534-AC18-01A90C368873}"
supportedextensions=".cpp;*.c;*.hpp;*.c" supportedextensions=".cpp;.c;.hpp;.h"
projectfileextension=".vcxproj" projectfileextension=".vcxproj"
class="ICSharpCode.CppBinding.CppLanguageBinding" /> class="ICSharpCode.CppBinding.CppProjectBinding" />
</Path> </Path>
<Path name = "/SharpDevelop/MSBuildEngine/CompileTaskNames"> <Path name = "/SharpDevelop/MSBuildEngine/CompileTaskNames">
<!-- Makes SharpDevelop show the text 'Compiling ProjectName...' when the task is started --> <!-- Makes SharpDevelop show the text 'Compiling ProjectName...' when the task is started -->
<String id="cl" text = "cl"/> <String id="cl" text = "cl"/>
</Path> </Path>
<Path name="/SharpDevelop/Workbench/LanguageBindings">
<LanguageBinding
id="C++"
class="ICSharpCode.CppBinding.CppLanguageBinding"
extensions=".cpp;.c;.hpp;.h" />
</Path>
<!-- <!--
<Path name="/Workspace/Parser"> <Path name="/Workspace/Parser">

4
src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.csproj

@ -67,6 +67,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CppAmbience.cs" /> <Compile Include="CppAmbience.cs" />
<Compile Include="CppFormattingStrategy.cs" />
<Compile Include="CppLanguageBinding.cs" />
<Compile Include="CppLanguageProperties.cs" /> <Compile Include="CppLanguageProperties.cs" />
<Compile Include="Project\DependencyRelation.cs" /> <Compile Include="Project\DependencyRelation.cs" />
<Compile Include="Project\DirectoriesOptions.cs" /> <Compile Include="Project\DirectoriesOptions.cs" />
@ -100,7 +102,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<Compile Include="Configuration\AssemblyInfo.cs" /> <Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="CppLanguageBinding.cs" /> <Compile Include="CppProjectBinding.cs" />
<EmbeddedResource Include="Resources\DirectoriesOptions.xfrm" /> <EmbeddedResource Include="Resources\DirectoriesOptions.xfrm" />
<EmbeddedResource Include="Resources\LinkerOptions.xfrm" /> <EmbeddedResource Include="Resources\LinkerOptions.xfrm" />
<EmbeddedResource Include="Resources\PreprocessorOptions.xfrm" /> <EmbeddedResource Include="Resources\PreprocessorOptions.xfrm" />

27
src/AddIns/BackendBindings/CppBinding/CppBinding/CppFormattingStrategy.cs

@ -0,0 +1,27 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Siegfried Pammer" email="siegfriedpammer@gmail.com" />
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.SharpDevelop.Editor;
namespace ICSharpCode.CppBinding
{
/// <summary>
/// Formatting strategy for C++ (only implements insertion of comment tags).
/// </summary>
public class CppFormattingStrategy : DefaultFormattingStrategy
{
public CppFormattingStrategy()
{
}
public override void SurroundSelectionWithComment(ITextEditor editor)
{
SurroundSelectionWithSingleLineComment(editor, "//");
}
}
}

45
src/AddIns/BackendBindings/CppBinding/CppBinding/CppLanguageBinding.cs

@ -1,39 +1,20 @@
/* // <file>
* Created by SharpDevelop. // <copyright see="prj:///doc/copyright.txt"/>
* User: trecio // <license see="prj:///doc/license.txt"/>
* Date: 2009-05-31 // <owner name="Siegfried Pammer" email="siegfriedpammer@gmail.com" />
* Time: 22:54 // <version>$Revision$</version>
* // </file>
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/ using System;
using ICSharpCode.CppBinding.Project; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.CppBinding namespace ICSharpCode.CppBinding
{ {
/// <summary> public class CppLanguageBinding : DefaultLanguageBinding
/// Description of CppLanguageBinding.
/// </summary>
public class CppLanguageBinding : IProjectBinding
{ {
public const string LanguageName = "C++"; public override IFormattingStrategy FormattingStrategy {
get { return new CppFormattingStrategy(); }
public string Language {
get {
return LanguageName;
}
}
public readonly static CppLanguageProperties LanguageProperties = new CppLanguageProperties();
public IProject LoadProject(ProjectLoadInformation info) {
return new CppProject(info);
}
public IProject CreateProject(ProjectCreateInformation info) {
info.Platform = "Win32";
return new CppProject(info);
} }
} }
} }

39
src/AddIns/BackendBindings/CppBinding/CppBinding/CppProjectBinding.cs

@ -0,0 +1,39 @@
/*
* Created by SharpDevelop.
* User: trecio
* Date: 2009-05-31
* Time: 22:54
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using ICSharpCode.CppBinding.Project;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.CppBinding
{
/// <summary>
/// Description of CppProjectBinding.
/// </summary>
public class CppProjectBinding : IProjectBinding
{
public const string LanguageName = "C++";
public string Language {
get {
return LanguageName;
}
}
public readonly static CppLanguageProperties LanguageProperties = new CppLanguageProperties();
public IProject LoadProject(ProjectLoadInformation info) {
return new CppProject(info);
}
public IProject CreateProject(ProjectCreateInformation info) {
info.Platform = "Win32";
return new CppProject(info);
}
}
}

4
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/CppProject.cs

@ -41,12 +41,12 @@ namespace ICSharpCode.CppBinding.Project
public override string Language public override string Language
{ {
get { return CppLanguageBinding.LanguageName; } get { return CppProjectBinding.LanguageName; }
} }
public override LanguageProperties LanguageProperties public override LanguageProperties LanguageProperties
{ {
get { return CppLanguageBinding.LanguageProperties; } get { return CppProjectBinding.LanguageProperties; }
} }
public override string OutputAssemblyFullPath public override string OutputAssemblyFullPath

Loading…
Cancel
Save