private bool IsInComment(CodeEditorControl editor) { CSharpExpressionFinder ef = new CSharpExpressionFinder(editor.ActiveViewControl.FileName); int cursor = editor.ActiveViewControl.Caret.Offset - 1; return(ef.FilterComments(ScriptControl.Parser.ProjectParser.GetFileContents(editor.FileName).Substring(0, cursor + 1), ref cursor) == null); }
bool IsInComment(SharpDevelopTextAreaControl editor) { CSharpExpressionFinder ef = CreateExpressionFinder(editor.FileName); int cursor = editor.ActiveTextAreaControl.Caret.Offset - 1; return(ef.FilterComments(editor.Document.GetText(0, cursor + 1), ref cursor) == null); }
bool IsInComment(ITextEditor editor) { CSharpExpressionFinder ef = CreateExpressionFinder(editor.Document.Text); int cursor = editor.Caret.Offset - 1; return(ef.FilterComments(editor.Document.GetText(0, cursor + 1), ref cursor) == null); }
protected override bool IsInComment(IDocument document, int offset) { var csDocument = FEditor.TextDocument as CSDocument; var expressionFinder = new CSharpExpressionFinder(csDocument.ParseInfo); int length = offset + 1; if (length <= document.TextLength) { return(expressionFinder.FilterComments(document.GetText(0, length), ref offset) == null); } else { return(false); } }