static string Common(ScintillaControl sci, string sourceText, int ch) { sci.Text = sourceText; sci.Colourise(0, -1); SnippetHelper.PostProcessSnippets(sci, 0); sci.OnSmartIndent(sci, ch); return(sci.Text); }
static string Common(string sourceText, MemberModel currentMember, string newName, ScintillaControl sci) { sci.Text = sourceText; SnippetHelper.PostProcessSnippets(sci, 0); ASContext.Context.CurrentMember.Returns(currentMember); CommandFactoryProvider.GetFactory(sci) .CreateExtractLocalVariableCommand(false, newName) .Execute(); return(sci.Text); }
static string Common(string sourceText, string newName, ScintillaControl sci) { sci.Text = sourceText; SnippetHelper.PostProcessSnippets(sci, 0); var model = ASContext.Context.GetCodeModel(sourceText); ASContext.Context.CurrentMember.Returns(model.Classes.First().Members.Items.First()); CommandFactoryProvider.GetFactory(sci) .CreateExtractMethodCommand(newName) .Execute(); return(sci.Text); }
static bool Common(string sourceText, ScintillaControl sci) { sci.Text = sourceText; SnippetHelper.PostProcessSnippets(sci, 0); var currentModel = ASContext.Context.CurrentModel; new ASFileParser().ParseSrc(currentModel, sci.Text); var currentClass = currentModel.Classes.FirstOrDefault() ?? ClassModel.VoidClass; ASContext.Context.CurrentClass.Returns(currentClass); ASContext.Context.CurrentMember.Returns(currentClass.Members.Items.FirstOrDefault()); return(Provider.CommandFactoryProvider.GetFactory(sci.ConfigurationLanguage).IsValidForConvertForeachToKeyValueIterator(sci)); }
internal static string Common(ScintillaControl sci, string sourceText, string fileName) { sci.Text = sourceText; sci.Colourise(0, -1); // Needed for preprocessor directives... SnippetHelper.PostProcessSnippets(sci, 0); var currentModel = ASContext.Context.CurrentModel; new ASFileParser().ParseSrc(currentModel, sci.Text); CommandFactoryProvider.GetFactory(sci) .CreateOrganizeImportsCommand() .Execute(); return(sci.Text); }
public string AS3(string sourceText, MemberModel currentMember, string newName) { ASContext.Context.SetAs3Features(); ASContext.Context.CurrentModel.Returns(new FileModel { Context = ASContext.Context }); ASContext.Context.CurrentMember.Returns(currentMember); Sci.Text = sourceText; Sci.ConfigurationLanguage = "as3"; SnippetHelper.PostProcessSnippets(Sci, 0); new ExtractLocalVariableCommand(false, newName).Execute(); return(Sci.Text); }
bool Common(string sourceText) { Sci.Text = sourceText; SnippetHelper.PostProcessSnippets(Sci, 0); var currentModel = ASContext.Context.CurrentModel; new ASFileParser().ParseSrc(currentModel, Sci.Text); var currentClass = currentModel.Classes.FirstOrDefault() ?? ClassModel.VoidClass; ASContext.Context.CurrentClass.Returns(currentClass); ASContext.Context.CurrentMember.Returns(currentClass.Members.Items.FirstOrDefault()); var target = RefactoringHelper.GetDefaultRefactorTarget(); return(RefactoringHelper.IsPrivateTarget(target)); }
static EForeach Common(string sourceText, ScintillaControl sci) { sci.Text = sourceText; SnippetHelper.PostProcessSnippets(sci, 0); var currentModel = ASContext.Context.CurrentModel; new ASFileParser().ParseSrc(currentModel, sci.Text); var currentClass = currentModel.Classes.FirstOrDefault() ?? ClassModel.VoidClass; ASContext.Context.CurrentClass.Returns(currentClass); ASContext.Context.CurrentMember.Returns(currentClass.Members.Items.FirstOrDefault()); var result = Complete.GetExpression(sci, sci.CurrentPos); return(result); }
public string Haxe(string sourceText, MemberModel currentMember, string newName, int contextualGeneratorItem) { ASContext.Context.SetHaxeFeatures(); ASContext.Context.CurrentModel.Returns(new FileModel { haXe = true, Context = ASContext.Context }); ASContext.Context.CurrentMember.Returns(currentMember); Sci.Text = sourceText; Sci.ConfigurationLanguage = "haxe"; SnippetHelper.PostProcessSnippets(Sci, 0); var command = (ExtractLocalVariableCommand)CommandFactoryProvider.GetFactory(Sci).CreateExtractLocalVariableCommand(false, newName); command.Execute(); ((CompletionListItem)command.CompletionList[contextualGeneratorItem]).PerformClick(); return(Sci.Text); }
protected static void SetSrc(ScintillaControl sci, string sourceText) { sci.Text = sourceText; SnippetHelper.PostProcessSnippets(sci, 0); var currentModel = ASContext.Context.CurrentModel; ASContext.Context.GetCodeModel(currentModel, sci.Text); var line = sci.CurrentLine; var currentClass = currentModel.Classes.FirstOrDefault(line); ASContext.Context.CurrentClass.Returns(currentClass); var currentMember = currentClass?.Members.FirstOrDefault(line); ASContext.Context.CurrentMember.Returns(currentMember); ASGenerator.contextToken = sci.GetWordFromPosition(sci.CurrentPos); }
public Result Common(string sourceText) { ASContext.Context.SetHaxeFeatures(); Sci.ConfigurationLanguage = "haxe"; Sci.Text = sourceText; SnippetHelper.PostProcessSnippets(Sci, 0); var currentModel = ASContext.Context.CurrentModel; new ASFileParser().ParseSrc(currentModel, Sci.Text); var currentClass = currentModel.Classes.FirstOrDefault() ?? ClassModel.VoidClass; ASContext.Context.CurrentClass.Returns(currentClass); ASContext.Context.CurrentMember.Returns(currentClass.Members.Items.FirstOrDefault()); var target = RefactoringHelper.GetDefaultRefactorTarget(); return(new Result(target.IsPackage, target.Member, target.Type)); }
public string Haxe(string sourceText, string fileName) { Sci.ConfigurationLanguage = "haxe"; ASContext.Context.SetHaxeFeatures(); ASContext.Context.CurrentModel.Returns(new FileModel { haXe = true, Context = ASContext.Context, FileName = fileName }); Sci.Text = sourceText; SnippetHelper.PostProcessSnippets(Sci, 0); var currentModel = ASContext.Context.CurrentModel; new ASFileParser().ParseSrc(currentModel, Sci.Text); CommandFactoryProvider.GetFactory(Sci) .CreateOrganizeImportsCommand() .Execute(); return(Sci.Text); }
static string Common(ScintillaControl sci, string sourceText, bool skipWS) { sci.Text = sourceText; SnippetHelper.PostProcessSnippets(sci, 0); return(sci.GetWordRight(sci.CurrentPos, skipWS)); }
static int Common(string sourceText, ScintillaControl sci) { sci.Text = sourceText; SnippetHelper.PostProcessSnippets(sci, 0); return(Complete.GetStartOfIfStatement(sci, sci.CurrentPos)); }