Skip to content

Commit 7850d9e

Browse files
committed
Merge branch 'development' of https://github.com/fdorg/flashdevelop into development
2 parents a2fb2c3 + e37a790 commit 7850d9e

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

External/Plugins/ASClassWizard/PluginMain.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ private string ProcessFileTemplate(string args)
361361
foreach (MemberModel param in member.Parameters)
362362
{
363363
if (param.Name.StartsWith(".")) break;
364-
superConstructor += (index > 0 ? ", " : "") + param.Name;
364+
var pname = TemplateUtils.GetParamName(param);
365+
superConstructor += (index > 0 ? ", " : "") + pname;
365366
index++;
366367
}
367368
superConstructor += ");\n" + (lastFileOptions.Language == "as3" ? "\t\t\t" : "\t\t");

External/Plugins/ASCompletion/Completion/ASGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4207,7 +4207,7 @@ private static string GetSuperCall(MemberModel member, List<string> typesUsed, C
42074207
foreach (MemberModel param in member.Parameters)
42084208
{
42094209
if (param.Name.StartsWith(".")) break;
4210-
args += ", " + param.Name;
4210+
args += ", " + TemplateUtils.GetParamName(param);
42114211
addTypeOnce(typesUsed, getQualifiedType(param.Type, aType));
42124212
}
42134213

External/Plugins/ASCompletion/Completion/TemplateUtils.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public static string CallParametersString(MemberModel member)
143143
else
144144
one = ReplaceTemplateVariable(one, "PComma", null);
145145

146-
one = ReplaceTemplateVariable(one, "PName", param.Name);
146+
var pname = GetParamName(param);
147+
one = ReplaceTemplateVariable(one, "PName", pname);
147148

148149
one = ReplaceTemplateVariable(one, "PType", null);
149150
one = ReplaceTemplateVariable(one, "PDefaultValue", null);
@@ -265,5 +266,10 @@ public static string GetBoundary(string name)
265266
}
266267
return content;
267268
}
269+
270+
public static string GetParamName(MemberModel param)
271+
{
272+
return (param.Name ?? "").Replace("?", ""); // '?' is a marker for optional arguments
273+
}
268274
}
269275
}

External/Plugins/ASCompletion/Context/ASContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ protected virtual ASFileParser GetCodeParser()
987987
protected virtual void GetCurrentFileModel(string fileName)
988988
{
989989
cFile = GetCachedFileModel(fileName);
990+
cFile.FileName = fileName; // fix casing changes
990991
if (cFile.Context == null || cFile.Context != this)
991992
{
992993
cFile.Context = this;

0 commit comments

Comments
 (0)