Skip to content

Commit 17b3f23

Browse files
committed
Contextual Code Generation update 4
ASCompletion doesn't listen for "ASCompletion.ContextualGenerator.AddOptions".
1 parent a43ee5a commit 17b3f23

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

External/Plugins/ASCompletion/PluginMain.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
210210
de = e as DataEvent;
211211
if (de.Action == "Completion.ShowHelp")
212212
{
213-
ASComplete.HelpKeys = (Keys) de.Data;
213+
ASComplete.HelpKeys = (Keys)de.Data;
214214
de.Handled = true;
215215
}
216216
return;
@@ -279,12 +279,12 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
279279
if (info != null)
280280
{
281281
ContextSetupInfos setup = new ContextSetupInfos();
282-
setup.Platform = (string) info["platform"];
283-
setup.Lang = (string) info["lang"];
284-
setup.Version = (string) info["version"];
285-
setup.TargetBuild = (string) info["targetBuild"];
286-
setup.Classpath = (string[]) info["classpath"];
287-
setup.HiddenPaths = (string[]) info["hidden"];
282+
setup.Platform = (string)info["platform"];
283+
setup.Lang = (string)info["lang"];
284+
setup.Version = (string)info["version"];
285+
setup.TargetBuild = (string)info["targetBuild"];
286+
setup.Classpath = (string[])info["classpath"];
287+
setup.HiddenPaths = (string[])info["hidden"];
288288
ASContext.SetLanguageClassPath(setup);
289289
if (setup.AdditionalPaths != null) // report custom classpath
290290
info["additional"] = setup.AdditionalPaths.ToArray();
@@ -299,7 +299,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
299299
if (info != null && info.ContainsKey("language"))
300300
{
301301
IASContext context = ASContext.GetLanguageContext(info["language"] as string);
302-
if (context != null && context.Settings != null
302+
if (context != null && context.Settings != null
303303
&& context.Settings.UserClasspath != null)
304304
info["cp"] = new List<string>(context.Settings.UserClasspath);
305305
}
@@ -347,7 +347,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
347347
{
348348
case "AS2": name = "AS2Context"; break;
349349
case "AS3": name = "AS3Context"; break;
350-
default:
350+
default:
351351
name = cmdData.Substring(0, 1).ToUpper() + cmdData.Substring(1) + "Context";
352352
break;
353353
}
@@ -533,6 +533,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
533533
if (ASContext.HasContext && ASContext.Context.IsFileValid)
534534
{
535535
var options = new List<ICompletionListItem>();
536+
ASGenerator.ContextualGenerator(ASContext.CurSciControl, options);
536537
EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "ASCompletion.ContextualGenerator.AddOptions", options));
537538
if (options.Count == 0)
538539
{
@@ -541,10 +542,6 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
541542
CompletionList.Show(options, false);
542543
}
543544
break;
544-
545-
case "ASCompletion.ContextualGenerator.AddOptions":
546-
ASGenerator.ContextualGenerator(ASContext.CurSciControl, (List<ICompletionListItem>) de.Data);
547-
break;
548545
}
549546
}
550547
return;
@@ -556,7 +553,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
556553
}
557554
}
558555
}
559-
catch (Exception ex)
556+
catch(Exception ex)
560557
{
561558
ErrorManager.ShowError(ex);
562559
}

0 commit comments

Comments
 (0)