public override IEnumerable <CodeAction> GetActions(Ide.Gui.Document document, object refactoringContext, ICSharpCode.NRefactory.TextLocation loc, System.Threading.CancellationToken cancellationToken) { if (!DLanguageBinding.IsDFile(document.FileName)) { yield break; } var imports = GetSolutions(document); //it may be a bit too slow foreach (var i in imports) { yield return(new InnerAction(i)); } }
public override void Run(Ide.Gui.Document document, ICSharpCode.NRefactory.TextLocation loc) { ApplySolution(Title, document); }
public static Location AsLocation(this ICSharpCode.NRefactory.TextLocation location) { return(new Location(location.Line - 1, location.Column - 1)); }
/// </summary> /// <param name="textBox"></param> /// <param name="location"></param> /// <returns></returns>///////////////////////////////////////////////////////////////////////////////////////////////////// int GetOffset(RichTextBox textBox, ICSharpCode.NRefactory.TextLocation location) /*Get Node From Here*/ { return(textBox.GetFirstCharIndexFromLine(location.Line - 1) + location.Column - 1); }
/*************************************END OF USE CASE*************************************************/ int GetOffset(RichTextBox textBox, ICSharpCode.NRefactory.TextLocation location) //////////////Get Node From Here { // TextBox uses 0-based coordinates, TextLocation is 1-based return(textBox.GetFirstCharIndexFromLine(location.Line - 1) + location.Column - 1); }
public int GetOffset(ICSharpCode.NRefactory.TextLocation location) { throw new NotImplementedException(); }