Пример #1
0
        private LinePosition GetPreceedingWordSegment(IDocument document, ICSharpCode.AvalonEdit.Document.ISegment completionSegment)
        {
            string line = "";

            int pos = completionSegment.EndOffset - 1;
            var loc = document.GetLocation(pos);

            Log.Debug("{class} {method} pos:{position}", "DaxCompletionData", "GetPreceedingWordSegment", pos);
            var docLine = document.GetLineByOffset(pos);

            //line = textArea.Document.GetText(docLine.Offset, loc.Column);
            line = document.GetText(docLine.Offset, docLine.Length);

            Log.Verbose("{class} {method} {message}", "DaxCompletionData", "GetPreceedingWordSegment", "line: " + line);
            var daxState = DaxLineParser.ParseLine(line, loc.Column, 0);

            //TODO - look ahead to see if we have a table/column/function end character that we should replace upto
            return(DaxLineParser.GetPreceedingWordSegment(docLine.Offset, loc.Column, line, daxState));
        }
Пример #2
0
 public void Complete(ICSharpCode.AvalonEdit.Editing.TextArea textArea, ICSharpCode.AvalonEdit.Document.ISegment completionSegment, EventArgs insertionRequestEventArgs)
 {
     CompleteInternal(textArea.Document, completionSegment, insertionRequestEventArgs);
 }