Skip to content

Commit 1cee99d

Browse files
author
SlavaRa
committed
Merge branch 'development' into feature/ExtractLocalVariable_improvements
2 parents 0b021da + 6deb978 commit 1cee99d

File tree

18 files changed

+289
-81
lines changed

18 files changed

+289
-81
lines changed

CI/build.cmd

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ if %errorlevel% neq 0 goto :error
4545
:: Reset bin files
4646
git clean -f -x -d FlashDevelop\Bin\Debug
4747

48-
:: Remove bad files
49-
del FlashDevelop\Bin\Debug\StartPage\images\*.* /Q
48+
:: Remove unnecessary files
49+
rd "FlashDevelop\Bin\Debug\Tools\flexpmd" /s /q
50+
rd "FlashDevelop\Bin\Debug\Tools\flexlibs\frameworks\libs\player" /s /q
5051
for /d %%G in ("FlashDevelop\Bin\Debug\Projects\*ActionScript 3*") do rd /s /q "%%~G"
52+
del "FlashDevelop\Bin\Debug\StartPage\images\*.*" /q
5153

5254
:: Copy distro files
5355
xcopy Distros\HaxeDevelop /s /e /y
@@ -75,6 +77,9 @@ ren FlashDevelop\Bin\Debug\FlashDevelop64.exe HaxeDevelop64.exe
7577
ren FlashDevelop\Bin\Debug\FlashDevelop.exe.config HaxeDevelop.exe.config
7678
ren FlashDevelop\Bin\Debug\FlashDevelop64.exe.config HaxeDevelop64.exe.config
7779

80+
: Remove files after build
81+
del "FlashDevelop\Bin\Debug\Plugins\CodeAnalyzer.dll" /q
82+
7883
:: Check for build errors
7984
if %errorlevel% neq 0 goto :error
8085

@@ -88,7 +93,7 @@ if %errorlevel% neq 0 goto :error
8893
7z a -tzip FlashDevelop\Installer\Binary\HaxeDevelop.zip .\FlashDevelop\Bin\Debug\* -xr!.empty
8994

9095
:: Done
91-
exit
96+
exit 0
9297

9398
:error
9499

CI/buildl.cmd

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ if %errorlevel% neq 0 goto :error
5555
:: Reset bin files
5656
git clean -f -x -d FlashDevelop\Bin\Debug
5757

58-
:: Remove bad files
59-
del FlashDevelop\Bin\Debug\StartPage\images\*.* /Q
58+
:: Remove unnecessary files
59+
rd "FlashDevelop\Bin\Debug\Tools\flexpmd" /s /q
60+
rd "FlashDevelop\Bin\Debug\Tools\flexlibs\frameworks\libs\player" /s /q
6061
for /d %%G in ("FlashDevelop\Bin\Debug\Projects\*ActionScript 3*") do rd /s /q "%%~G"
62+
del "FlashDevelop\Bin\Debug\StartPage\images\*.*" /q
6163

6264
:: Copy distro files
6365
xcopy Distros\HaxeDevelop /s /e /y
@@ -85,6 +87,9 @@ ren FlashDevelop\Bin\Debug\FlashDevelop64.exe HaxeDevelop64.exe
8587
ren FlashDevelop\Bin\Debug\FlashDevelop.exe.config HaxeDevelop.exe.config
8688
ren FlashDevelop\Bin\Debug\FlashDevelop64.exe.config HaxeDevelop64.exe.config
8789

90+
: Remove files after build
91+
del "FlashDevelop\Bin\Debug\Plugins\CodeAnalyzer.dll" /q
92+
8893
:: Check for build errors
8994
if %errorlevel% neq 0 goto :error
9095

@@ -104,7 +109,7 @@ git stash save "Local CI Backup..."
104109

105110
:: Done, Run FD
106111
start FlashDevelop\Installer\Binary\FlashDevelop.exe
107-
exit
112+
exit 0
108113

109114
:error
110115

External/Plugins/ASCompletion/Completion/ASGenerator.cs

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public class ASGenerator
3434
static private Regex reModifier = new Regex("(public |private |protected )", RegexOptions.Compiled);
3535
static private Regex reSuperCall = new Regex("^super\\s*\\(", RegexOptions.Compiled);
3636

37-
static private string contextToken;
38-
static private string contextParam;
39-
static private Match contextMatch;
40-
static private ASResult contextResolved;
41-
static private MemberModel contextMember;
37+
static internal string contextToken;
38+
static internal string contextParam;
39+
static internal Match contextMatch;
40+
static internal ASResult contextResolved;
41+
static internal MemberModel contextMember;
4242
static private bool firstVar;
4343

4444
static private bool IsHaxe
@@ -795,21 +795,28 @@ private static void ShowDelegateList(FoundDeclaration found, List<ICompletionLis
795795
options.Add(new GeneratorItem(label, GeneratorJobType.Delegate, found.member, found.inClass));
796796
}
797797

798-
private static void ShowEventList(FoundDeclaration found, List<ICompletionListItem> options)
798+
internal static void ShowEventList(FoundDeclaration found, List<ICompletionListItem> options)
799799
{
800800
string tmp = TextHelper.GetString("ASCompletion.Label.GenerateHandler");
801801
string labelEvent = String.Format(tmp, "Event");
802802
string labelDataEvent = String.Format(tmp, "DataEvent");
803803
string labelContext = String.Format(tmp, contextParam);
804-
string[] choices = (contextParam != "Event") ?
805-
new string[] { labelContext, labelEvent } :
806-
new string[] { labelEvent, labelDataEvent };
804+
string[] choices;
805+
if (contextParam != "Event") choices = new string[] { labelContext, labelEvent };
806+
else if (HasDataEvent()) choices = new string[] { labelEvent, labelDataEvent };
807+
else choices = new string[] { labelEvent };
808+
807809
for (int i = 0; i < choices.Length; i++)
808810
{
809811
options.Add(new GeneratorItem(choices[i],
810812
choices[i] == labelContext ? GeneratorJobType.ComplexEvent : GeneratorJobType.BasicEvent,
811813
found.member, found.inClass));
812814
}
815+
}
816+
817+
private static bool HasDataEvent()
818+
{
819+
return !ASContext.Context.ResolveType("flash.events.DataEvent", ASContext.Context.CurrentModel).IsVoid();
813820
}
814821

815822
private static void ShowGetSetList(FoundDeclaration found, List<ICompletionListItem> options)
@@ -3553,22 +3560,12 @@ private static void GenerateEventHandler(string name, string type, MemberModel a
35533560
ClassModel eventClass = ASContext.Context.ResolveType(type, ASContext.Context.CurrentModel);
35543561
if (eventClass.IsVoid())
35553562
{
3556-
if (type == "Event")
3557-
{
3558-
List<string> typesUsed = new List<string>();
3559-
typesUsed.Add("flash.events.Event");
3560-
delta = AddImportsByName(typesUsed, sci.LineFromPosition(position));
3561-
position += delta;
3562-
sci.SetSel(position, position);
3563-
}
3564-
else if (type == "DataEvent")
3565-
{
3566-
List<string> typesUsed = new List<string>();
3567-
typesUsed.Add("flash.events.DataEvent");
3568-
delta = AddImportsByName(typesUsed, sci.LineFromPosition(position));
3569-
position += delta;
3570-
sci.SetSel(position, position);
3571-
}
3563+
if (TryImportType("flash.events." + type, ref delta, sci.LineFromPosition(position)))
3564+
{
3565+
position += delta;
3566+
sci.SetSel(position, position);
3567+
}
3568+
else type = null;
35723569
}
35733570
lookupPosition += delta;
35743571
string acc = GetPrivateAccessor(afterMethod, inClass);
@@ -3592,6 +3589,18 @@ private static void GenerateEventHandler(string name, string type, MemberModel a
35923589
{
35933590
sci.EndUndoAction();
35943591
}
3592+
}
3593+
3594+
private static bool TryImportType(string type, ref int delta, int atLine)
3595+
{
3596+
ClassModel eventClass = ASContext.Context.ResolveType(type, ASContext.Context.CurrentModel);
3597+
if (eventClass.IsVoid())
3598+
return false;
3599+
3600+
List<string> typesUsed = new List<string>();
3601+
typesUsed.Add(type);
3602+
delta += AddImportsByName(typesUsed, atLine);
3603+
return true;
35953604
}
35963605

35973606
static private string AddRemoveEvent(string eventName)
@@ -4586,7 +4595,7 @@ public Object Data
45864595
}
45874596
}
45884597

4589-
class FoundDeclaration
4598+
internal class FoundDeclaration
45904599
{
45914600
public MemberModel member;
45924601
public ClassModel inClass;

External/Plugins/FileExplorer/PluginMain.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class PluginMain : IPlugin
2828
private DockContent pluginPanel;
2929
private PluginUI pluginUI;
3030
private Image pluginImage;
31-
3231
private const String explorerAction = "explorer.exe /e,{0}";
3332
private const String cmdAction = "cmd.exe";
3433

@@ -131,6 +130,10 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
131130
{
132131
switch (e.Type)
133132
{
133+
case EventType.UIStarted:
134+
this.pluginUI.Initialize(null, null);
135+
break;
136+
134137
case EventType.Command:
135138
DataEvent evnt = (DataEvent)e;
136139
switch (evnt.Action)
@@ -272,7 +275,7 @@ public void InitBasics()
272275
/// </summary>
273276
public void AddEventHandlers()
274277
{
275-
EventType eventMask = EventType.Command | EventType.FileOpen;
278+
EventType eventMask = EventType.Command | EventType.FileOpen | EventType.UIStarted;
276279
EventManager.AddEventHandler(this, eventMask, HandlingPriority.Low);
277280
}
278281

External/Plugins/FileExplorer/PluginUI.cs

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,38 @@
1010
using PluginCore.Localization;
1111
using PluginCore.Managers;
1212
using PluginCore.Utilities;
13+
using Ookii.Dialogs;
1314

1415
namespace FileExplorer
1516
{
1617
public class PluginUI : DockPanelControl
1718
{
18-
private System.Windows.Forms.ListViewEx fileView;
19-
private System.Windows.Forms.ToolStrip toolStrip;
20-
private System.Windows.Forms.ContextMenuStrip menu;
21-
private System.Windows.Forms.ToolStripMenuItem runButton;
22-
private System.Windows.Forms.ToolStripMenuItem editButton;
23-
private System.Windows.Forms.ToolStripMenuItem renameButton;
24-
private System.Windows.Forms.ToolStripMenuItem deleteButton;
25-
private System.Windows.Forms.ToolStripMenuItem shellButton;
26-
private System.Windows.Forms.ToolStripMenuItem pasteButton;
27-
private System.Windows.Forms.ToolStripMenuItem copyButton;
28-
private System.Windows.Forms.ToolStripSeparator separator;
29-
private System.Windows.Forms.ToolStripSpringComboBox selectedPath;
30-
private System.Windows.Forms.ToolStripButton browseButton;
31-
private System.Windows.Forms.ToolStripButton syncronizeButton;
32-
private System.Windows.Forms.ColumnHeader fileHeader;
33-
private System.Windows.Forms.ColumnHeader sizeHeader;
34-
private System.Windows.Forms.ColumnHeader typeHeader;
35-
private System.Windows.Forms.ColumnHeader modifiedHeader;
36-
private Ookii.Dialogs.VistaFolderBrowserDialog folderBrowserDialog;
37-
private System.Windows.Forms.ListViewItem highlightedItem;
19+
private ListViewEx fileView;
20+
private ToolStrip toolStrip;
21+
private ContextMenuStrip menu;
22+
private ToolStripMenuItem runButton;
23+
private ToolStripMenuItem editButton;
24+
private ToolStripMenuItem renameButton;
25+
private ToolStripMenuItem deleteButton;
26+
private ToolStripMenuItem shellButton;
27+
private ToolStripMenuItem pasteButton;
28+
private ToolStripMenuItem copyButton;
29+
private ToolStripSeparator separator;
30+
private ToolStripSpringComboBox selectedPath;
31+
private ToolStripButton browseButton;
32+
private ToolStripButton syncronizeButton;
33+
private ColumnHeader fileHeader;
34+
private ColumnHeader sizeHeader;
35+
private ColumnHeader typeHeader;
36+
private ColumnHeader modifiedHeader;
37+
private VistaFolderBrowserDialog folderBrowserDialog;
38+
private ListViewItem highlightedItem;
3839
private ImageListManager imageList;
39-
private System.Boolean updateInProgress;
40-
private System.String previousItemLabel;
41-
private System.String autoSelectItem;
42-
private System.Int64 lastUpdateTimeStamp;
43-
private System.Int32 prevColumnClick;
40+
private Boolean updateInProgress;
41+
private String previousItemLabel;
42+
private String autoSelectItem;
43+
private Int64 lastUpdateTimeStamp;
44+
private Int32 prevColumnClick;
4445
private ListViewSorter listViewSorter;
4546
private FileSystemWatcher watcher;
4647
private PluginMain pluginMain;
@@ -204,16 +205,6 @@ private void InitializeComponent()
204205

205206
#region Methods And Event Handlers
206207

207-
/// <summary>
208-
/// We have to do final initialization here because we might
209-
/// need to have a window handle to pre-populate the file list.
210-
/// </summary>
211-
protected override void OnCreateControl()
212-
{
213-
base.OnCreateControl();
214-
this.Initialize(null, null);
215-
}
216-
217208
/// <summary>
218209
/// Shows the explorer shell menu
219210
/// </summary>
@@ -359,7 +350,7 @@ public void AddToMRU(String path)
359350
/// <summary>
360351
/// List last open path on load
361352
/// </summary>
362-
private void Initialize(Object sender, System.EventArgs e)
353+
public void Initialize(Object sender, System.EventArgs e)
363354
{
364355
String path = PathHelper.AppDir;
365356
String pathToCheck = this.pluginMain.Settings.FilePath;

External/Plugins/ResultsPanel/PluginUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public void AddLogEntries()
647647
String projectDir = project != null ? Path.GetDirectoryName(project.ProjectPath) : "";
648648
Boolean limitMode = (count - this.logCount) > 1000;
649649
this.entriesView.BeginUpdate();
650-
for (Int32 i = this.logCount; i < (limitMode ? 1000 : count); i++)
650+
for (Int32 i = this.logCount; i < (limitMode ? this.logCount + 1000 : count); i++)
651651
{
652652
entry = TraceManager.TraceLog[i];
653653
if (entry.Message != null && entry.Message.Length > 7 && entry.Message.IndexOf(':') > 0)

FlashDevelop/Bin/Debug/FDMT.cmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
:init
21
@echo off
32
cd /d %~dp0
43
echo FlashDevelop Maintenance Tool - v1.0.0
@@ -47,4 +46,3 @@ goto :menu
4746

4847
:end
4948
exit 0
50-

FlashDevelop/Bin/Debug/FDOPT.cmd

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@echo off
2+
echo FlashDevelop OPtimizer Tool - v1.0.0
3+
echo.
4+
echo ! Make sure you have admin rights or run this as an admin !
5+
echo.
6+
7+
:: Set paths
8+
cd %~dp0%
9+
set CDIR=%~dp0%
10+
set PDIR=%~dp0%Plugins
11+
set NGEN=%WINDIR%\Microsoft.NET\Framework\v2.0.50727\ngen.exe
12+
13+
if "%1" == "install" goto :install
14+
if "%1" == "uninstall" goto :uninstall
15+
16+
:menu
17+
echo *** Available tasks ***
18+
echo.
19+
echo [1] Optimize with NGEN
20+
echo [2] Remove NGEN optimizations
21+
echo [3] Exit, I'm done.
22+
echo.
23+
set /p option="What do you want me to do? "
24+
if "%option%" == "1" goto :install
25+
if "%option%" == "2" goto :uninstall
26+
if "%option%" == "3" goto :end
27+
echo Invalid option, try again.
28+
echo.
29+
goto :menu
30+
31+
:install
32+
33+
echo Optimizing with NGEN...
34+
if exist "%CDIR%HaxeDevelop.exe" "%NGEN%" install "%CDIR%HaxeDevelop.exe" /AppBase:"%CDIR%\"
35+
if exist "%CDIR%FlashDevelop.exe" "%NGEN%" install "%CDIR%FlashDevelop.exe" /AppBase:"%CDIR%\"
36+
"%NGEN%" install "%CDIR%Aga.dll" /AppBase:"%CDIR%\"
37+
"%NGEN%" install "%CDIR%SwfOp.dll" /AppBase:"%CDIR%\"
38+
"%NGEN%" install "%CDIR%Antlr3.dll" /AppBase:"%CDIR%\"
39+
"%NGEN%" install "%CDIR%Scripting.dll" /AppBase:"%CDIR%\"
40+
"%NGEN%" install "%CDIR%Tools\fdbuild\fdbuild.exe" /AppBase:"%CDIR%Tools\fdbuild"
41+
"%NGEN%" install "%CDIR%Tools\asdocgen\ASDocGen.exe" /AppBase:"%CDIR%Tools\asdocgen"
42+
"%NGEN%" install "%CDIR%Tools\appman\AppMan.exe" /AppBase:"%CDIR%Tools\appman"
43+
:: Install plugins?
44+
:: for %%G in ("%PDIR%\*.dll") do "%NGEN%" install "%%G" /AppBase:"%CDIR%\"
45+
goto :end
46+
47+
:uninstall
48+
49+
echo Removing NGEN optimizations...
50+
if exist "%CDIR%HaxeDevelop.exe" "%NGEN%" uninstall "%CDIR%HaxeDevelop.exe"
51+
if exist "%CDIR%FlashDevelop.exe" "%NGEN%" uninstall "%CDIR%FlashDevelop.exe"
52+
"%NGEN%" uninstall "%CDIR%Aga.dll"
53+
"%NGEN%" uninstall "%CDIR%SwfOp.dll"
54+
"%NGEN%" uninstall "%CDIR%Antlr3.dll"
55+
"%NGEN%" uninstall "%CDIR%Scripting.dll"
56+
"%NGEN%" uninstall "%CDIR%Tools\fdbuild\fdbuild.exe"
57+
"%NGEN%" uninstall "%CDIR%Tools\asdocgen\ASDocGen.exe"
58+
"%NGEN%" uninstall "%CDIR%Tools\appman\AppMan.exe"
59+
:: Uninstall plugins?
60+
:: for %%G in ("%PDIR%\*.dll") do "%NGEN%" uninstall "%%G"
61+
goto :end
62+
63+
:end
64+
echo Done.
65+
exit 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
$(Modifiers) function $(Name)(e:$(Type)):$(Void) $(CSLB){
1+
$(Modifiers) function $(Name)(e<<:$(Type)>>):$(Void) $(CSLB){
22
$(EntryPoint)
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
$(Modifiers) function $(Name)(e:$(Type)):$(Void) $(CSLB){
2+
$(Modifiers) function $(Name)(e<<:$(Type)>>):$(Void) $(CSLB){
33
$(EntryPoint)
44
}

0 commit comments

Comments
 (0)