[svn] r6673: vs-plugin/trunk/Nemerle.VsIntegration: Automation.cs
ConfigurationPropertyPages.cs EditorFact...
IT
svnadmin at nemerle.org
Thu Sep 21 06:53:39 CEST 2006
Log:
C# integration project refactoring.
Author: IT
Date: Thu Sep 21 06:53:20 2006
New Revision: 6673
Added:
vs-plugin/trunk/Nemerle.VsIntegration/Package/
vs-plugin/trunk/Nemerle.VsIntegration/Package/Automation/
vs-plugin/trunk/Nemerle.VsIntegration/Package/Automation/NemerleOAFileItem.cs
vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleAuthoringScope.cs
vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleLanguageService.cs
vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectFactory.cs
vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectNode.cs
vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectNodeProperties.cs
Removed:
vs-plugin/trunk/Nemerle.VsIntegration/Automation.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleLanguage.cs
vs-plugin/trunk/Nemerle.VsIntegration/Parsing/NemerleAuthoringScope.cs
vs-plugin/trunk/Nemerle.VsIntegration/Project/
Modified:
vs-plugin/trunk/Nemerle.VsIntegration/ConfigurationPropertyPages.cs
vs-plugin/trunk/Nemerle.VsIntegration/EditorFactory.cs
vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs
vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfoCollection.cs
vs-plugin/trunk/Nemerle.VsIntegration/Engine/TraceWriter.cs
vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/CodeElementBase.cs
vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/NemerleFileCodeModel.cs
vs-plugin/trunk/Nemerle.VsIntegration/HierarchyListener.cs
vs-plugin/trunk/Nemerle.VsIntegration/Library.cs
vs-plugin/trunk/Nemerle.VsIntegration/LibraryNode.cs
vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VsIntegration.csproj
vs-plugin/trunk/Nemerle.VsIntegration/NemerleAuthoringSink.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleColorableItem.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleDeclarations.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNode.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNodeProperties.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryManager.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryNode.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleMenus.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleScanner.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleSource.cs
vs-plugin/trunk/Nemerle.VsIntegration/NemerleViewFilter.cs
vs-plugin/trunk/Nemerle.VsIntegration/ObjectModelExtenders/ReferenceContainerNodeEx.cs
vs-plugin/trunk/Nemerle.VsIntegration/Properties/AssemblyInfo.cs
vs-plugin/trunk/Nemerle.VsIntegration/PropertyPages.cs
vs-plugin/trunk/Nemerle.VsIntegration/RegisterSnippetsAttribute.cs
vs-plugin/trunk/Nemerle.VsIntegration/SnippetsEnumerator.cs
vs-plugin/trunk/Nemerle.VsIntegration/TextLineEventListener.cs
vs-plugin/trunk/Nemerle.VsIntegration/Utils.cs
Modified: vs-plugin/trunk/Nemerle.VsIntegration/ConfigurationPropertyPages.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/ConfigurationPropertyPages.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/ConfigurationPropertyPages.cs Thu Sep 21 06:53:20 2006
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Package;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
namespace Nemerle.VsIntegration.Project
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/EditorFactory.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/EditorFactory.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/EditorFactory.cs Thu Sep 21 06:53:20 2006
@@ -20,7 +20,7 @@
using Microsoft.VisualStudio.TextManager.Interop;
using IOleServiceProvider
= Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
namespace Nemerle.VsIntegration.Project
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs Thu Sep 21 06:53:20 2006
@@ -17,7 +17,7 @@
using Microsoft.VisualStudio;
using Nemerle.VsIntegration;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
public class ProjectInfo
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfoCollection.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfoCollection.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfoCollection.cs Thu Sep 21 06:53:20 2006
@@ -1,6 +1,6 @@
using System.Collections.ObjectModel;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
public class ProjectInfoCollection : Collection<ProjectInfo>
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Engine/TraceWriter.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Engine/TraceWriter.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Engine/TraceWriter.cs Thu Sep 21 06:53:20 2006
@@ -4,7 +4,7 @@
using System.Text;
using System.Text.RegularExpressions;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
class TraceWriter : TextWriter
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/CodeElementBase.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/CodeElementBase.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/CodeElementBase.cs Thu Sep 21 06:53:20 2006
@@ -1,6 +1,6 @@
using System;
using EnvDTE;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
namespace Microsoft.VisualStudio.Package.Automation
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/NemerleFileCodeModel.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/NemerleFileCodeModel.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/FileCodeModel/NemerleFileCodeModel.cs Thu Sep 21 06:53:20 2006
@@ -3,21 +3,23 @@
using System.Collections.Generic;
using System.IO;
using EnvDTE;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
using Nemerle.VsIntegration.Project;
using Nemerle.Compiler.Utils;
using CodeNamespace=System.CodeDom.CodeNamespace;
+using Nemerle.VisualStudio.Package.Automation;
+
namespace Microsoft.VisualStudio.Package.Automation
{
internal class NemerleFileCodeModel : FileCodeModel
{
readonly FileNode _node;
readonly OAProject _project;
- OANemerleFileItem _projectItem;
+ NemerleOAFileItem _projectItem;
DTE dte;
- public NemerleFileCodeModel(DTE dte, OANemerleFileItem projectItem,
+ public NemerleFileCodeModel(DTE dte, NemerleOAFileItem projectItem,
FileNode node, OAProject project)
{
_node = node;
Modified: vs-plugin/trunk/Nemerle.VsIntegration/HierarchyListener.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/HierarchyListener.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/HierarchyListener.cs Thu Sep 21 06:53:20 2006
@@ -15,7 +15,7 @@
using Microsoft.VisualStudio.TextManager.Interop;
using Nemerle;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
[DebuggerStepThrough]
internal class HierarchyEventArgs : EventArgs
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Library.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Library.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Library.cs Thu Sep 21 06:53:20 2006
@@ -13,7 +13,7 @@
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell.Interop;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
public class Library : IVsSimpleLibrary2
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/LibraryNode.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LibraryNode.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LibraryNode.cs Thu Sep 21 06:53:20 2006
@@ -18,7 +18,7 @@
using ErrorHandler = Microsoft.VisualStudio.ErrorHandler;
using VSConstants = Microsoft.VisualStudio.VSConstants;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
/// <summary>
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VsIntegration.csproj
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VsIntegration.csproj (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VsIntegration.csproj Thu Sep 21 06:53:20 2006
@@ -78,8 +78,8 @@
<Compile Include="NemerleColorableItem.cs" />
<Compile Include="NemerleConstants.cs" />
<Compile Include="NemerleDeclarations.cs" />
- <Compile Include="NemerleLanguage.cs" />
- <Compile Include="Parsing\NemerleAuthoringScope.cs" />
+ <Compile Include="Package\NemerleLanguageService.cs" />
+ <Compile Include="Package\NemerleAuthoringScope.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="NemerleLibraryManager.cs" />
<Compile Include="NemerleLibraryNode.cs" />
@@ -135,7 +135,7 @@
<Compile Include="$(VisualStudioIntegration)\Common\Source\CSharp\RegistrationAttributes\WebSiteProjectRelatedFilesAttribute.cs">
<Link>RegistrationAttributes\WebSiteProjectRelatedFilesAttribute.cs</Link>
</Compile>
- <Compile Include="Automation.cs" />
+ <Compile Include="Package\Automation\NemerleOAFileItem.cs" />
<Compile Include="NemerleAuthoringSink.cs" />
<Compile Include="Utils.cs" />
<Compile Include="ConfigurationPropertyPages.cs" />
@@ -151,19 +151,17 @@
<Compile Include="FileCodeModel\NemerleCodeElements.cs" />
<Compile Include="FileCodeModel\NullTextPoint.cs" />
<Compile Include="FileCodeModel\VoidCodeTypeRef.cs" />
- <Compile Include="Project\NemerleProjectNode.cs" />
+ <Compile Include="Package\NemerleProjectNode.cs" />
<Compile Include="ObjectModelExtenders\ReferenceContainerNodeEx.cs" />
<Compile Include="ObjectModelExtenders\TokenProcessorEx.cs" />
<Compile Include="FileCodeModel\NemerleFileCodeModel.cs" />
- <Compile Include="Project\NemerleProjectFactory.cs" />
- <Compile Include="Project\NemerleProjectFileConstants.cs" />
+ <Compile Include="Package\NemerleProjectFactory.cs" />
<Compile Include="PropertyPages.cs" />
<Compile Include="NemerleConfigProvider.cs" />
<Compile Include="NemerleFileNode.cs" />
<Compile Include="NemerleFileNodeProperties.cs" />
<Compile Include="NemerleMenus.cs" />
- <Compile Include="Project\OutputFileExtension.cs" />
- <Compile Include="Project\NemerleProjectNodeProperties.cs" />
+ <Compile Include="Package\NemerleProjectNodeProperties.cs" />
<Compile Include="Resources.cs" />
<Compile Include="SelectionElementValueChangedListener.cs" />
<Compile Include="VSMDNemerleProvider.cs" />
@@ -259,6 +257,9 @@
<ItemGroup>
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
</ItemGroup>
+ <ItemGroup>
+ <Folder Include="Parsing\" />
+ </ItemGroup>
<PropertyGroup>
<TargetRegistryRoot>Software\Microsoft\VisualStudio\8.0Exp</TargetRegistryRoot>
<RegisterOutputPackage>true</RegisterOutputPackage>
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleAuthoringSink.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleAuthoringSink.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleAuthoringSink.cs Thu Sep 21 06:53:20 2006
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.Package;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
namespace Nemerle.VsIntegration
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleColorableItem.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleColorableItem.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleColorableItem.cs Thu Sep 21 06:53:20 2006
@@ -13,7 +13,7 @@
using Microsoft.VisualStudio.TextManager.Interop;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
public class NemerleColorableItem : IVsColorableItem
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs Thu Sep 21 06:53:20 2006
@@ -1,4 +1,4 @@
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
public static class GlobalConstants
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleDeclarations.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleDeclarations.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleDeclarations.cs Thu Sep 21 06:53:20 2006
@@ -19,7 +19,7 @@
using System.Collections.Generic;
using System.Text;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
public class NemerleDeclarations : Declarations
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNode.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNode.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNode.cs Thu Sep 21 06:53:20 2006
@@ -25,7 +25,10 @@
using VsCommands = Microsoft.VisualStudio.VSConstants.VSStd97CmdID;
using VsCommands2K = Microsoft.VisualStudio.VSConstants.VSStd2KCmdID;
using VsMenus=Microsoft.VisualStudio.Shell.VsMenus;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
+
+using Nemerle.VisualStudio.Package;
+using Nemerle.VisualStudio.Package.Automation;
namespace Nemerle.VsIntegration.Project
{
@@ -115,7 +118,7 @@
/// <returns></returns>
public override object GetAutomationObject()
{
- return new OANemerleFileItem((OAProject)ProjectMgr.GetAutomationObject(), this);
+ return new NemerleOAFileItem((OAProject)ProjectMgr.GetAutomationObject(), this);
}
// Called since the FileNode.ImageIndex returns -1 by default.
@@ -157,7 +160,7 @@
{
// Set the MainFile project property to the Filename of this Node
ProjectMgr.SetProjectProperty(
- NemerleProjectFileConstants.MainFile, GetRelativePath());
+ NemerleProjectNodeProperties.MainFilePropertyName, GetRelativePath());
return VSConstants.S_OK;
}
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNodeProperties.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNodeProperties.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleFileNodeProperties.cs Thu Sep 21 06:53:20 2006
@@ -15,7 +15,7 @@
using Microsoft.VisualStudio.Package;
using IOleServiceProvider =
Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
namespace Nemerle.VsIntegration.Project
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryManager.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryManager.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryManager.cs Thu Sep 21 06:53:20 2006
@@ -19,7 +19,7 @@
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TextManager.Interop;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
/// <summary>
/// This interface defines the service that finds Nemerle files inside
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryNode.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryNode.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleLibraryNode.cs Thu Sep 21 06:53:20 2006
@@ -16,7 +16,7 @@
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TextManager.Interop;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
/// <summary>
/// This is a specialized version of the LibraryNode that handles the
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleMenus.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleMenus.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleMenus.cs Thu Sep 21 06:53:20 2006
@@ -12,7 +12,7 @@
using System;
using System.ComponentModel.Design;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
namespace Nemerle.VsIntegration.Project
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs Thu Sep 21 06:53:20 2006
@@ -23,7 +23,9 @@
using Nemerle.Compiler;
using Microsoft.VisualStudio.TextManager.Interop;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+using Nemerle.VisualStudio.Package;
+
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
#region Registration attributs
@@ -42,7 +44,7 @@
// GlobalConstants.LanguageName + ";" + GlobalConstants.LanguageName ,
// GlobalConstants.LanguageName)]
[DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\8.0Exp")]
- [ProvideProjectFactory(typeof(NP.NemerleProjectFactory),
+ [ProvideProjectFactory(typeof(NemerleProjectFactory),
GlobalConstants.LanguageName,
GlobalConstants.LanguageName
+ " Project Project Files (*." + GlobalConstants.ProjectExtension + ");*."
@@ -71,15 +73,15 @@
GlobalConstants.ProductID,
IconResourceID=300)]
[ProvideLoadKey("standard", GlobalConstants.ProductID, GlobalConstants.ProductDetails, "", 104)]
- [ProvideService(typeof(NemerleLanguage), ServiceName = GlobalConstants.LanguageName)]
+ [ProvideService(typeof(NemerleLanguageService), ServiceName = GlobalConstants.LanguageName)]
[ProvideService(typeof(INemerleLibraryManager))]
- [ProvideLanguageService(typeof(NemerleLanguage), GlobalConstants.LanguageName, 100,
+ [ProvideLanguageService(typeof(NemerleLanguageService), GlobalConstants.LanguageName, 100,
CodeSense = true,
EnableCommenting = true,
MatchBraces = true,
ShowCompletion = true,
ShowMatchingBrace = true)]
- [ProvideLanguageExtension(typeof(NemerleLanguage), GlobalConstants.FileExtension)]
+ [ProvideLanguageExtension(typeof(NemerleLanguageService), GlobalConstants.FileExtension)]
[Guid(GlobalConstants.PackageGuidString)]
[RegisterSnippets(GlobalConstants.LanguageServiceGuidString,
false, 100, GlobalConstants.LanguageName,
@@ -100,7 +102,7 @@
{
IServiceContainer container = this;
ServiceCreatorCallback callback = new ServiceCreatorCallback(CreateService);
- container.AddService(typeof(NemerleLanguage), callback, true);
+ container.AddService(typeof(NemerleLanguageService), callback, true);
container.AddService(typeof(INemerleLibraryManager), callback, true);
}
@@ -110,7 +112,7 @@
protected override void Initialize()
{
base.Initialize();
- RegisterProjectFactory(new NP.NemerleProjectFactory(this));
+ RegisterProjectFactory(new NemerleProjectFactory(this));
NP.EditorFactory editorFactory = new NP.EditorFactory(this);
RegisterEditorFactory(editorFactory);
@@ -227,9 +229,9 @@
private object CreateService(IServiceContainer container, Type serviceType)
{
object service = null;
- if (typeof(NemerleLanguage) == serviceType)
+ if (typeof(NemerleLanguageService) == serviceType)
{
- NemerleLanguage language = new NemerleLanguage();
+ NemerleLanguageService language = new NemerleLanguageService();
language.SetSite(this);
RegisterForIdleTime();
service = language;
@@ -254,7 +256,7 @@
public int FDoIdle(uint grfidlef)
{
- NemerleLanguage lang = GetService(typeof(NemerleLanguage)) as NemerleLanguage;
+ NemerleLanguageService lang = GetService(typeof(NemerleLanguageService)) as NemerleLanguageService;
if (lang != null)
lang.OnIdle((grfidlef & (uint)_OLEIDLEF.oleidlefPeriodic) != 0);
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleScanner.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleScanner.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleScanner.cs Thu Sep 21 06:53:20 2006
@@ -1,7 +1,7 @@
using Microsoft.VisualStudio.Package;
using Nemerle.Compiler;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
class NemerleScanner : IScanner
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleSource.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleSource.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleSource.cs Thu Sep 21 06:53:20 2006
@@ -24,7 +24,9 @@
using System.Runtime.InteropServices;
using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+using Nemerle.VisualStudio.Package;
+
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
public delegate AuthoringScope ScopeCreatorCallback(ParseRequest request);
@@ -32,7 +34,7 @@
{
ScopeCreatorCallback scopeCreator;
- public NemerleSource(LanguageService service, IVsTextLines textLines,
+ public NemerleSource(NemerleLanguageService service, IVsTextLines textLines,
Colorizer colorizer) : base(service, textLines, colorizer) {}
public override CommentInfo GetCommentFormat()
Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleViewFilter.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleViewFilter.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleViewFilter.cs Thu Sep 21 06:53:20 2006
@@ -15,8 +15,9 @@
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.TextManager.Interop;
using Nemerle.VsIntegration;
+using Nemerle.VisualStudio;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
internal class NemerleViewFilter : ViewFilter
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/ObjectModelExtenders/ReferenceContainerNodeEx.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/ObjectModelExtenders/ReferenceContainerNodeEx.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/ObjectModelExtenders/ReferenceContainerNodeEx.cs Thu Sep 21 06:53:20 2006
@@ -3,6 +3,7 @@
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.Package.Automation;
+using Nemerle.VisualStudio.Package;
namespace Nemerle.VsIntegration.Project
{
Added: vs-plugin/trunk/Nemerle.VsIntegration/Package/Automation/NemerleOAFileItem.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Package/Automation/NemerleOAFileItem.cs Thu Sep 21 06:53:20 2006
@@ -0,0 +1,46 @@
+using System.Runtime.InteropServices;
+
+using EnvDTE;
+
+using Microsoft.VisualStudio.Package;
+using Microsoft.VisualStudio.Package.Automation;
+
+using Microsoft.Samples.VisualStudio.LanguageService;
+using Nemerle.VsIntegration.Project;
+
+namespace Nemerle.VisualStudio.Package.Automation
+{
+ /// <summary>
+ /// Add support for automation on py files.
+ /// </summary>
+ [Guid(GlobalConstants.OAFileItemGuidString)]
+ public class NemerleOAFileItem : OAFileItem
+ {
+ public NemerleOAFileItem(OAProject project, FileNode node)
+ : base(project, node)
+ {
+ }
+
+ /// <summary>
+ /// Gets the FileCodeModel object for the project item.
+ /// </summary>
+ public override FileCodeModel FileCodeModel
+ {
+ get { return new NemerleFileCodeModel(DTE, this, Node, Project); }
+ }
+
+ public override Window Open(string viewKind)
+ {
+ if (string.Compare(viewKind, Constants.vsViewKindPrimary) == 0)
+ {
+ // Get the subtype and decide the viewkind based on the result.
+ //
+ if (((NemerleFileNode)Node).IsFormSubType)
+ return base.Open(Constants.vsViewKindDesigner);
+ }
+
+ return base.Open(viewKind);
+ }
+ }
+
+}
Added: vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleAuthoringScope.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleAuthoringScope.cs Thu Sep 21 06:53:20 2006
@@ -0,0 +1,112 @@
+using System;
+
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Package;
+using Microsoft.VisualStudio.TextManager.Interop;
+
+using Nemerle.Completion2;
+
+using Microsoft.Samples.VisualStudio.LanguageService;
+
+namespace Nemerle.VisualStudio.Package
+{
+ class NemerleAuthoringScope : AuthoringScope
+ {
+ #region ctors
+
+ public NemerleAuthoringScope(
+ ProjectInfo project,
+ AuthoringSink sink,
+ CompletionElem[] overloadPossibility)
+ : this(project, sink)
+ {
+ _overloadPossibility = overloadPossibility;
+ }
+
+ public NemerleAuthoringScope(ProjectInfo project, AuthoringSink sink, string filePath, GetText getText)
+ : this(project, sink)
+ {
+ _filePath = filePath;
+ _getText = getText;
+ }
+
+ public NemerleAuthoringScope(ProjectInfo project, AuthoringSink sink, Methods methods)
+ : this(project, sink)
+ {
+ _methods = methods;
+ }
+
+ public NemerleAuthoringScope(ProjectInfo project, AuthoringSink sink)
+ {
+ _project = project;
+ _sink = sink;
+ }
+
+ #endregion
+
+ #region Fields
+
+ private AuthoringSink _sink;
+ private CompletionElem[] _overloadPossibility;
+ private Methods _methods;
+ private ProjectInfo _project;
+ private string _filePath;
+ private GetText _getText;
+
+ #endregion
+
+ #region Overrides
+
+ public override string GetDataTipText(int line, int col, out TextSpan span)
+ {
+ span = new TextSpan();
+
+ QuickTipInfo info = _project.GetQuickTip(_filePath, line, col, _getText);
+
+ if (info == null)
+ return null;
+
+ span.iStartLine = info.LineStart;
+ span.iEndLine = info.LineEnd;
+ span.iStartIndex = info.ColStart;
+ span.iEndIndex = info.ColEnd;
+
+ return info.Text;
+ }
+
+ public override string Goto(
+ VSConstants.VSStd97CmdID cmd,
+ IVsTextView textView,
+ int line,
+ int col,
+ out TextSpan span)
+ {
+ span = new TextSpan();
+
+ GotoInfo info = _project.GetGoto(_filePath, line, col, _getText);
+
+ if (info == null || !info.HasLocation)
+ return null;
+
+ span.iStartLine = info.LineStart;
+ span.iEndLine = info.LineEnd;
+ span.iStartIndex = info.ColStart;
+ span.iEndIndex = info.ColEnd;
+
+ return info.FilePath;
+ }
+
+ public override Declarations GetDeclarations(
+ IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
+ {
+ return new NemerleDeclarations(_overloadPossibility);
+ }
+
+ public override Methods GetMethods(int line, int col, string name)
+ {
+ return _methods;
+ }
+
+ #endregion
+ }
+}
Added: vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleLanguageService.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleLanguageService.cs Thu Sep 21 06:53:20 2006
@@ -0,0 +1,534 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+using System.Windows.Forms;
+
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Package;
+using Microsoft.VisualStudio.Shell;
+using Microsoft.VisualStudio.Shell.Interop;
+using Microsoft.VisualStudio.TextManager.Interop;
+
+using Nemerle.Compiler;
+using Nemerle.Completion2;
+using Nemerle.Core;
+using Nemerle.Utility;
+using Nemerle.Compiler.Utils;
+using Nemerle.VsIntegration;
+using Nemerle.VisualStudio;
+
+using Nemerle.VisualStudio.Package;
+using Microsoft.Samples.VisualStudio.LanguageService;
+
+using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities;
+
+namespace Nemerle.VisualStudio.Package
+{
+ [Guid(GlobalConstants.LanguageServiceGuidString)]
+ public class NemerleLanguageService : LanguageService
+ {
+ public NemerleLanguageService()
+ {
+ CompiledUnitAstBrowser.ShowLocation += CompiledUnitAstBrowser_ShowLocation;
+ }
+
+ void CompiledUnitAstBrowser_ShowLocation(Location loc)
+ {
+ TextSpan span = new TextSpan();
+
+ span.iStartLine = loc.Line - 1;
+ span.iStartIndex = loc.Column - 1;
+ span.iEndLine = loc.EndLine - 1;
+ span.iEndIndex = loc.EndColumn - 1;
+
+ uint itemID;
+ IVsUIHierarchy hierarchy;
+ IVsWindowFrame docFrame;
+ IVsTextView textView;
+
+ VsShell.OpenDocument(Site, loc.File,
+ NativeMethods.LOGVIEWID_Code, out hierarchy, out itemID, out docFrame, out textView);
+
+ NativeMethods.ThrowOnFailure(docFrame.Show());
+
+ if (textView != null)
+ {
+ try
+ {
+ NativeMethods.ThrowOnFailure(textView.SetCaretPos(span.iStartLine, span.iStartIndex));
+ TextSpanHelper.MakePositive(ref span);
+ NativeMethods.ThrowOnFailure(textView.SetSelection(span.iStartLine, span.iStartIndex, span.iEndLine, span.iEndIndex));
+ NativeMethods.ThrowOnFailure(textView.EnsureSpanVisible(span));
+ }
+ catch (Exception ex)
+ {
+ Trace.WriteLine(ex.Message);
+ }
+ }
+ }
+
+ LanguagePreferences _preferences;
+ NemerleScanner _scanner;
+ Dictionary<IVsTextView, NemerleSource> _specialSources = new Dictionary<IVsTextView, NemerleSource>();
+
+ // This array contains the definition of the colorable items provided by
+ // this language service.
+ // This specific language does not really need to provide colorable items
+ // because it does not define any item different from the default ones,
+ // but the base class has an empty implementation of
+ // IVsProvideColorableItems, so any language service that derives from
+ // it must implement the methods of this interface, otherwise there are
+ // errors when the shell loads an editor to show a file associated to
+ // this language.
+ private static NemerleColorableItem[] _colorableItems =
+ {
+ // The first 6 items in this list MUST be these default items.
+ //
+ new NemerleColorableItem("Keyword", COLORINDEX.CI_BLUE, COLORINDEX.CI_USERTEXT_BK),
+ new NemerleColorableItem("Comment", COLORINDEX.CI_DARKGREEN, COLORINDEX.CI_USERTEXT_BK),
+ new NemerleColorableItem("Identifier", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK),
+ new NemerleColorableItem("String", COLORINDEX.CI_DARKBLUE, COLORINDEX.CI_USERTEXT_BK),
+ new NemerleColorableItem("Number", COLORINDEX.CI_DARKBLUE, COLORINDEX.CI_USERTEXT_BK),
+ new NemerleColorableItem("Text", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK),
+ new NemerleColorableItem("Operator", COLORINDEX.CI_DARKBLUE, COLORINDEX.CI_USERTEXT_BK)
+ };
+
+ public override void Dispose()
+ {
+ try
+ {
+ foreach (NemerleSource source in _specialSources.Values)
+ source.Dispose();
+
+ _specialSources.Clear();
+
+ if (_preferences != null)
+ {
+ _preferences.Dispose();
+ _preferences = null;
+ }
+ }
+ finally
+ {
+ base.Dispose();
+ }
+ }
+
+ public void AddSpecialSource(NemerleSource source, IVsTextView view)
+ {
+ _specialSources.Add(view, source);
+ }
+
+ public override string Name
+ {
+ get { return Resources.Nemerle; }
+ }
+
+ public override Source CreateSource(IVsTextLines buffer)
+ {
+ return new NemerleSource(this, buffer,
+ new Colorizer(this, buffer, GetScanner(buffer)));
+ }
+
+ public override LanguagePreferences GetLanguagePreferences()
+ {
+ if (_preferences == null)
+ {
+ _preferences = new LanguagePreferences(Site,
+ typeof(NemerleLanguageService).GUID, Name);
+ _preferences.Init();
+#if DEBUG
+ //VladD2: Switch on synchronous mode for debugging purpose!
+ //TODO: Coment it if necessary.
+ _preferences.EnableAsyncCompletion = false;
+#endif
+ }
+
+ return _preferences;
+ }
+
+ public override IScanner GetScanner(IVsTextLines buffer)
+ {
+ if (_scanner == null)
+ _scanner = new NemerleScanner();
+ return _scanner;
+ }
+
+ #region ParseSource
+
+ public override AuthoringScope ParseSource(ParseRequest request)
+ {
+ if (request == null)
+ throw new ArgumentNullException("request");
+
+ Debug.Print(
+ "File '{0}' ParseSource at ({1}:{2}), reason {3}, Timestamp {4}",
+ Path.GetFileName(request.FileName), request.Line, request.Col, request.Reason,
+ request.Timestamp);
+
+ switch (request.Reason)
+ {
+ case ParseReason.Check: return Check(request);
+ case ParseReason.MemberSelect:
+ case ParseReason.CompleteWord: return GetCompleteWord(request);
+ case ParseReason.Goto:
+ case ParseReason.QuickInfo: return GetMethodScope(request);
+ case ParseReason.MethodTip: return GetMethodTip(request);
+
+ case ParseReason.Autos:
+ case ParseReason.CodeSpan:
+ case ParseReason.DisplayMemberList:
+ case ParseReason.HighlightBraces:
+ case ParseReason.MatchBraces:
+ case ParseReason.None:
+ case ParseReason.MemberSelectAndHighlightBraces:
+ Trace.WriteLine("Reson '" + request.Reason + "' not handled.");
+ break;
+ }
+
+ NemerleSource source;
+
+ if (_specialSources.TryGetValue(request.View, out source) && source.ScopeCreator != null)
+ return source.ScopeCreator(request);
+
+ return GetDefaultScope(request);
+ }
+
+ private AuthoringScope Check(ParseRequest request)
+ {
+ ProjectInfo projectInfo = ProjectInfo.FindProject(request.FileName);
+
+ if (projectInfo == null)
+ return null;
+
+ try
+ {
+ projectInfo.Engine.ProcessMessages = true;
+ projectInfo.UpdateFile(request);
+
+ Project project = projectInfo.Project;
+
+ project.CheckErrors(
+ request.FileName,
+ delegate(CompilerMessage cm)
+ {
+ TextSpan ts = Convert(cm.Location);
+
+ request.Sink.AddError(
+ request.FileName,
+ cm.Message,
+ ts,
+ cm.MessageKind == MessageKind.Error ? Severity.Error :
+ cm.MessageKind == MessageKind.Warning ? Severity.Warning :
+ Severity.Hint);
+ },
+ delegate(int line, int col, int lineEnd, int colEnd)
+ {
+ return GetCodeRegion(request, line, col, lineEnd, colEnd);
+ });
+ }
+ finally
+ {
+ projectInfo.Engine.ProcessMessages = false;
+ }
+
+ return GetDefaultScope(request);
+ }
+
+ private AuthoringScope GetMethodScope(ParseRequest request)
+ {
+ string text;
+
+ int res = request.View.GetTextStream(
+ request.Line, request.Col, request.Line, request.Col + 1, out text);
+
+ if (res != VSConstants.S_OK || text.Length == 0 || text[0] == ' ' || text[0] == '\t')
+ return null;
+
+ ProjectInfo projectInfo = GetProject(request);
+
+ if (projectInfo == null)
+ return null;
+
+ return new NemerleAuthoringScope(
+ projectInfo, request.Sink, request.FileName,
+ delegate(int line, int col, int lineEnd, int colEnd)
+ {
+ return GetCodeRegion(request, line, col, lineEnd, colEnd);
+ });
+ }
+
+ private AuthoringScope GetCompleteWord(ParseRequest request)
+ {
+ try
+ {
+ ProjectInfo projectInfo = GetProject(request);
+
+ if (projectInfo == null)
+ return null;
+
+ CompletionElem[] overloads = projectInfo.CompleteWord(
+ request.FileName, request.Line, request.Col,
+ delegate(int line, int col, int lineEnd, int colEnd)
+ {
+ return GetCodeRegion(request, line, col, lineEnd, colEnd);
+ });
+
+ if (overloads.Length > 0)
+ return new NemerleAuthoringScope(projectInfo, request.Sink, overloads);
+ }
+ catch (Exception ex)
+ {
+ Trace.Assert(false, ex.ToString());
+ Trace.WriteLine(ex);
+ }
+
+ return GetDefaultScope(request);
+ }
+
+ private AuthoringScope GetMethodTip(ParseRequest request)
+ {
+ ProjectInfo projectInfo = GetProject(request);
+
+ if (projectInfo == null)
+ return null;
+
+ NemerleMethods methods = projectInfo.GetMethodTip(
+ request.FileName, request.Line, request.Col,
+ delegate(int line, int col, int lineEnd, int colEnd)
+ {
+ return GetCodeRegion(request, line, col, lineEnd, colEnd);
+ });
+
+ if (methods != null)
+ {
+ if (methods.StartName.EndLine > 0)
+ {
+ request.Sink.StartName (Convert(methods.StartName), methods.GetName(0));
+ request.Sink.StartParameters(Convert(methods.StartParameters));
+
+ foreach (Location loc in methods.NextParameters)
+ request.Sink.NextParameter(Convert(loc));
+
+ request.Sink.EndParameters (Convert(methods.EndParameters));
+ }
+ else
+ {
+ TextSpan ts = new TextSpan();
+
+ ts.iStartIndex = request.Line;
+ ts.iEndIndex = request.Line;
+ ts.iStartIndex = request.Col - 1;
+ ts.iEndIndex = request.Col + 1;
+
+ request.Sink.StartName(ts, methods.GetName(0));
+ }
+
+ return new NemerleAuthoringScope(
+ ProjectInfo.FindProject(request.FileName),
+ request.Sink, methods);
+ }
+
+ return GetDefaultScope(request);
+ }
+
+ private string GetCodeRegion(ParseRequest request, int startLine, int startCol, int endLine, int endCol)
+ {
+ string region;
+
+ if (request.View.GetTextStream(
+ startLine - 1,
+ startCol - 1,
+ endLine - 1,
+ endCol - 1,
+ out region
+ ) == VSConstants.S_OK)
+ {
+ return region;
+ }
+
+ return "";
+ }
+
+ private AuthoringScope GetDefaultScope(ParseRequest request)
+ {
+ return new NemerleAuthoringScope(
+ ProjectInfo.FindProject(request.FileName), request.Sink);
+ }
+
+ private ProjectInfo GetProject(ParseRequest request)
+ {
+ ProjectInfo projectInfo = ProjectInfo.FindProject(request.FileName);
+
+ if (projectInfo != null)
+ projectInfo.UpdateFile(request);
+
+ return projectInfo;
+ }
+
+ private TextSpan Convert(Location location)
+ {
+ TextSpan ts = new TextSpan();
+
+ ts.iStartLine = location.Line - 1;
+ ts.iEndLine = location.EndLine - 1;
+ ts.iStartIndex = location.Column - 1;
+ ts.iEndIndex = location.EndColumn - 1;
+
+ return ts;
+ }
+
+ #endregion
+
+ public override ImageList GetImageList()
+ {
+ return base.GetImageList();
+ }
+
+ public override int ValidateBreakpointLocation(
+ IVsTextBuffer buffer, int line, int col, TextSpan[] pCodeSpan)
+ {
+ if (pCodeSpan != null)
+ {
+ pCodeSpan[0].iStartLine = line;
+ pCodeSpan[0].iStartIndex = col;
+ pCodeSpan[0].iEndLine = line;
+ pCodeSpan[0].iEndIndex = col;
+ if (buffer != null)
+ {
+ int length;
+ buffer.GetLengthOfLine(line, out length);
+ pCodeSpan[0].iStartIndex = 0;
+ pCodeSpan[0].iEndIndex = length;
+ }
+ return VSConstants.S_OK;
+ }
+ else
+ {
+ return VSConstants.S_FALSE;
+ }
+ }
+
+ public override void OnIdle(bool periodic)
+ {
+ Source src = GetSource(LastActiveTextView);
+ if (src != null && src.LastParseTime == Int32.MaxValue)
+ {
+ src.LastParseTime = 0;
+ }
+ base.OnIdle(periodic);
+ }
+
+ public override string GetFormatFilterList()
+ {
+ return Resources.NemerleFormatFilter;
+ }
+
+ // Implementation of IVsProvideColorableItems
+
+ public override int GetItemCount(out int count)
+ {
+ count = _colorableItems.Length;
+ return VSConstants.S_OK;
+ }
+
+ public override int GetColorableItem(int index, out IVsColorableItem item)
+ {
+ if (index < 1)
+ {
+ throw new ArgumentOutOfRangeException("index");
+ }
+ item = _colorableItems[index - 1];
+ return VSConstants.S_OK;
+ }
+
+ private int classNameCounter = 0;
+
+ public override ExpansionFunction CreateExpansionFunction(
+ ExpansionProvider provider, string functionName)
+ {
+ ExpansionFunction function = null;
+ if (functionName == "GetName")
+ {
+ ++classNameCounter;
+ function = new NemerleGetNameExpansionFunction(provider, classNameCounter);
+ }
+ return function;
+ }
+
+ private List<VsExpansion> expansionsList;
+
+ public override void OnParseComplete(ParseRequest req)
+ {
+ if (expansionsList == null)
+ {
+ GetSnippets();
+ }
+ }
+
+ // Disable the "DoNotPassTypesByReference" warning.
+ [SuppressMessage("Microsoft.Design", "CA1045")]
+ public void AddSnippets(ref NemerleDeclarations declarations)
+ {
+ if (null == expansionsList)
+ {
+ return;
+ }
+ foreach (VsExpansion expansionInfo in expansionsList)
+ {
+ //declarations.AddDeclaration(new Declaration(expansionInfo));
+ throw new NotImplementedException();
+ }
+ }
+
+ //[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
+ private void GetSnippets()
+ {
+ if (null == expansionsList)
+ expansionsList = new List<VsExpansion>();
+ else
+ expansionsList.Clear();
+
+ IVsTextManager2 textManager = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SVsTextManager)) as IVsTextManager2;
+ if (textManager == null)
+ return;
+
+ SnippetsEnumerator enumerator = new SnippetsEnumerator(textManager, GetLanguageServiceGuid());
+
+ foreach (VsExpansion expansion in enumerator)
+ if (!string.IsNullOrEmpty(expansion.shortcut))
+ expansionsList.Add(expansion);
+ }
+
+ public override ViewFilter CreateViewFilter(CodeWindowManager mgr, IVsTextView newView)
+ {
+ // This call makes sure debugging events can be received
+ // by our view filter.
+ GetIVsDebugger();
+ return new NemerleViewFilter(mgr, newView);
+ }
+
+ internal class NemerleGetNameExpansionFunction : ExpansionFunction
+ {
+ private int nameCount;
+
+ public NemerleGetNameExpansionFunction(ExpansionProvider provider, int counter)
+ : base(provider)
+ {
+ nameCount = counter;
+ }
+
+ public override string GetCurrentValue()
+ {
+ string name = "MyClass";
+ name += nameCount.ToString(CultureInfo.InvariantCulture);
+ return name;
+ }
+ }
+ }
+}
Added: vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectFactory.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectFactory.cs Thu Sep 21 06:53:20 2006
@@ -0,0 +1,33 @@
+using System;
+using System.Runtime.InteropServices;
+
+using Microsoft.VisualStudio.Package;
+
+using Microsoft.Samples.VisualStudio.LanguageService;
+
+using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
+
+namespace Nemerle.VisualStudio.Package
+{
+ [Guid(GlobalConstants.ProjectFactoryViewGuidString)]
+ public class NemerleProjectFactory : ProjectFactory
+ {
+ public NemerleProjectFactory(NemerlePackage package)
+ : base(package)
+ {
+ }
+
+ protected override ProjectNode CreateProject()
+ {
+ IServiceProvider provider = Package;
+ IOleServiceProvider oleServiceProvider =
+ (IOleServiceProvider)provider.GetService(typeof(IOleServiceProvider));
+
+ ProjectNode project = new NemerleProjectNode((NemerlePackage)Package);
+
+ project.SetSite(oleServiceProvider);
+
+ return project;
+ }
+ }
+}
Added: vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectNode.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectNode.cs Thu Sep 21 06:53:20 2006
@@ -0,0 +1,565 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Diagnostics;
+using System.Globalization;
+using System.IO;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
+
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.Designer.Interfaces;
+using Microsoft.VisualStudio.Package;
+using Microsoft.VisualStudio.Package.Automation;
+using Microsoft.VisualStudio.Shell.Interop;
+using Microsoft.VisualStudio.Shell;
+
+using Microsoft.Samples.VisualStudio.LanguageService;
+
+using Nemerle.VsIntegration.Project;
+using Nemerle.VisualStudio.Package.Automation;
+
+using PkgUtils = Microsoft.VisualStudio.Package.Utilities;
+
+namespace Nemerle.VisualStudio.Package
+{
+ [Guid(GlobalConstants.ProjectNodeGuidString)]
+ public class NemerleProjectNode : ProjectNode, IVsProjectSpecificEditorMap2
+ {
+ NemerlePackage _package;
+ static ImageList _nemerleImageList = LoadProjectImajeList();
+
+ #region ctor
+
+ public NemerleProjectNode(NemerlePackage pkg)
+ {
+ _package = pkg;
+
+ FileTemplateProcessor = new Nemerle.VsIntegration.Project.TokenProcessorEx();
+ CanFileNodesHaveChilds = true;
+ SupportsProjectDesigner = true;
+
+ OleServiceProvider.AddService(typeof(VSLangProj.VSProject), VSProject, false);
+
+ InitializeCATIDs();
+ }
+
+ private static ImageList LoadProjectImajeList()
+ {
+ // Make the name of resource bitmap.
+ // It's bitmap used in project ImageList.
+ //
+ Type type = typeof(NemerleProjectNode);
+ Assembly assembly = type.Assembly;
+ string resourceName = Nemerle.VsIntegration.Project.Utils.GetModuleName(type) + "." + GlobalConstants.ProjectImageListName;
+ Stream imageStream = assembly.GetManifestResourceStream(resourceName);
+
+ Trace.Assert(imageStream != null);
+
+ return PkgUtils.GetImageList(imageStream);
+ }
+
+ /// <summary>
+ /// Provide mapping from our browse objects and automation objects to our CATIDs
+ /// </summary>
+ void InitializeCATIDs()
+ {
+ // The following properties classes are specific to Nemerle so we can use their GUIDs directly
+ //
+ AddCATIDMapping(typeof(NemerleProjectNodeProperties), typeof(NemerleProjectNodeProperties).GUID);
+ AddCATIDMapping(typeof(NemerleFileNodeProperties), typeof(NemerleFileNodeProperties).GUID);
+ AddCATIDMapping(typeof(NemerleOAFileItem), typeof(NemerleOAFileItem).GUID);
+
+ // The following are not specific to Nemerle and as such we need a separate GUID
+ // (we simply used guidgen.exe to create new guids)
+ //
+ AddCATIDMapping(typeof(FolderNodeProperties), new Guid(GlobalConstants.FolderNodePropertiesGuidString));
+
+ // This one we use the same as Nemerle file nodes since both refer to files
+ //
+ AddCATIDMapping(typeof(FileNodeProperties), typeof(NemerleFileNodeProperties).GUID);
+
+ // Because our property page pass itself as the object to display in its grid,
+ // we need to make it have the same CATID as the browse object of the project node
+ // so that filtering is possible.
+ //
+ AddCATIDMapping(typeof(GeneralPropertyPage), typeof(NemerleProjectNodeProperties).GUID);
+
+ // We could also provide CATIDs for references and the references container node, if we wanted to.
+ }
+
+ #endregion
+
+ #region Fields
+
+ readonly Guid GUID_MruPage = new Guid("{19B97F03-9594-4c1c-BE28-25FF030113B3}");
+
+ VSLangProj.VSProject _vsProject = null;
+ IVSMDCodeDomProvider _codeDomProvider;
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Returns the outputfilename based on the output type
+ /// </summary>
+ public string OutputFileName
+ {
+ get
+ {
+ string assemblyName =
+ ProjectMgr.GetProjectProperty(
+ GeneralPropertyPageTag.AssemblyName.ToString(), true);
+
+ string outputTypeAsString =
+ ProjectMgr.GetProjectProperty(
+ GeneralPropertyPageTag.OutputType.ToString(), false);
+
+ OutputType outputType =
+ (OutputType)Enum.Parse(typeof (OutputType), outputTypeAsString);
+
+ return assemblyName + GetOuputExtension(outputType);
+ }
+ }
+
+ /// <summary>
+ /// Retreive the CodeDOM provider
+ /// </summary>
+ protected internal IVSMDCodeDomProvider CodeDomProvider
+ {
+ get
+ {
+ if (_codeDomProvider == null)
+ _codeDomProvider = new VSMDNemerleProvider();
+ return _codeDomProvider;
+ }
+ }
+
+ /// <summary>
+ /// Get the VSProject corresponding to this project
+ /// </summary>
+ protected internal VSLangProj.VSProject VSProject
+ {
+ get
+ {
+ if (_vsProject == null)
+ _vsProject = new OAVSProject(this);
+ return _vsProject;
+ }
+ }
+
+ IVsHierarchy InteropSafeHierarchy
+ {
+ get
+ {
+ IntPtr unknownPtr = PkgUtils.QueryInterfaceIUnknown(this);
+ if (unknownPtr == IntPtr.Zero)
+ return null;
+
+ IVsHierarchy hier = (IVsHierarchy)Marshal.GetObjectForIUnknown(
+ unknownPtr);
+ return hier;
+ }
+ }
+
+ private ProjectInfo _projectInfo;
+ public ProjectInfo ProjectInfo
+ {
+ get { return _projectInfo; }
+ set { _projectInfo = value; }
+ }
+
+ /// <summary>
+ /// Nemerle specific project images.
+ /// </summary>
+ public static ImageList NemerleImageList
+ {
+ get { return _nemerleImageList; }
+ }
+
+ #endregion
+
+ #region Overridden Properties
+
+ // Needed since ProjectNode.ImageIndex returns
+ // ProjectNode.ImageName.Application.
+ public override int ImageIndex { get { return HierarchyNode.NoImage; } }
+ public override Guid ProjectGuid { get { return typeof(NemerleProjectFactory).GUID; } }
+ public override string ProjectType { get { return GlobalConstants.LanguageName; } }
+ internal override object Object { get { return VSProject; } }
+
+ protected override ReferenceContainerNode CreateReferenceContainerNode()
+ {
+ return new ReferenceContainerNodeEx(this);
+ }
+
+ #endregion
+
+ #region Overridden Methods
+
+ // We have to override ImageIndex to be called.
+ public override object GetIconHandle(bool open)
+ {
+ return PackageUtilities.GetIntPointerFromImage(
+ NemerleProjectNode.NemerleImageList.Images[(int)GlobalConstants.ImageListIndex.NemerleProject]);
+ }
+
+ public override int Close()
+ {
+ if (null != Site)
+ {
+ INemerleLibraryManager libraryManager =
+ Site.GetService(typeof(INemerleLibraryManager)) as INemerleLibraryManager;
+
+ if (null != libraryManager)
+ libraryManager.UnregisterHierarchy(InteropSafeHierarchy);
+ }
+
+ return base.Close();
+ }
+
+ public override void Load(
+ string filename,
+ string location,
+ string name,
+ uint flags,
+ ref Guid iidProject,
+ out int canceled)
+ {
+ Trace.Assert(BuildEngine != null);
+ Trace.Assert(BuildProject != null);
+ Trace.Assert(BuildProject.FullFileName == Path.GetFullPath(filename));
+
+ // IT: ProjectInfo needs to be created before loading
+ // as we will catch assembly reference adding.
+ //
+ _projectInfo = new ProjectInfo(BuildProject, InteropSafeHierarchy, filename, location);
+
+ ProjectInfo.ProjectsInfos.Add(_projectInfo);
+
+ base.Load(filename, location, name, flags, ref iidProject, out canceled);
+
+ // WAP ask the designer service for the CodeDomProvider corresponding to the project node.
+ //
+ OleServiceProvider.AddService(typeof(SVSMDCodeDomProvider), this.CodeDomProvider, false);
+ OleServiceProvider.AddService(typeof(CodeDomProvider), CodeDomProvider.CodeDomProvider, false);
+
+ // IT: Initialization sequence is important.
+ //
+ ProjectInfo.InitListener();
+
+ INemerleLibraryManager libraryManager = Utils.GetService<INemerleLibraryManager>(Site);
+
+ if (libraryManager != null)
+ libraryManager.RegisterHierarchy(InteropSafeHierarchy);
+
+ _projectInfo.Init();
+ }
+
+ /// <summary>
+ /// Overriding to provide project general property page
+ /// </summary>
+ /// <returns></returns>
+ protected override Guid[] GetConfigurationIndependentPropertyPages()
+ {
+ return new Guid[] { typeof(GeneralPropertyPage).GUID };
+ }
+
+ /// <summary>
+ /// Returns the configuration dependent property pages.
+ /// Specify here a property page. By returning no property page the
+ /// configuartion dependent properties will be neglected. Overriding, but
+ /// current implementation does nothing. To provide configuration specific
+ /// page project property page, this should return an array bigger then 0
+ /// (you can make it do the same as
+ /// GetConfigurationIndependentPropertyPages() to see its
+ /// impact)
+ /// </summary>
+ /// <returns></returns>
+ protected override Guid[] GetConfigurationDependentPropertyPages()
+ {
+ return new Guid[] { typeof(NemerleBuildPropertyPage).GUID };
+ }
+
+ /// <summary>
+ /// Overriding to provide customization of files on add files.
+ /// This will replace tokens in the file with actual value (namespace,
+ /// class name,...)
+ /// </summary>
+ /// <param name="source">Full path to template file</param>
+ /// <param name="target">Full path to destination file</param>
+ public override void AddFileFromTemplate(string source, string target)
+ {
+ if (!File.Exists(source))
+ throw new FileNotFoundException(
+ String.Format("Template file not found: {0}", source));
+
+ // The class name is based on the new file name
+ //
+ string className = Path.GetFileNameWithoutExtension(target);
+ string namespce = FileTemplateProcessor.GetFileNamespace(target, this);
+
+ FileTemplateProcessor.AddReplace("%className%", className);
+ FileTemplateProcessor.AddReplace("%namespace%", namespce);
+
+ try
+ {
+ FileTemplateProcessor.UntokenFile(source, target);
+ }
+ catch (Exception e)
+ {
+ throw new FileLoadException("Failed to add template file to project", target, e);
+ }
+ }
+
+ /// <summary>
+ /// Evaluates if a file is an Nemerle code file based on is extension
+ /// </summary>
+ /// <param name="strFileName">The filename to be evaluated</param>
+ /// <returns>true if is a code file</returns>
+ public override bool IsCodeFile(string strFileName)
+ {
+ // We do not want to assert here, just return silently.
+ //
+ if (string.IsNullOrEmpty(strFileName))
+ return false;
+
+ return
+ string.Compare(
+ Path.GetExtension(strFileName),
+ GlobalConstants.FileExtension,
+ StringComparison.OrdinalIgnoreCase) == 0;
+ }
+
+ /// <summary>
+ /// Create a file node based on an msbuild item.
+ /// </summary>
+ /// <param name="item">The msbuild item to be analyzed</param>
+ /// <returns>NemerleFileNode or FileNode</returns>
+ public override FileNode CreateFileNode(ProjectElement item)
+ {
+ if (item == null)
+ throw new ArgumentNullException("item");
+
+ string include = item.GetMetadata(ProjectFileConstants.Include);
+ NemerleFileNode newNode = new NemerleFileNode(this, item);
+
+ newNode.OleServiceProvider.AddService(typeof(EnvDTE.Project), ProjectMgr.GetAutomationObject(), false);
+ newNode.OleServiceProvider.AddService(typeof(EnvDTE.ProjectItem), newNode.GetAutomationObject(), false);
+ newNode.OleServiceProvider.AddService(typeof(VSLangProj.VSProject), this.VSProject, false);
+
+ if (IsCodeFile(include) && item.ItemName == "Compile")
+ newNode.OleServiceProvider.AddService(typeof(SVSMDCodeDomProvider), this.CodeDomProvider, false);
+
+ return newNode;
+ }
+
+ /// <summary>
+ /// Creates the format list for the open file dialog
+ /// </summary>
+ /// <param name="formatlist">The formatlist to return</param>
+ /// <returns>Success</returns>
+ public override int GetFormatList(out string formatlist)
+ {
+ formatlist = string.Format(
+ CultureInfo.CurrentCulture,
+ Nemerle.VsIntegration.Project.SR.GetString(Nemerle.VsIntegration.Project.SR.ProjectFileExtensionFilter),
+ "\0", "\0");
+
+ return VSConstants.S_OK;
+ }
+
+ /// <summary>
+ /// This overrides the base class method to show the VS 2005 style Add
+ /// reference dialog. The ProjectNode implementation shows the VS 2003
+ /// style Add Reference dialog.
+ /// </summary>
+ /// <returns>S_OK if succeeded. Failure other wise</returns>
+ public override int AddProjectReference()
+ {
+ IVsComponentSelectorDlg2 componentDialog;
+ Guid guidEmpty = Guid.Empty;
+ VSCOMPONENTSELECTORTABINIT[] tabInit = new VSCOMPONENTSELECTORTABINIT[5];
+ string browseLocations = Path.GetDirectoryName(BaseURI.Uri.LocalPath);
+
+ // Add the .NET page.
+ //
+ tabInit[0].dwSize = (uint)Marshal.SizeOf(typeof(VSCOMPONENTSELECTORTABINIT));
+ tabInit[0].varTabInitInfo = 0;
+ tabInit[0].guidTab = VSConstants.GUID_COMPlusPage;
+
+ // Add the COM page.
+ //
+ tabInit[1].dwSize = (uint)Marshal.SizeOf(typeof(VSCOMPONENTSELECTORTABINIT));
+ tabInit[1].varTabInitInfo = 0;
+ tabInit[1].guidTab = VSConstants.GUID_COMClassicPage;
+
+ // Add the Project page.
+ //
+ tabInit[2].dwSize = (uint)Marshal.SizeOf(typeof(VSCOMPONENTSELECTORTABINIT));
+ // Tell the Add Reference dialog to call hierarchies GetProperty with
+ // the following propID to enablefiltering out ourself from the Project
+ // to Project reference
+ tabInit[2].varTabInitInfo = (int)__VSHPROPID.VSHPROPID_ShowProjInSolutionPage;
+ tabInit[2].guidTab = VSConstants.GUID_SolutionPage;
+
+ // Add the Browse page.
+ //
+ tabInit[3].dwSize = (uint)Marshal.SizeOf(typeof(VSCOMPONENTSELECTORTABINIT));
+ tabInit[3].varTabInitInfo = 0;
+ tabInit[3].guidTab = NativeMethods.GUID_BrowseFilePage;
+
+ // Add the Recent page.
+ //
+ tabInit[4].dwSize = (uint)Marshal.SizeOf(typeof (VSCOMPONENTSELECTORTABINIT));
+ tabInit[4].varTabInitInfo = 0;
+ tabInit[4].guidTab = GUID_MruPage;
+
+ uint pX = 0, pY = 0;
+
+ componentDialog = GetService(typeof (SVsComponentSelectorDlg)) as IVsComponentSelectorDlg2;
+
+ try
+ {
+ // Call the container to open the add reference dialog.
+ //
+ if (componentDialog != null)
+ {
+ // Let the project know not to show itself in the Add Project Reference Dialog page
+ //
+ ShowProjectInSolutionPage = false;
+
+ // Call the container to open the add reference dialog.
+ //
+ ErrorHandler.ThrowOnFailure(
+ componentDialog.ComponentSelectorDlg2(
+ (UInt32)
+ (__VSCOMPSELFLAGS.VSCOMSEL_MultiSelectMode |
+ __VSCOMPSELFLAGS.VSCOMSEL_IgnoreMachineName),
+ this,
+ 0,
+ null,
+ // Title
+ Microsoft.VisualStudio.Package.SR.GetString(
+ Microsoft.VisualStudio.Package.SR.AddReferenceDialogTitle),
+ "VS.AddReference", // Help topic
+ ref pX,
+ ref pY,
+ (uint)tabInit.Length,
+ tabInit,
+ ref guidEmpty,
+ "*.dll",
+ ref browseLocations));
+ }
+ }
+ catch (COMException e)
+ {
+ Trace.WriteLine("Exception : " + e.Message);
+ return e.ErrorCode;
+ }
+ finally
+ {
+ // Let the project know it can show itself in the Add Project Reference Dialog page
+ //
+ ShowProjectInSolutionPage = true;
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ protected override ConfigProvider CreateConfigProvider()
+ {
+ return new NemerleConfigProvider(this);
+ }
+
+ protected override NodeProperties CreatePropertiesObject()
+ {
+ return new NemerleProjectNodeProperties(this);
+ }
+
+ #endregion
+
+ #region IVsProjectSpecificEditorMap2 Members
+
+ public int GetSpecificEditorProperty(string mkDocument, int propid, out object result)
+ {
+ // Initialize output params.
+ //
+ result = null;
+
+ // Validate input.
+ //
+ if (string.IsNullOrEmpty(mkDocument))
+ throw new ArgumentException("Was null or empty", "mkDocument");
+
+ // Make sure that the document moniker passed to us is part of this project.
+ // We also don't care if it is not a nemerle file node.
+ //
+ uint itemid;
+
+ ErrorHandler.ThrowOnFailure(ParseCanonicalName(mkDocument, out itemid));
+
+ HierarchyNode hierNode = NodeFromItemId(itemid);
+
+ if (hierNode == null || ((hierNode as NemerleFileNode) == null))
+ return VSConstants.E_NOTIMPL;
+
+ switch (propid)
+ {
+ case (int)__VSPSEPROPID.VSPSEPROPID_UseGlobalEditorByDefault:
+ // We do not want to use global editor for form files.
+ //
+ result = true;
+ break;
+
+ case (int)__VSPSEPROPID.VSPSEPROPID_ProjectDefaultEditorName:
+ result = "Nemerle Form Editor";
+ break;
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ public int GetSpecificEditorType(string mkDocument, out Guid guidEditorType)
+ {
+ // Ideally we should at this point initalize a File extension to
+ // EditorFactory guid Map e.g. in the registry hive so that more
+ // editors can be added without changing this part of the code.
+ // Nemerle only makes usage of one Editor Factory and therefore
+ // we will return that guid.
+ //
+ guidEditorType = Nemerle.VsIntegration.Project.EditorFactory.guidEditorFactory;
+ return VSConstants.S_OK;
+ }
+
+ public int GetSpecificLanguageService(string mkDocument, out Guid guidLanguageService)
+ {
+ guidLanguageService = Guid.Empty;
+ return VSConstants.E_NOTIMPL;
+ }
+
+ public int SetSpecificEditorProperty(string mkDocument, int propid, object value)
+ {
+ return VSConstants.E_NOTIMPL;
+ }
+
+ #endregion
+
+ #region Static Methods
+
+ public static string GetOuputExtension(OutputType outputType)
+ {
+ switch (outputType)
+ {
+ case OutputType.Library: return ".dll";
+ case OutputType.Exe:
+ case OutputType.WinExe: return ".exe";
+ }
+
+ throw new InvalidOperationException();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Added: vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectNodeProperties.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Package/NemerleProjectNodeProperties.cs Thu Sep 21 06:53:20 2006
@@ -0,0 +1,69 @@
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+using Microsoft.VisualStudio.Package;
+
+using Microsoft.Samples.VisualStudio.LanguageService;
+
+namespace Nemerle.VisualStudio.Package
+{
+ [ComVisible(true)]
+ [CLSCompliant(false)]
+ [Guid(GlobalConstants.ProjectNodePropertiesGuidString)]
+ [ClassInterface(ClassInterfaceType.AutoDual)]
+ public class NemerleProjectNodeProperties : ProjectNodeProperties
+ {
+ #region ctors
+
+ public NemerleProjectNodeProperties(ProjectNode node) : base(node) {}
+
+ #endregion
+
+ #region Properties
+
+ public const string MainFilePropertyName = "MainFile";
+
+ [Browsable(false)]
+ public string OutputFileName
+ {
+ get { return ((NemerleProjectNode)(Node.ProjectMgr)).OutputFileName; }
+ }
+
+ [Browsable(false)]
+ public string MainFile
+ {
+ get { return Node.ProjectMgr.GetProjectProperty(MainFilePropertyName, true); }
+ }
+
+ [Browsable(false)]
+ public string AssemblyName
+ {
+ get { return Node.ProjectMgr.GetProjectProperty(ProjectFileConstants.AssemblyName); }
+ set { Node.ProjectMgr.SetProjectProperty(ProjectFileConstants.AssemblyName, value); }
+ }
+
+ [Browsable(false)]
+ public string DefaultNamespace
+ {
+ get { return Node.ProjectMgr.GetProjectProperty(ProjectFileConstants.RootNamespace); }
+ set { Node.ProjectMgr.SetProjectProperty(ProjectFileConstants.RootNamespace, value); }
+ }
+
+ [Browsable(false)]
+ public string RootNamespace
+ {
+ get { return Node.ProjectMgr.GetProjectProperty(ProjectFileConstants.RootNamespace); }
+ set { Node.ProjectMgr.SetProjectProperty(ProjectFileConstants.RootNamespace, value); }
+ }
+
+ [Browsable(false)]
+ public string OutputType
+ {
+ get { return Node.ProjectMgr.GetProjectProperty(ProjectFileConstants.OutputType); }
+ set { Node.ProjectMgr.SetProjectProperty(ProjectFileConstants.OutputType, value); }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Properties/AssemblyInfo.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Properties/AssemblyInfo.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Properties/AssemblyInfo.cs Thu Sep 21 06:53:20 2006
@@ -2,7 +2,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Modified: vs-plugin/trunk/Nemerle.VsIntegration/PropertyPages.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/PropertyPages.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/PropertyPages.cs Thu Sep 21 06:53:20 2006
@@ -19,7 +19,8 @@
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
+using Nemerle.VisualStudio.Package;
namespace Nemerle.VsIntegration.Project
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/RegisterSnippetsAttribute.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/RegisterSnippetsAttribute.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/RegisterSnippetsAttribute.cs Thu Sep 21 06:53:20 2006
@@ -15,7 +15,7 @@
using System.IO;
using Microsoft.VisualStudio.Shell;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
/// <summary>
/// This attribute registers code snippets for a package. The attributes on
Modified: vs-plugin/trunk/Nemerle.VsIntegration/SnippetsEnumerator.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/SnippetsEnumerator.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/SnippetsEnumerator.cs Thu Sep 21 06:53:20 2006
@@ -17,7 +17,7 @@
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.TextManager.Interop;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
internal class SnippetsEnumerator : IEnumerable<VsExpansion>
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/TextLineEventListener.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/TextLineEventListener.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/TextLineEventListener.cs Thu Sep 21 06:53:20 2006
@@ -13,7 +13,7 @@
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.TextManager.Interop;
-namespace Microsoft.Samples.VisualStudio.NemerleLanguageService
+namespace Microsoft.Samples.VisualStudio.LanguageService
{
internal class TextLineEventListener : IVsTextLinesEvents, IDisposable
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Utils.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Utils.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Utils.cs Thu Sep 21 06:53:20 2006
@@ -1,7 +1,7 @@
using System;
using System.IO;
-using Microsoft.Samples.VisualStudio.NemerleLanguageService;
+using Microsoft.Samples.VisualStudio.LanguageService;
using Nemerle.Compiler;
using System.Reflection;
More information about the svn
mailing list