ReModuRutt 為一 Visual Studio 2017 IDE 之程式碼轉換插件,主要以圖形化介面提供使用者程式碼轉換以及模組化製作轉換規則等功能。
- 執行平台 : Visual Studio 2017
- 類別 : plug-in
- 撰寫語言 : C#
ReModuRutt is a source code transformation tool plug-in on Visual Studio 2017 IDE, provides GUI to transform source code and create modular transformation rules.
- Platform : Visual Studio 2017
- Type : plug-in
- Programming language : C#
ReModuRutt 可由 Visual Studio Marketplace 下載:
- 於 Visual Studio 中點選
工具
,選擇擴充功能和更新
- 點選
線上
並搜尋ReModuRutt
- 點選安裝按鈕即可進行安裝
另外也能由此連結下載安裝。
安裝後即可在Visual Studio IDE 中之工具選單使用此服務。
ReModuRutt can download from Visual Studio Marketplace:
- In Visual Studio, on the Tools menu, click
Extensions and Updates
. - Click
Online
and then search forReModuRutt
. - Click Download. The extension is then scheduled for install.
This tool also can download from this link.
After complete the installation, user can find ReModuRutt in Visual Studio Tools menu.
主要功能可分成「規則製作 create rule」以及「程式碼轉換分析 Analysis and transferred」。
第一次使用時,需先選擇欲存放規則的資料夾(或是已存在的規則資料夾)。
範例規則可由此下載,並在選擇規則時選擇Rule
資料夾。
The main tools can be divived into create rule
and Analysis and transferred
.
When using for the first time, you need to select the folder where to store the rules, or select existing rule folder.
Sample rule files can be downloaded here, and choose folder Rule
when select existing rule folder.
step 1. 於工具列中點選create rule
step 2. 選擇已存在的規則資料夾,或是欲存放規則的資料夾 (若已選擇過則會跳過此步驟)
step 3. 點選左側列表中的規則進行編輯
- 編輯方式:
before
為轉換前規則,after
為轉換後規則
step 1. Click create rule
in the Tools menu
step 2. Select the folder where to store the rules, or select existing rule folder.(If already selected, skip this step)
step 3. Click the rule in the list on the left to edit
- How to edit :
before
is the rule edit block that before transferred,after
is the rule edit block that after transferred.- Add text : user can enter text directly, or select text in an already opened file, right-click to add it into rule edit block.
- Set block : right-click to select a piece of text as a block, or right-click to add a block.
- Clear : click the
clear
button to clear the content of rule edit block. - Copy : click the
copy from before
button to directly copy the content inbefore
rule edit block to theafter
rule edit block.
step 1. 開啟專案或檔案
step 2. 於工具列中點選 Analysis and transferred
,選擇要分析的檔案或專案並點選下一步
step 3. 選擇欲進行轉換的規則集合,並點選下一步
step 4. 確認轉換與分析之資訊
step 5. 確認轉換後結果\
step 1. Open project or file
step 2. Click Analysis and transferred
in the Tools menu, select the file to be analysis and click Next
.
step 3. Select the rule set that used to analysis and click Next
step 4. Check infomation.
step 5. Check final result.\
若欲針對此插件進行修改並重新發佈,詳細發佈方法可參照此文件,或微軟官方說明文件。
If need to edit this plug-in and republish,publish step can refer to this document, or Microsoft Visual Studio document
若要將 ReModuRutt 轉移至其他平台實作,你可以:
- 將 plug-in 讀取檔案部分去除掉,並且:
solution 1. 用其他方式取得檔案列表,並接在View\ChooseFileWindowControl.xaml.cs
上顯示。 檔案列表儲存形式請參照Model\FileTreeNode.cs
solution 2. 用其他方式讓使用者選擇欲分析的檔案,並將選擇的檔案傳至View\ChooseAnalysisWindowControl.xaml.cs
繼續後續動作 - 將 plug-in 右鍵取得目前 project 選取文字部分去除掉,用其他方式取得選取文字,並接在
Tool\StaticValue.cs
的methodpublic static void AddTextIntoRuleCreateFrame(string selectContent)
之上。
If need to transfer ReModuRutt to other platforms, you can:
- Remove read file in plug-in, and :
solution 1. Use other method to get file list,then show the file list in
View\ChooseFileWindowControl.xaml.cs
. File list form can seeModel\FileTreeNode.cs
.
solution 2. Use other methods to get file that user want to analysis, and transfer the selection file toView\ChooseAnalysisWindowControl.xaml.cs
to continue. - Remove method that right-click get selection text in project which open now, use other methods to get selection text, and transfer it to method
public static void AddTextIntoRuleCreateFrame(string selectContent)
inTool\StaticValue.cs
.
程式與 IDE 銜接的部分為PlugInModel
內的 class 以及ToolListPackage.vsct
。
- PlugInModel
- ToolListPackage.cs
- 註冊使用 visual studio plug-in
- AnalysisToolListCommand.cs
- 顯示分析轉換功能於工具選單中
- CreateRuleToolWindowCommand.cs
- 顯示規則製作功能於工具選單中
- RightClickAddRuleWindowCommand.cs
- 取得目前 project 所選取文字,並加入規則製作頁面
- PlugInTool.cs
- 用來存取 plug-in 資訊並回傳給程式中的其他模組,目前主要是用來取得 Project 列表資訊
- ToolListPackage.cs
- ToolListPackage.vsct
- plug-in 設定檔,可由此設定在工具列選單中的按鈕文字、圖式等資訊
ToolListPackage.vsct
and class that in package PlugInModel
are used to connect program and IDE.
- PlugInModel
- ToolListPackage.cs
- Register visual studio plug-in
- AnalysisToolListCommand.cs
- Display analysis and transform services in Tools menu
- CreateRuleToolWindowCommand.cs
- Display rule creator services in Tools menu
- RightClickAddRuleWindowCommand.cs
- get selection text in project which open now, add selection text into rule creation frame
- PlugInTool.cs
- Used to get plug-in information and return it to other modules in program, currently mainly used to get file list information of project which is open now.
- ToolListPackage.cs
- ToolListPackage.vsct
- plug-in setting file, can set button text, picture or other infomation in Tools menu by this setting file.