是否有一个自定义的语言添加为Visual Studio 2012中/ VS11? [英] Is there a custom language add-in for Visual Studio 2012 / VS11?

查看:557
本文介绍了是否有一个自定义的语言添加为Visual Studio 2012中/ VS11?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我要添加支持典当语言到Visual Studio 2012。

Well I want to add support for the PAWN language to Visual Studio 2012.

但由于缺乏经验,缺乏教程/插件,我可以编辑它确实是一个艰巨的任务。

But because of the lack of experience and lack of tutorials/add-ins which I can edit it's really a difficult task.

有关现在我只是要添加的文件类型和编译器,无需智能感知和语法高亮C语法高亮,可以使用。

For now I only want to add the filetypes and compiler, no need for intellisense and for syntax highlighting the C syntax highlighter can be used.

我知道是OOK语言实现和嘘语言,但这些加载项是VS2010,并不会编译VS2012。

I know there is the OOK Language implementation and Boo Language but those add-ins are for VS2010 and won't compile for VS2012.

我将如何做到这一点?

是否有语言加载(用于VS2012),我可以编辑/一样示范基地/用途使用?

Is there a language add-in (for VS2012) which I can edit/use as base/ use as example?

我的最后一次尝试导致了黑色的窗口/不可用VS2012 IDE。

My last attempt resulted in a black window / unusable VS2012 IDE.

推荐答案

官方语言的扩展样品铁的Python 整合的样本。

The official language extension sample for Visual Studio 2010 was the Iron Python Integration sample.

您可以从这里下载: IronPython的集成的。有一个相关的文档在这里: Visual Studio的IronPython的集成深潜

You can download it from here: IronPython Integration. There is a related documentation here: Visual Studio IronPython Integration Deep Dive

不幸的是没有更新此示例为Visual Studio 2012我的知识。但是这里有将其转换到Visual Studio 2012中的步骤

Unfortunately this sample was not updated for Visual Studio 2012 to my knowledge. However here are the steps to convert it to Visual Studio 2012.


  1. 从这里安装Visual Studio 2012 SDK:的微软的Visual Studio 2012 SDK

  2. 下载铁Python集成样本?某处提取您的硬盘上

  3. 开启 IronPython.sln ,并接受所有的升级转换

  4. 更改项目从值为anycpu 目标平台为 86

  5. 某些项目有不正确的(自动暗示)到Visual Studio 11组件(针对内置.NET 4.5)引用,所以他们将无法编译原样。改回Visual Studio的10集。例如,Microsoft.VisualStudio.ExtensibilityHosting.dll在IronPython.Console谟需要指向等效的文件中 C:\Program文件(x86)\Microsoft的Visual Studio 10.0\Common7\IDE \PrivateAssemblies

  6. 定义 IronPython.Project 项目作为启动项目,并更新它的调试参数:开始动作需要启动 C:\Program文件(x86)\Microsoft的Visual Studio 11.0\Common7\IDE\devenv.exe ( VS 2012壳)外部程序,而不是 C:\Program文件(x86)\Microsoft的Visual Studio 10.0\Common7\IDE\devenv.exe (VS 2010壳)一个是默认设置。命令行参数应设置为 / RootSuffix精通

  7. 更新所有基本模板使用VS而不仅仅是VS 2010的人2012年的目录:搜索所有.pyproj文件中的 IronPython.targets 串并添加VS 2012的情况下,像这样的:

  1. install the Visual Studio 2012 SDK from here: Microsoft Visual Studio 2012 SDK
  2. download the Iron Python integration sample, extract somewhere on your disk
  3. open IronPython.sln, and accept all upgrade conversions
  4. change the projects' platform target from AnyCpu to x86
  5. some projects have incorrect (auto hinted) references to Visual Studio 11 assemblies (built against .NET 4.5), so they won't compile as is. Change them back to Visual Studio 10 assemblies. Example, Microsoft.VisualStudio.ExtensibilityHosting.dll in the IronPython.Console projet needs to point to the equivalent file in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies.
  6. define the IronPython.Project project as the start up project, and update it's Debug parameters: the start action needs to start the C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe (VS 2012 shell) external program instead of the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe (VS 2010 shell) one that was set by default. Command line arguments should be set to /RootSuffix Exp
  7. update all base templates to use VS 2012 directories instead of only VS 2010 ones: search for the IronPython.targets string in all .pyproj file and add the VS 2012 case, like this:

  <PropertyGroup>
    <!-- Set the IronPythonPath property by proving in different locations where Iron Python could be installed -->
    <!-- Regular LocalAppData -->
    <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
    <!-- Experimental LocalAppData -->
    <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
      <!-- Integrated Shell -->
    <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0\IronPython.targets')">$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0</IronPythonPath>
  </PropertyGroup>

  <PropertyGroup>
    <!-- Set the IronPythonPath property by proving in different locations where Iron Python could be installed -->
    <!-- Regular LocalAppData -->
    <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
    <!-- Experimental LocalAppData -->
    <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
      <!-- Regular LocalAppData VS10212 -->
      <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\11.0\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
      <!-- Experimental LocalAppData VS2012-->
      <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\11.0Exp\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\11.0Exp\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
      <!-- Integrated Shell -->
    <IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0\IronPython.targets')">$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0</IronPythonPath>
  </PropertyGroup>

这就是它。编译和运行(都需要一段时间的第一时间,由于登记的奥秘)

That's it. Compile and run (both can take a while the first time due to registration mysteries).

下面是在开始从Visual Studio 2012新铁Python项目时的结果:$。 b $ b

Here is the result when starting a new Iron Python project from Visual Studio 2012:

和时建设:

and when building:

我已经张贴在这里已经VS 2012准备的解决方案下载: ironpythonintegrationvs2012.zip

I have posted an already VS 2012 prepared solution downloadable here: ironpythonintegrationvs2012.zip

这篇关于是否有一个自定义的语言添加为Visual Studio 2012中/ VS11?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆