Skip to content

Commit ea2d8ef

Browse files
committed
Merge branch 'development' into distro_haxedevelop
2 parents a108213 + c0eca71 commit ea2d8ef

File tree

25 files changed

+665
-424
lines changed

25 files changed

+665
-424
lines changed

External/Plugins/AS3Context/Context.cs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -334,23 +334,14 @@ public override void BuildClassPath()
334334
}
335335

336336
// intrinsics (deprecated, excepted for FP10 Vector.<T>)
337-
string fp9cp = as3settings.AS3ClassPath + S + "FP9";
338-
AddPath(PathHelper.ResolvePath(fp9cp));
339-
if (majorVersion > 9)
337+
// add from the highest version number (FP11 > FP10 > FP9)
338+
string fp = as3settings.AS3ClassPath + S + "FP";
339+
for (int i = majorVersion; i >= 9; i--)
340340
{
341-
for (int i = 10; i <= majorVersion; i++)
342-
{
343-
string fp10cp = as3settings.AS3ClassPath + S + "FP" + i;
344-
AddPath(PathHelper.ResolvePath(fp10cp));
345-
for (int j = 1; j <= minorVersion; j++)
346-
{
347-
string fp101cp = as3settings.AS3ClassPath + S + "FP" + majorVersion + "." + minorVersion;
348-
AddPath(PathHelper.ResolvePath(fp101cp));
349-
}
350-
}
341+
AddPath(PathHelper.ResolvePath(fp + i));
351342
}
352343

353-
// add external pathes
344+
// add external paths
354345
List<PathModel> initCP = classPath;
355346
classPath = new List<PathModel>();
356347
if (contextSetup.Classpath != null)
@@ -361,20 +352,20 @@ public override void BuildClassPath()
361352

362353
// add library
363354
AddPath(PathHelper.LibraryDir + S + "AS3" + S + "classes");
364-
// add user pathes from settings
355+
// add user paths from settings
365356
if (settings.UserClasspath != null && settings.UserClasspath.Length > 0)
366357
{
367358
foreach (string cpath in settings.UserClasspath) AddPath(cpath.Trim());
368359
}
369360

370-
// add initial pathes
361+
// add initial paths
371362
foreach (PathModel mpath in initCP) AddPath(mpath);
372363

373364
// parse top-level elements
374365
InitTopLevelElements();
375366
if (cFile != null) UpdateTopLevelElements();
376367

377-
// add current temporaty path
368+
// add current temporary path
378369
if (temporaryPath != null)
379370
{
380371
string tempPath = temporaryPath;

External/Plugins/ASCompletion/Completion/ASComplete.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,7 @@ static private bool HandleDotCompletion(ScintillaControl Sci, bool autoHide)
19201920
result = new ASResult();
19211921
if (expr.Separator == '"')
19221922
{
1923-
tmpClass = ctx.ResolveType("String", null);
1923+
tmpClass = ctx.ResolveType(ctx.Features.stringKey, null);
19241924
result.Type = tmpClass;
19251925
dotIndex = 1;
19261926
}
@@ -2513,7 +2513,7 @@ static private ASResult EvalExpression(string expression, ASExpr context, FileMo
25132513
else if (token == "\"") // literal string
25142514
{
25152515
head = new ASResult();
2516-
head.Type = ASContext.Context.ResolveType("String", null);
2516+
head.Type = ASContext.Context.ResolveType(ASContext.Context.Features.stringKey, null);
25172517
}
25182518
else head = EvalVariable(token, context, inFile, inClass); // regular eval
25192519

External/Plugins/ASCompletion/Completion/ASGenerator.cs

Lines changed: 133 additions & 141 deletions
Large diffs are not rendered by default.

External/Plugins/ASCompletion/PluginMain.cs

Lines changed: 58 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
446446
// Actionscript context specific
447447
//
448448
if (ASContext.Context.IsFileValid)
449+
{
449450
switch (e.Type)
450451
{
451452
case EventType.ProcessArgs:
@@ -480,65 +481,67 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
480481
if (command.StartsWith("ASCompletion.", StringComparison.Ordinal))
481482
{
482483
string cmdData = de.Data as string;
483-
// run MTASC
484-
if (command == "ASCompletion.CustomBuild")
484+
switch (command)
485485
{
486-
if (cmdData != null) ASContext.Context.RunCMD(cmdData);
487-
else ASContext.Context.RunCMD("");
488-
e.Handled = true;
489-
}
486+
// run MTASC
487+
case "ASCompletion.CustomBuild":
488+
if (cmdData != null) ASContext.Context.RunCMD(cmdData);
489+
else ASContext.Context.RunCMD("");
490+
e.Handled = true;
491+
break;
490492

491-
// build the SWF using MTASC
492-
else if (command == "ASCompletion.QuickBuild")
493-
{
494-
ASContext.Context.BuildCMD(false);
495-
e.Handled = true;
496-
}
493+
// build the SWF using MTASC
494+
case "ASCompletion.QuickBuild":
495+
ASContext.Context.BuildCMD(false);
496+
e.Handled = true;
497+
break;
497498

498-
// resolve element under cursor and open declaration
499-
else if (command == "ASCompletion.GotoDeclaration")
500-
{
501-
ASComplete.DeclarationLookup(sci);
502-
e.Handled = true;
503-
}
499+
// resolve element under cursor and open declaration
500+
case "ASCompletion.GotoDeclaration":
501+
ASComplete.DeclarationLookup(sci);
502+
e.Handled = true;
503+
break;
504504

505-
// resolve element under cursor and send a CustomData event
506-
else if (command == "ASCompletion.ResolveElement")
507-
{
508-
ASComplete.ResolveElement(sci, cmdData);
509-
e.Handled = true;
510-
}
511-
else if (command == "ASCompletion.MakeIntrinsic")
512-
{
513-
ASContext.Context.MakeIntrinsic(cmdData);
514-
e.Handled = true;
515-
}
505+
// resolve element under cursor and send a CustomData event
506+
case "ASCompletion.ResolveElement":
507+
ASComplete.ResolveElement(sci, cmdData);
508+
e.Handled = true;
509+
break;
516510

517-
// alternative to default shortcuts
518-
else if (command == "ASCompletion.CtrlSpace")
519-
{
520-
ASComplete.OnShortcut(Keys.Control | Keys.Space, ASContext.CurSciControl);
521-
e.Handled = true;
522-
}
523-
else if (command == "ASCompletion.CtrlShiftSpace")
524-
{
525-
ASComplete.OnShortcut(Keys.Control | Keys.Shift | Keys.Space, ASContext.CurSciControl);
526-
e.Handled = true;
527-
}
528-
else if (command == "ASCompletion.CtrlAltSpace")
529-
{
530-
ASComplete.OnShortcut(Keys.Control | Keys.Alt | Keys.Space, ASContext.CurSciControl);
531-
e.Handled = true;
532-
}
533-
else if (command == "ASCompletion.ContextualGenerator")
534-
{
535-
if (ASContext.HasContext && ASContext.Context.IsFileValid)
536-
{
537-
var options = ASGenerator.ContextualGenerator(ASContext.CurSciControl);
538-
var dataEvent = new DataEvent(EventType.Command, "ASCompletion.ContextualGenerator.AddOptions", options);
539-
EventManager.DispatchEvent(this, dataEvent);
540-
CompletionList.Show(options, false);
541-
}
511+
case "ASCompletion.MakeIntrinsic":
512+
ASContext.Context.MakeIntrinsic(cmdData);
513+
e.Handled = true;
514+
break;
515+
516+
// alternative to default shortcuts
517+
case "ASCompletion.CtrlSpace":
518+
ASComplete.OnShortcut(Keys.Control | Keys.Space, ASContext.CurSciControl);
519+
e.Handled = true;
520+
break;
521+
522+
case "ASCompletion.CtrlShiftSpace":
523+
ASComplete.OnShortcut(Keys.Control | Keys.Shift | Keys.Space, ASContext.CurSciControl);
524+
e.Handled = true;
525+
break;
526+
527+
case "ASCompletion.CtrlAltSpace":
528+
ASComplete.OnShortcut(Keys.Control | Keys.Alt | Keys.Space, ASContext.CurSciControl);
529+
e.Handled = true;
530+
break;
531+
532+
case "ASCompletion.ContextualGenerator":
533+
if (ASContext.HasContext && ASContext.Context.IsFileValid)
534+
{
535+
var options = new List<ICompletionListItem>();
536+
ASGenerator.ContextualGenerator(ASContext.CurSciControl, options);
537+
EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "ASCompletion.ContextualGenerator.AddOptions", options));
538+
if (options.Count == 0)
539+
{
540+
PluginBase.MainForm.StatusLabel.Text = TextHelper.GetString("Info.NoContextGeneratorCode");
541+
}
542+
CompletionList.Show(options, false);
543+
}
544+
break;
542545
}
543546
}
544547
return;
@@ -548,6 +551,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
548551
ASContext.Context.OnProcessEnd(procResult);
549552
break;
550553
}
554+
}
551555
}
552556
catch(Exception ex)
553557
{

External/Plugins/CodeRefactor/RefactorItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public RefactorItem(ToolStripItem item)
2525
this.item = item;
2626
label = Regex.Replace(item.Text, "[&.]", string.Empty);
2727
description = TextHelper.GetString("Label.Refactor").Replace("&", string.Empty);
28-
icon = new Bitmap(item.Image ?? PluginBase.MainForm.FindImage("452")); //452 or 473
28+
icon = (Bitmap) (item.Image ?? PluginBase.MainForm.FindImage("452")); //452 or 473
2929
}
3030

3131
public string Description

External/Plugins/ProjectManager/Controls/Icons.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public static FDImage GetResource(string resourceID)
208208
catch {
209209
image = new Bitmap(16, 16);
210210
}
211-
image = (Bitmap)PluginBase.MainForm.ImageSetAdjust(image);
211+
image = (Bitmap)PluginBase.MainForm.GetAutoAdjustedImage(image);
212212
imageList.Images.Add(ScaleHelper.Scale(image));
213213
return new FDImage(image,imageList.Images.Count-1);
214214
}
@@ -255,7 +255,7 @@ public static FDImage ExtractIconIfNecessary(string file)
255255
{
256256
Icon icon = IconExtractor.GetFileIcon(file, true);
257257
Image image = ScaleHelper.Scale(icon.ToBitmap());
258-
image = (Bitmap)PluginBase.MainForm.ImageSetAdjust(image);
258+
image = (Bitmap)PluginBase.MainForm.GetAutoAdjustedImage(image);
259259
icon.Dispose(); imageList.Images.Add(image);
260260
int index = imageList.Images.Count - 1; // of the icon we just added
261261
FDImage fdImage = new FDImage(image, index);

External/Plugins/ProjectManager/Controls/TreeBar.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using System.Windows.Forms;
2-
using PluginCore.Localization;
31
using System.Drawing;
4-
using PluginCore.Helpers;
2+
using System.Windows.Forms;
53
using PluginCore;
64
using PluginCore.Controls;
5+
using PluginCore.Helpers;
6+
using PluginCore.Localization;
77
using ProjectManager.Controls.TreeView;
88

99
namespace ProjectManager.Controls
@@ -50,7 +50,6 @@ public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
5050
Synchronize = new ToolStripButton(Icons.SyncToFile.Img);
5151
Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
5252
Synchronize.Padding = new Padding(0);
53-
Synchronize.Checked = PluginMain.Settings.TrackActiveDocument;
5453
PluginBase.MainForm.RegisterShortcutItem("ProjectTree.LocateActiveFile", Keys.Shift | Keys.Alt | Keys.L);
5554
PluginBase.MainForm.RegisterSecondaryItem("ProjectTree.LocateActiveFile", Synchronize);
5655

External/Plugins/ProjectManager/PluginMain.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public void Initialize()
234234
pluginUI.ImportProject += delegate { ImportProject(); };
235235
pluginUI.Rename += fileActions.Rename;
236236
pluginUI.TreeBar.ShowHidden.Click += delegate { ToggleShowHidden(); };
237-
pluginUI.TreeBar.Synchronize.Click += delegate { ToggleTrackActiveDocument(); };
237+
pluginUI.TreeBar.Synchronize.Click += delegate { TreeSyncToCurrentFile(); };
238238
pluginUI.TreeBar.SynchronizeMain.Click += delegate { TreeSyncToMainFile(); };
239239
pluginUI.TreeBar.CollapseAll.Click += delegate { CollapseAll(); };
240240
pluginUI.TreeBar.ProjectProperties.Click += delegate { OpenProjectProperties(); };
@@ -577,7 +577,7 @@ private bool HandleKeyEvent(KeyEvent ke)
577577
}
578578
else if (shortcutId == "ProjectTree.LocateActiveFile")
579579
{
580-
ToggleTrackActiveDocument();
580+
TreeSyncToCurrentFile();
581581
}
582582

583583
// Handle tree-level simple shortcuts like copy/paste/del
@@ -1619,16 +1619,6 @@ private void CollapseAll()
16191619
}
16201620
}
16211621

1622-
private void ToggleTrackActiveDocument()
1623-
{
1624-
bool newValue = !Settings.TrackActiveDocument;
1625-
pluginUI.TreeBar.Synchronize.Checked = newValue;
1626-
Settings.TrackActiveDocument = newValue;
1627-
1628-
if (newValue)
1629-
TreeSyncToCurrentFile();
1630-
}
1631-
16321622
private void TreeSyncToCurrentFile()
16331623
{
16341624
ITabbedDocument doc = PluginBase.MainForm.CurrentDocument;
@@ -1637,7 +1627,11 @@ private void TreeSyncToCurrentFile()
16371627
string path = doc.FileName;
16381628

16391629
if (Tree.SelectedNode != null && Tree.SelectedNode.BackingPath == path)
1630+
{
1631+
Tree.SelectedNode.EnsureVisible();
1632+
Tree.PathToSelect = null;
16401633
return;
1634+
}
16411635

16421636
Tree.Select(path);
16431637
if (Tree.SelectedNode.BackingPath == path)

External/Plugins/ProjectManager/PluginUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
using System;
22
using System.IO;
3+
using System.Collections.Generic;
34
using System.Drawing;
45
using System.Windows.Forms;
56
using ProjectManager.Actions;
67
using ProjectManager.Controls;
78
using ProjectManager.Controls.TreeView;
89
using ProjectManager.Projects;
10+
using PluginCore;
911
using PluginCore.Localization;
1012
using PluginCore.Managers;
11-
using PluginCore;
12-
using System.Collections.Generic;
1313

1414
namespace ProjectManager
1515
{

0 commit comments

Comments
 (0)