Skip to content

Commit db6e3c8

Browse files
committed
Merge branch 'development' into refactor_interface
2 parents a82d694 + 7efb67e commit db6e3c8

File tree

49 files changed

+129
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+129
-196
lines changed

External/Plugins/AS3Context/Compiler/FlexDebugger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static void debugger_OnStarted(string line)
5454
{
5555
if (startMessage == null)
5656
return;
57-
PluginBase.RunAsync((MethodInvoker)delegate
57+
PluginBase.RunAsync(delegate
5858
{
5959
// send message again
6060
ignoreMessage = true;

External/Plugins/AS3Context/Compiler/FlexShells.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ private void ascRunner_Error(object sender, string line)
508508
private void ascRunner_OutputError(object sender, string line)
509509
{
510510
if (line == null) return;
511-
PluginBase.RunAsync((MethodInvoker)delegate
511+
PluginBase.RunAsync(delegate
512512
{
513513
if (line.StartsWith("Exception "))
514514
{
@@ -563,7 +563,7 @@ private void mxmlcRunner_Error(object sender, string line)
563563

564564
private void mxmlcRunner_Output(object sender, string line)
565565
{
566-
PluginBase.RunAsync((MethodInvoker)delegate
566+
PluginBase.RunAsync(delegate
567567
{
568568
if (!notificationSent && line.StartsWith("Done("))
569569
{

External/Plugins/AS3Context/PluginMain.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Object IPlugin.Settings
9999

100100
static public AS3Settings Settings
101101
{
102-
get { return settingObject as AS3Settings; }
102+
get { return settingObject; }
103103
}
104104
#endregion
105105

@@ -156,13 +156,13 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
156156
if (PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language == "as3")
157157
e.Handled = OpenVirtualFileModel(de.Data as String);
158158
}
159-
else if (!(settingObject as AS3Settings).DisableFDB && action == "AS3Context.StartDebugger")
159+
else if (!settingObject.DisableFDB && action == "AS3Context.StartDebugger")
160160
{
161161
string workDir = (PluginBase.CurrentProject != null)
162162
? Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath)
163163
: Environment.CurrentDirectory;
164164

165-
string flexSdk = (settingObject as AS3Settings).GetDefaultSDK().Path;
165+
string flexSdk = settingObject.GetDefaultSDK().Path;
166166

167167
// if the default sdk is not defined ask for project sdk
168168
if (String.IsNullOrEmpty(flexSdk))

External/Plugins/ASCompletion/Completion/ASComplete.cs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,10 +1784,6 @@ private static void ShowListeners(ScintillaControl Sci, int position, ClassModel
17841784
CompletionList.Show(items, true, tail);
17851785
}
17861786

1787-
int CompareEvents(Object a, Object b)
1788-
{
1789-
return 0;
1790-
}
17911787
#endregion
17921788

17931789
#region dot_completion
@@ -2879,44 +2875,6 @@ private static void InferVariableType(ASExpr local, MemberModel var)
28792875
}
28802876
}
28812877

2882-
private static void FindInPackage(string token, FileModel inFile, string pkg, ASResult result)
2883-
{
2884-
IASContext context = ASContext.Context;
2885-
int p = token.IndexOf('(');
2886-
2887-
FileModel inPackage = context.ResolvePackage(pkg, false);
2888-
if (inPackage != null)
2889-
{
2890-
int pLen = pkg != null ? pkg.Length : 0;
2891-
foreach (MemberModel friend in inPackage.Imports)
2892-
{
2893-
if (friend.Name == token && (pLen == 0 || friend.Type.LastIndexOf(context.Features.dot) == pLen))
2894-
{
2895-
ClassModel friendClass = context.GetModel(inFile.Package, token, inFile.Package);
2896-
if (!friendClass.IsVoid())
2897-
{
2898-
result.Type = friendClass;
2899-
result.IsStatic = (p < 0);
2900-
return;
2901-
}
2902-
break;
2903-
}
2904-
}
2905-
foreach (MemberModel friend in inPackage.Members)
2906-
{
2907-
if (friend.Name == token)
2908-
{
2909-
result.Member = friend;
2910-
result.Type = (p < 0 && (friend.Flags & FlagType.Function) > 0)
2911-
? context.ResolveType("Function", null)
2912-
: context.ResolveType(friend.Type, friend.InFile);
2913-
return;
2914-
}
2915-
}
2916-
}
2917-
return;
2918-
}
2919-
29202878
/// <summary>
29212879
/// Find package-level member
29222880
/// </summary>
@@ -3510,19 +3468,13 @@ private static ComaExpression DisambiguateComa(ScintillaControl Sci, int positio
35103468
int braceCount = 0;
35113469
int sqCount = 0;
35123470
char c = (char)Sci.CharAt(position);
3513-
bool wasPar = false;
3514-
//if (c == '{') { wasPar = true; position--; }
35153471
while (position > minPos)
35163472
{
35173473
c = (char)Sci.CharAt(position);
35183474
if (c == ';')
35193475
{
35203476
return ComaExpression.None;
35213477
}
3522-
else if ((c == ',' || c == '=') && wasPar)
3523-
{
3524-
return ComaExpression.AnonymousObject;
3525-
}
35263478
// var declaration
35273479
else if (c == ':')
35283480
{
@@ -3543,7 +3495,6 @@ private static ComaExpression DisambiguateComa(ScintillaControl Sci, int positio
35433495
}
35443496
else if (c == ']')
35453497
{
3546-
if (wasPar) return ComaExpression.None;
35473498
sqCount++;
35483499
}
35493500
// function declaration or parameter
@@ -3565,7 +3516,6 @@ private static ComaExpression DisambiguateComa(ScintillaControl Sci, int positio
35653516
}
35663517
else if (c == ')')
35673518
{
3568-
if (wasPar) return ComaExpression.None;
35693519
parCount++;
35703520
}
35713521
// code block or anonymous object
@@ -3589,7 +3539,6 @@ private static ComaExpression DisambiguateComa(ScintillaControl Sci, int positio
35893539
}
35903540
else if (c == '}')
35913541
{
3592-
if (wasPar) return ComaExpression.None;
35933542
braceCount++;
35943543
}
35953544
else if (c == '?') return ComaExpression.AnonymousObject;

External/Plugins/ASCompletion/Completion/ASGenerator.cs

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,6 @@ private static bool GetLangIsValid()
861861

862862
#region code generation
863863

864-
static private Regex reInsert = new Regex("\\s*([a-z])", RegexOptions.Compiled);
865-
866864
static public void SetJobContext(String contextToken, String contextParam, MemberModel contextMember, Match contextMatch)
867865
{
868866
ASGenerator.contextToken = contextToken;
@@ -3081,7 +3079,7 @@ private static string GuessVarName(string name, string type)
30813079
name = name.TrimStart(new char[] { '_' });
30823080
if (name.Length > 3 && name.StartsWith("get") && (name[3].ToString() == char.ToUpper(name[3]).ToString()))
30833081
{
3084-
name = char.ToLower(name[3]).ToString() + name.Substring(4);
3082+
name = char.ToLower(name[3]) + name.Substring(4);
30853083
}
30863084

30873085
if (name.Length > 1)
@@ -3318,22 +3316,6 @@ private static void GenerateVariable(MemberModel member, int position, bool deta
33183316
InsertCode(position, result);
33193317
}
33203318

3321-
private static string ReplaceAll(string template, string oldValue, string newValue)
3322-
{
3323-
if (template == null)
3324-
return null;
3325-
3326-
string result = "";
3327-
string[] a = template.Split(new string[] { oldValue }, StringSplitOptions.None);
3328-
for (int i = 0; i < a.Length; i++)
3329-
{
3330-
if (i > 0)
3331-
result += newValue;
3332-
result += a[i];
3333-
}
3334-
return result;
3335-
}
3336-
33373319
public static bool MakePrivate(ScintillaControl Sci, MemberModel member)
33383320
{
33393321
ContextFeatures features = ASContext.Context.Features;
@@ -3762,31 +3744,6 @@ static private MemberModel FindLatest(FlagType match, Visibility visi, ClassMode
37623744
fallback = null;
37633745
return latest ?? fallback;
37643746
}
3765-
3766-
static private string GetDeclaration(MemberModel member)
3767-
{
3768-
return GetDeclaration(member, true);
3769-
}
3770-
3771-
static private string GetDeclaration(MemberModel member, bool addModifiers)
3772-
{
3773-
// modifiers
3774-
string modifiers = TemplateUtils.GetStaticExternOverride(member);
3775-
if (addModifiers) modifiers += TemplateUtils.GetModifiers(member);
3776-
3777-
// signature
3778-
FlagType ft = member.Flags;
3779-
if ((ft & FlagType.Getter) > 0)
3780-
return String.Format("{0}function get {1}", modifiers, member.ToDeclarationString());
3781-
else if ((ft & FlagType.Setter) > 0)
3782-
return String.Format("{0}function set {1}", modifiers, member.ToDeclarationString());
3783-
else if (ft == FlagType.Function)
3784-
return String.Format("{0}function {1}", modifiers, member.ToDeclarationString());
3785-
else if (((ft & FlagType.Constant) > 0) && ASContext.Context.Settings.LanguageId != "AS2")
3786-
return String.Format("{0}const {1}", modifiers, member.ToDeclarationString());
3787-
else
3788-
return String.Format("{0}var {1}", modifiers, member.ToDeclarationString());
3789-
}
37903747
#endregion
37913748

37923749
#region override generator

External/Plugins/ASCompletion/Context/ASContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ public virtual bool SetTemporaryPath(string path)
691691
return false;
692692
if (temporaryPath != null)
693693
{
694-
while (classPath.Count > 0 && (classPath[0] as PathModel).IsTemporaryPath)
694+
while (classPath.Count > 0 && classPath[0].IsTemporaryPath)
695695
{
696696
classPath[0].InUse = false;
697697
classPath.RemoveAt(0);

External/Plugins/ASCompletion/Model/ASFileParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public static TypeDefinitionKind ParseTypedCallback(string comment, MemberModel
193193
private static string getRandomStringRepl()
194194
{
195195
random.NextDouble();
196-
return "StringRepl" + random.Next(0xFFFFFFF).ToString();
196+
return "StringRepl" + random.Next(0xFFFFFFF);
197197
}
198198

199199
/// <summary>

External/Plugins/ASCompletion/Model/ClassModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public string GenerateIntrinsic(bool caching)
306306
char semi = ';';
307307
string tab0 = (!caching && InFile.Version == 3) ? "\t" : "";
308308
string tab = (caching) ? "" : ((InFile.Version == 3) ? "\t\t" : "\t");
309-
bool preventVis = (bool)((this.Flags & FlagType.Interface) > 0);
309+
bool preventVis = (this.Flags & FlagType.Interface) > 0;
310310

311311
// SPECIAL DELEGATE
312312
/*if ((Flags & FlagType.Delegate) > 0)

External/Plugins/ASCompletion/Model/PathExplorer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private bool ParseFoundFiles()
284284
{
285285
if (stopExploration) return writeCache;
286286
// parse
287-
filename = foundFiles[i] as string;
287+
filename = foundFiles[i];
288288
if (!File.Exists(filename))
289289
continue;
290290
if (pathModel.HasFile(filename))

External/Plugins/ASCompletion/Model/PathModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static public PathModel GetModel(string path, IASContext context)
6868
PathModel aPath;
6969
if (pathes.ContainsKey(modelName))
7070
{
71-
aPath = pathes[modelName] as PathModel;
71+
aPath = pathes[modelName];
7272
if (aPath.IsTemporaryPath || !aPath.IsValid || aPath.FilesCount == 0)
7373
{
7474
pathes[modelName] = aPath = new PathModel(path, context);

0 commit comments

Comments
 (0)