Skip to content

Commit 2ca18af

Browse files
committed
Merge pull request #965 from Neverbirth/minor_cleanup
Minor cleanup
2 parents b012407 + 38b7274 commit 2ca18af

File tree

3 files changed

+0
-117
lines changed

3 files changed

+0
-117
lines changed

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: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,6 @@ private static bool GetLangIsValid()
863863

864864
#region code generation
865865

866-
static private Regex reInsert = new Regex("\\s*([a-z])", RegexOptions.Compiled);
867-
868866
static public void SetJobContext(String contextToken, String contextParam, MemberModel contextMember, Match contextMatch)
869867
{
870868
ASGenerator.contextToken = contextToken;
@@ -3253,22 +3251,6 @@ private static void GenerateVariable(MemberModel member, int position, bool deta
32533251
InsertCode(position, result);
32543252
}
32553253

3256-
private static string ReplaceAll(string template, string oldValue, string newValue)
3257-
{
3258-
if (template == null)
3259-
return null;
3260-
3261-
string result = "";
3262-
string[] a = template.Split(new string[] { oldValue }, StringSplitOptions.None);
3263-
for (int i = 0; i < a.Length; i++)
3264-
{
3265-
if (i > 0)
3266-
result += newValue;
3267-
result += a[i];
3268-
}
3269-
return result;
3270-
}
3271-
32723254
public static bool MakePrivate(ScintillaControl Sci, MemberModel member)
32733255
{
32743256
ContextFeatures features = ASContext.Context.Features;
@@ -3714,31 +3696,6 @@ static private MemberModel FindLatest(FlagType match, Visibility visi, ClassMode
37143696
fallback = null;
37153697
return latest ?? fallback;
37163698
}
3717-
3718-
static private string GetDeclaration(MemberModel member)
3719-
{
3720-
return GetDeclaration(member, true);
3721-
}
3722-
3723-
static private string GetDeclaration(MemberModel member, bool addModifiers)
3724-
{
3725-
// modifiers
3726-
string modifiers = TemplateUtils.GetStaticExternOverride(member);
3727-
if (addModifiers) modifiers += TemplateUtils.GetModifiers(member);
3728-
3729-
// signature
3730-
FlagType ft = member.Flags;
3731-
if ((ft & FlagType.Getter) > 0)
3732-
return String.Format("{0}function get {1}", modifiers, member.ToDeclarationString());
3733-
else if ((ft & FlagType.Setter) > 0)
3734-
return String.Format("{0}function set {1}", modifiers, member.ToDeclarationString());
3735-
else if (ft == FlagType.Function)
3736-
return String.Format("{0}function {1}", modifiers, member.ToDeclarationString());
3737-
else if (((ft & FlagType.Constant) > 0) && ASContext.Context.Settings.LanguageId != "AS2")
3738-
return String.Format("{0}const {1}", modifiers, member.ToDeclarationString());
3739-
else
3740-
return String.Format("{0}var {1}", modifiers, member.ToDeclarationString());
3741-
}
37423699
#endregion
37433700

37443701
#region override generator

External/Plugins/ASCompletion/Model/ASFileParser.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,29 +1030,6 @@ public void ParseSrc(FileModel fileModel, string ba, bool allowBaReExtract)
10301030
continue;
10311031
}
10321032
}
1033-
else if (inValue && (inParams || inType || inConst)
1034-
&& c1 == '/' && valueLength == 0) // lookup native regex
1035-
{
1036-
int itemp = i;
1037-
valueBuffer[valueLength++] = '/';
1038-
while (valueLength < VALUE_BUFFER && i < len)
1039-
{
1040-
c1 = ba[i++];
1041-
if (c1 == '\n' || c1 == '\r')
1042-
{
1043-
valueLength = 0;
1044-
i = itemp;
1045-
break;
1046-
}
1047-
valueBuffer[valueLength++] = c1;
1048-
if (c1 == '\\' && i < len)
1049-
{
1050-
c1 = ba[i++];
1051-
valueBuffer[valueLength++] = c1;
1052-
}
1053-
else if (c1 == '/') break;
1054-
}
1055-
}
10561033
else if ((c1 == ':' || c1 == ',') && paramBraceCount > 0) stopParser = true;
10571034

10581035
// end of value

0 commit comments

Comments
 (0)