internal static string Impl(ScintillaControl sci, string fileName, DocumentationGeneratorJobType job, bool enableLeadingAsterisks, bool hasGenerator) { SetHaxeFeatures(sci); var sourceText = ReadAllText(fileName); fileName = GetFullPath(fileName); fileName = Path.GetFileNameWithoutExtension(fileName).Replace('.', Path.DirectorySeparatorChar) + Path.GetExtension(fileName); fileName = Path.GetFullPath(fileName); fileName = fileName.Replace($"\\FlashDevelop\\Bin\\Debug\\{nameof(HaXeContext)}\\Test_Files\\", $"\\Tests\\External\\Plugins\\{nameof(HaXeContext)}.Tests\\Test Files\\"); ASContext.Context.CurrentModel.FileName = fileName; PluginBase.MainForm.CurrentDocument.FileName.Returns(fileName); return(Common(sci, sourceText, job, enableLeadingAsterisks, hasGenerator)); }
private void GenerateJob(DocumentationGeneratorJobType job, string context) { switch (job) { case Empty: case MethodDetails: var sci = ASContext.CurSciControl; sci.BeginUndoAction(); try { GenerateDocumentation(context); } finally { sci.EndUndoAction(); } break; } }
internal static string Common(ScintillaControl sci, string sourceText, DocumentationGeneratorJobType job, bool hasGenerator) { SetSrc(sci, sourceText); var options = new List <ICompletionListItem>(); ASContext.Context.DocumentationGenerator.ContextualGenerator(sci, sci.CurrentPos, options); var item = options.Find(it => it is DocumentationGenerator.GeneratorItem && ((DocumentationGenerator.GeneratorItem)it).Job == job); if (hasGenerator) { Assert.NotNull(item); var value = item.Value; } else { Assert.IsNull(item); } return(sci.Text); }
public string Haxe(string fileName, DocumentationGeneratorJobType job) => Impl(sci, fileName, job, false, true);
public string Haxe(string fileName, DocumentationGeneratorJobType job, bool hasGenerator) => Impl(sci, fileName, job, true, hasGenerator);
public GeneratorItem(string label, DocumentationGeneratorJobType job, Action action) { Job = job; this.action = action; Label = label; }