public CompletionSource(ITextBuffer textBuffer, ITextStructureNavigator textNavigator, IProjectExplorer projectExplorer) { _textBuffer = textBuffer; _textNavigator = textNavigator; _projectExplorer = projectExplorer; _viewExplorer = ViewExplorer.CreateFromActiveDocument(_projectExplorer); }
private void Create(ITextView textView) { _textView = textView; _textBuffer = textView.TextBuffer; _buffer = _textView.TextBuffer; _snapshot = _buffer.CurrentSnapshot; _buffer.Changed += delegate { _snapshot = _buffer.CurrentSnapshot; }; _globalSettings = new Vim.GlobalSettings(); _localSettings = new LocalSettings(_globalSettings, _textView); _markMap = new MarkMap(new TrackingLineColumnService()); _vimData = new VimData(); _search = VimUtil.CreateSearchService(_globalSettings); _jumpList = VimUtil.CreateJumpList(); _statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict); _navigator = VimUtil.CreateTextStructureNavigator(_textView.TextBuffer); _motionUtil = new MotionUtil( _textView, _markMap, _localSettings, _search, _navigator, _jumpList, _statusUtil.Object, _vimData); }
private void Create(ITextView textView, IEditorOptions editorOptions = null) { _textView = textView; _textBuffer = textView.TextBuffer; _snapshot = _textBuffer.CurrentSnapshot; _textBuffer.Changed += delegate { _snapshot = _textBuffer.CurrentSnapshot; }; _globalSettings = new Vim.GlobalSettings(); _localSettings = new LocalSettings(_globalSettings, FSharpOption.CreateForReference(editorOptions), FSharpOption.CreateForReference(textView)); _markMap = new MarkMap(new TrackingLineColumnService()); _vimData = new VimData(); _search = VimUtil.CreateSearchService(_globalSettings); _jumpList = VimUtil.CreateJumpList(); _statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict); _navigator = VimUtil.CreateTextStructureNavigator(_textView, WordKind.NormalWord); _motionUtil = new MotionUtil( _textView, _markMap, _localSettings, _search, _navigator, _jumpList, _statusUtil.Object, VimUtil.GetWordUtil(textView), _vimData); }
public CommandFilter(IVsTextView textViewAdapter, IWpfTextView textView, ITextStructureNavigator textNavigator, ICompletionBroker completionBroker) { textViewAdapter.AddCommandFilter(this, out _nextCommand); _textView = textView; _textNavigator = textNavigator; _completionBroker = completionBroker; }
public NavigableSymbolSource(IServiceProvider serviceProvider, ITextBuffer buffer, IClassifier classifier, ITextStructureNavigator textNavigator) { _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); _buffer = buffer ?? throw new ArgumentNullException(nameof(buffer)); _classifier = classifier ?? throw new ArgumentNullException(nameof(classifier)); _textNavigator = textNavigator ?? throw new ArgumentNullException(nameof(textNavigator)); _entryService = serviceProvider.GetEntryService(); }
public PhpTextStructureNavigator(ITextBuffer textBuffer, ITextStructureNavigator delegateNavigator) { Contract.Requires <ArgumentNullException>(textBuffer != null, "textBuffer"); Contract.Requires <ArgumentNullException>(delegateNavigator != null, "delegateNavigator"); _textBuffer = textBuffer; _delegateNavigator = delegateNavigator; }
public SubwordNavigationCommandFilter(IWpfTextView textView, IEditorOperations operations, ITextStructureNavigator navigator) { this.textView = textView; this.operations = operations; this.navigator = navigator; RegisterCommands(); }
public EmojiCompletionSource(ITextStructureNavigator textStructureNavigator) { _textStructureNavigator = textStructureNavigator; // Build a collection of Emojis to handle _emojis = GlyphfriendPackage.Emojis .Select(e => EmojiCompletion(e.Key, e.Value)) .ToList(); }
public SparkSignatureHelpCommand(IVsTextView textViewAdapter, IWpfTextView textView, ITextStructureNavigator navigator, ISignatureHelpBroker broker) { _textView = textView; _navigator = navigator; _broker = broker; ChainTheNextCommand(textViewAdapter); }
private ITrackingSpan FindTokenSpanAtPosition(SnapshotPoint point) { SnapshotPoint currentPoint = point - 1; ITextStructureNavigator navigator = m_sourceProvider.NavigatorService.GetTextStructureNavigator(m_textBuffer); TextExtent extent = navigator.GetExtentOfWord(currentPoint); return(currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive)); }
public CSharpDocumentationCompletionSource(ITextView textView, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IEditorOperationsFactoryService operationsFactory) { _textView = textView; _textBuffer = textView.TextBuffer; _classifier = classifier.GetClassifier(_textBuffer); _navigator = navigator.GetTextStructureNavigator(_textBuffer); _operationsFactory = operationsFactory; }
private ITrackingSpan FindTokenSpanAtPosition(ICompletionSession session) { SnapshotPoint currentPoint = session.TextView.Caret.Position.BufferPosition - 1; ITextStructureNavigator navigator = this.provider.NavigatorService.GetTextStructureNavigator(this.textBuffer); TextExtent extent = navigator.GetExtentOfWord(currentPoint); return(currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive)); }
private ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, ICompletionSession session) { SnapshotPoint currentPoint = (session.TextView.Caret.Position.BufferPosition) - 1; ITextStructureNavigator navigator = _navigation.GetTextStructureNavigator(_buffer); TextExtent extent = navigator.GetExtentOfWord(currentPoint); return(currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive)); }
ITagger <T> IViewTaggerProvider.CreateTagger <T>(ITextView textView, ITextBuffer buffer) { ISQLanguageService service = SQVSUtils.GetService <ISQLanguageService>(); ITextStructureNavigator textStructureNavigator = TextStructureNavigatorSelector.GetTextStructureNavigator(buffer); return(buffer.Properties.GetOrCreateSingletonProperty(delegate() { return new SQErrorTagger(textView, buffer, textStructureNavigator, service as SQLanguageServiceEX); }) as ITagger <T>); }
private TextExtent FindExtentAtPoint(SnapshotPoint?subjectTriggerPoint) { ITextStructureNavigator navigator = provider.NavigatorService.GetTextStructureNavigator(textBuffer); TextExtent extent = navigator.GetExtentOfWord(subjectTriggerPoint.Value); return(extent); }
public AntlrIntellisenseCommandFilter(IVsTextView textViewAdapter, AntlrIntellisenseController controller) : base(textViewAdapter, controller) { var textView = Controller.Provider.EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); var textBuffer = textView.TextBuffer; _classifier = Controller.Provider.ClassifierAggregatorService.GetClassifier(textView.TextBuffer); _textStructureNavigator = Controller.Provider.TextStructureNavigatorSelectorService.GetTextStructureNavigator(textBuffer); }
public AntlrTextStructureNavigator(ITextBuffer textBuffer, ITextStructureNavigator delegateNavigator) { Contract.Requires<ArgumentNullException>(textBuffer != null, "textBuffer"); Contract.Requires<ArgumentNullException>(delegateNavigator != null, "delegateNavigator"); _textBuffer = textBuffer; _delegateNavigator = delegateNavigator; }
public PlainTextCompletionSource( ITextBuffer buffer, ITextStructureNavigator structureNavigator) { this.theBuffer = buffer; this.navigator = structureNavigator; glyphIcon = new BitmapImage(new Uri("pack://application:,,,/Winterdom.Viasfora;component/Resources/PlainTextCompletion.ico")); }
private ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, ICompletionSession completionSession) { SnapshotPoint ssPoint = (completionSession.TextView.Caret.Position.BufferPosition) - 1; ITextStructureNavigator navigator = sourceProvider.TextNavigatorService.GetTextStructureNavigator(this.textBuffer); TextExtent textExtent = navigator.GetExtentOfWord(ssPoint); return(ssPoint.Snapshot.CreateTrackingSpan(textExtent.Span, SpanTrackingMode.EdgeInclusive)); }
public SQErrorTagger(ITextView view, ITextBuffer sourceBuffer, ITextStructureNavigator textStructureNavigator, SQLanguageServiceEX service) { _buffer = sourceBuffer; _languangeService = service; filepath = SQLanguageServiceEX.GetFileName(_buffer); _buffer.Changed -= _buffer_Changed; _buffer.ChangedLowPriority += _buffer_Changed; }
internal SignatureHelpCommandHandler(IVsTextView textViewAdapter, ITextView textView, ITextStructureNavigator nav, ISignatureHelpBroker broker) { _textView = textView; _broker = broker; _navigator = nav; // Add to the filter chain textViewAdapter.AddCommandFilter(this, out _nextCommandHandler); }
public CmdCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, IGlyphService glyphService, ITextStructureNavigator textStructureNavigator) { _buffer = buffer; _classifier = classifier.GetClassifier(buffer); _keywordGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic); _environmentGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphAssembly, StandardGlyphItem.GlyphItemPublic); _labelGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphArrow, StandardGlyphItem.GlyphItemPublic); _textStructureNavigator = textStructureNavigator; }
private ITrackingSpan CreateTrackingSpanForSnippet(ICompletionSession session) { ITrackingPoint point = session.GetTriggerPoint(textBuffer); SnapshotPoint currentPoint = (session.TextView.Caret.Position.BufferPosition) - 1; ITextStructureNavigator navigator = textStructureNavigatorSelectorService.GetTextStructureNavigator(textBuffer); TextExtent extent = navigator.GetExtentOfWord(currentPoint); return(currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive)); }
protected override ITagger <T> GetTagger <T>(ITextView textView, ITextBuffer buffer) { ITextStructureNavigator textStructureNavigator = TextStructureNavigatorSelector.GetTextStructureNavigator(buffer); var tagger = new HighlightWordTagger(textView, buffer, TextSearchService, textStructureNavigator) as ITagger <T>; return(tagger); }
public GoToDefMouseHandler(IWpfTextView view, IOleCommandTarget commandTarget, IClassifier aggregator, ITextStructureNavigator navigator, CtrlKeyState state) { _view = view; _commandTarget = commandTarget; _aggregator = aggregator; _navigator = navigator; _state = state; }
public Antlr4IntellisenseCommandFilter(IVsTextView textViewAdapter, Antlr4IntellisenseController controller) : base(textViewAdapter, controller) { var textView = Controller.Provider.EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); var textBuffer = textView.TextBuffer; _classifier = Controller.Provider.ClassifierAggregatorService.GetClassifier(textView.TextBuffer); _textStructureNavigator = Controller.Provider.TextStructureNavigatorSelectorService.GetTextStructureNavigator(textBuffer); }
public CmdCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, IGlyphService glyphService, ITextStructureNavigator textStructureNavigator) { _buffer = buffer; _classifier = classifier.GetClassifier(buffer); _keywordGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic); _environmentGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphAssembly, StandardGlyphItem.GlyphItemPublic); _labelGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphArrow, StandardGlyphItem.GlyphItemPublic); _textStructureNavigator = textStructureNavigator; }
public ImagePreviewToolTipMouseProcessor(IWpfTextView view, ITextStructureNavigator navigator, IToolTipProviderFactory toolTipProviderFactory, ITextDocument textDocument) { this.spanSearcher = new StringSpanSearcher(view, navigator); this.toolTipProvider = toolTipProviderFactory.GetToolTipProvider(view); this.textDocument = textDocument; this.shownSpan = null; }
internal StaDynSignatureHelpCommandHandler(IVsTextView textViewAdapter, ITextView textView, ITextStructureNavigator nav, ISignatureHelpBroker broker) { this.m_textView = textView; this.m_broker = broker; this.m_navigator = nav; //add this to the filter chain textViewAdapter.AddCommandFilter(this, out m_nextCommandHandler); }
public EmojiCompletionSource(ITextBuffer buffer,ITextStructureNavigator textStructureNavigator) { _buffer = buffer; _textStructureNavigator = textStructureNavigator; // Build a collection of Emojis to handle _emojis = GlyphfriendPackage.Emojis .Select(e => EmojiCompletion(e.Key, e.Value)) .ToList(); }
private ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, ICompletionSession session) { SnapshotPoint currentPoint = (session.TextView.Caret.Position.BufferPosition) - 1; ITextStructureNavigator navigator = m_sourceProvider.NavigatorService.GetTextStructureNavigator(m_textBuffer); TextExtent extent = navigator.GetExtentOfWord(currentPoint); string w1 = currentPoint.Snapshot.GetText(extent.Span); return(currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive)); }
// Token: 0x06000012 RID: 18 RVA: 0x000022D4 File Offset: 0x000004D4 public StickyHighlightWordTagger(ITextView view, ITextBuffer sourceBuffer, ITextSearchService textSearchService, ITextStructureNavigator textStructureNavigator) { this.View = view; this.SourceBuffer = sourceBuffer; this.TextSearchService = textSearchService; this.TextStructureNavigator = textStructureNavigator; this.View.LayoutChanged += this.ViewLayoutChanged; this.WordSpanMap = new Dictionary <string, NormalizedSnapshotSpanCollection>(); HighlightedWordCollection.Instance.Changed += this.HighlightWordAdded; }
public AlloyTextStructureNavigator(ITextBuffer textBuffer, ITextStructureNavigator delegateTextStructureNavigator) { if (textBuffer == null) throw new ArgumentNullException("textBuffer"); if (delegateTextStructureNavigator == null) throw new ArgumentNullException("delegateTextStructureNavigator"); this._textBuffer = textBuffer; this._delegateTextStructureNavigator = delegateTextStructureNavigator; }
public CompletionSessionManager(ICompletionBroker broker, IWpfTextView textView, ITextStructureNavigator textNavigator) { if (broker == null) throw new ArgumentNullException("broker", "Completion Broker is null."); if (textView == null) throw new ArgumentNullException("textView", "Text View is null."); if (textNavigator == null) throw new ArgumentNullException("textNavigator", "Text Navigator is null."); _completionBroker = broker; _textView = textView; _textNavigator = textNavigator; }
public PlainTextCompletionSource( ITextBuffer buffer, ITextStructureNavigator structureNavigator, IVsfSettings settings) { this.theBuffer = buffer; this.navigator = structureNavigator; this.settings = settings; glyphIcon = new BitmapImage(new Uri("pack://application:,,,/Winterdom.Viasfora;component/Resources/PlainTextCompletion.ico")); }
internal EpochCompletionCommandHandler(IVsTextView textViewAdapter, ITextView textView, EpochCompletionHandlerProvider provider, ISignatureHelpBroker broker, ITextStructureNavigator nav) { this.m_textView = textView; this.m_provider = provider; this.m_navigator = nav; this.m_broker = broker; //add the command to the command chain textViewAdapter.AddCommandFilter(this, out m_nextCommandHandler); }
public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag { //provide highlighting only on the top buffer //if (textView.TextBuffer != buffer) //return null; ITextStructureNavigator textStructureNavigator = TextStructureNavigatorSelector.GetTextStructureNavigator(buffer); return(new HighlightWordTagger(textView, buffer, TextSearchService, textStructureNavigator) as ITagger <T>); }
// Token: 0x0600001E RID: 30 RVA: 0x00002850 File Offset: 0x00000A50 public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag { if (textView.TextBuffer != buffer) { return(null); } ITextStructureNavigator textStructureNavigator = this.TextStructureNavigatorSelector.GetTextStructureNavigator(buffer); return(new StickyHighlightWordTagger(textView, buffer, this.TextSearchService, textStructureNavigator) as ITagger <T>); }
internal static CommandUtil CreateCommandUtil( ITextView textView, ICommonOperations operations = null, IMotionUtil motionUtil = null, IStatusUtil statusUtil = null, IRegisterMap registerMap = null, IMarkMap markMap = null, IVimData vimData = null, IVimLocalSettings localSettings = null, IUndoRedoOperations undoRedOperations = null, ISmartIndentationService smartIndentationService = null, IFoldManager foldManager = null, IVimHost vimHost = null, IMacroRecorder recorder = null, ISearchService searchService = null, ITextStructureNavigator wordNavigator = null, IJumpList jumpList = null) { statusUtil = statusUtil ?? new StatusUtil(); undoRedOperations = undoRedOperations ?? VimUtil.CreateUndoRedoOperations(statusUtil); localSettings = localSettings ?? new LocalSettings(new GlobalSettings()); registerMap = registerMap ?? CreateRegisterMap(MockObjectFactory.CreateClipboardDevice().Object); markMap = markMap ?? new MarkMap(new TrackingLineColumnService()); vimData = vimData ?? new VimData(); motionUtil = motionUtil ?? CreateTextViewMotionUtil(textView, markMap: markMap, vimData: vimData, settings: localSettings); operations = operations ?? CreateCommonOperations(textView, localSettings, vimData: vimData, statusUtil: statusUtil); smartIndentationService = smartIndentationService ?? CreateSmartIndentationService(); foldManager = foldManager ?? CreateFoldManager(textView.TextBuffer); searchService = searchService ?? CreateSearchService(localSettings.GlobalSettings); wordNavigator = wordNavigator ?? CreateTextStructureNavigator(textView.TextBuffer, WordKind.NormalWord); jumpList = jumpList ?? CreateJumpList(); vimHost = vimHost ?? new MockVimHost(); var vim = MockObjectFactory.CreateVim( registerMap: registerMap, map: markMap, host: vimHost, vimData: vimData, recorder: recorder, searchService: searchService); var buffer = MockObjectFactory.CreateVimBuffer( textView: textView, settings: localSettings, motionUtil: motionUtil, vim: vim.Object, wordNavigator: wordNavigator, jumpList: jumpList); return(new CommandUtil( buffer.Object, operations, statusUtil, undoRedOperations, smartIndentationService, foldManager)); }
public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag { if (textView.TextBuffer != buffer) { return(null); } ITextStructureNavigator textStructureNavigator = TextStructureNavigatorSelector.GetTextStructureNavigator(buffer); return(buffer.Properties.GetOrCreateSingletonProperty(() => new CssHighlightWordTagger(textView, buffer, TextSearchService, textStructureNavigator)) as ITagger <T>); }
public CodeView(CodeEditorWindow owner, ITextView textView) { m_Owner = owner; _textView = textView; _document = _textView.Document; var textFont = _textView.Appearance.Text.font; _font = textFont ? textFont : GUI.skin.font; _navigator = new DefaultTextStructureNavigator(); Caret.Moved += EnsureCursorIsVisible; _textView.DoubleClicked = DoubleClickedDocument; }
public ITextStructureNavigator CreateTextStructureNavigator(ITextBuffer textBuffer) { if (textBuffer == null) { throw new ArgumentNullException("textBuffer"); } ITextStructureNavigator delegateTextStructureNavigator = TextStructureNavigatorSelectorService.CreateTextStructureNavigator(textBuffer, AnyContentType); return(new AlloyTextStructureNavigator(textBuffer, delegateTextStructureNavigator)); }
bool IsWholeWord(ITextStructureNavigator textStructureNavigator, ITextSnapshot snapshot, FindResult result) { Debug.Assert(textStructureNavigator != null); if (textStructureNavigator == null) return false; if (result.Length == 0) return false; var start = textStructureNavigator.GetExtentOfWord(new SnapshotPoint(snapshot, result.Position)); if (start.Span.Start.Position != result.Position) return false; var end = textStructureNavigator.GetExtentOfWord(new SnapshotPoint(snapshot, result.Position + result.Length - 1)); return end.Span.End.Position == result.Position + result.Length; }
public void Create(params string[] lines) { _textBuffer = EditorUtil.CreateTextBuffer(lines); _navigator = VimUtil.CreateTextStructureNavigator(_textBuffer, WordKind.NormalWord); _globalSettings = new Vim.GlobalSettings(); _globalSettings.Magic = true; _globalSettings.IgnoreCase = true; _globalSettings.SmartCase = false; _textSearch = EditorUtil.FactoryService.TextSearchService; _searchRaw = new SearchService(_textSearch, _globalSettings); _search = _searchRaw; }
public CodeView(EditorWindow owner, ITextView textView) { m_Owner = owner; _textView = textView; _document = _textView.Document; var textFont = _textView.Appearance.Text.font; _font = textFont ? textFont : GUI.skin.font; _navigator = new DefaultTextStructureNavigator(); _completion = new CodeViewCompletion(this, _textView); Caret.Moved += OnCaretMoved; _textView.Clicked = OnTextViewClicked; }
public virtual void Create(ITextSearchService textSearchService, params string[] lines) { _textBuffer = CreateTextBuffer(lines); _wordNavigator = WordUtil.CreateTextStructureNavigator(WordKind.NormalWord, _textBuffer.ContentType); _globalSettings = Vim.GlobalSettings; _globalSettings.Magic = true; _globalSettings.IgnoreCase = true; _globalSettings.SmartCase = false; _textSearch = textSearchService; _searchRaw = new SearchService(_textSearch, _globalSettings); _search = _searchRaw; }
public PlainTextCompletionSource( ITextBuffer buffer, ITextStructureNavigator structureNavigator, IVsfSettings settings) { this.theBuffer = buffer; this.navigator = structureNavigator; this.settings = settings; String assemblyName = this.GetType().Assembly.GetName().Name; glyphIcon = new BitmapImage(new Uri(String.Format( "pack://application:,,,/{0};component/Resources/PlainTextCompletion.ico", assemblyName))); }
public void Create(params string[] lines) { _textBuffer = CreateTextBuffer(lines); _wordNavigator = WordUtilFactory.GetWordUtil(_textBuffer).CreateTextStructureNavigator(WordKind.NormalWord); _globalSettings = Vim.GlobalSettings; _globalSettings.Magic = true; _globalSettings.IgnoreCase = true; _globalSettings.SmartCase = false; _textSearch = TextSearchService; _searchRaw = new SearchService(_textSearch, _globalSettings); _search = _searchRaw; }
internal TextStructureNavigator( ITextBuffer subjectBuffer, ITextStructureNavigator naturalLanguageNavigator, AbstractTextStructureNavigatorProvider provider, IWaitIndicator waitIndicator) { Contract.ThrowIfNull(subjectBuffer); Contract.ThrowIfNull(naturalLanguageNavigator); Contract.ThrowIfNull(provider); _subjectBuffer = subjectBuffer; _naturalLanguageNavigator = naturalLanguageNavigator; _provider = provider; _waitIndicator = waitIndicator; }
internal static ICommonOperations CreateCommonOperations( ITextView textView, IVimLocalSettings localSettings, IOutliningManager outlining = null, IStatusUtil statusUtil = null, ISearchService searchService = null, IUndoRedoOperations undoRedoOperations = null, IVimData vimData = null, IVimHost vimHost = null, ITextStructureNavigator navigator = null, IClipboardDevice clipboardDevice = null, IFoldManager foldManager = null) { var editorOperations = EditorUtil.GetOperations(textView); var editorOptions = EditorUtil.FactoryService.EditorOptionsFactory.GetOptions(textView); var jumpList = new JumpList(new TrackingLineColumnService()); var keyMap = new KeyMap(); foldManager = foldManager ?? new FoldManager(textView.TextBuffer); statusUtil = statusUtil ?? new StatusUtil(); searchService = searchService ?? CreateSearchService(localSettings.GlobalSettings); undoRedoOperations = undoRedoOperations ?? new UndoRedoOperations(statusUtil, FSharpOption<ITextUndoHistory>.None); vimData = vimData ?? new VimData(); vimHost = vimHost ?? new MockVimHost(); navigator = navigator ?? CreateTextStructureNavigator(textView.TextBuffer); clipboardDevice = clipboardDevice ?? new MockClipboardDevice(); var operationsData = new OperationsData( editorOperations, editorOptions, foldManager, jumpList, keyMap, localSettings, outlining != null ? FSharpOption.Create(outlining) : FSharpOption<IOutliningManager>.None, CreateRegisterMap(clipboardDevice), searchService, EditorUtil.FactoryService.SmartIndentationService, statusUtil, textView, undoRedoOperations, vimData, vimHost, navigator); return new CommonOperations(operationsData); }
public static Mock<IVimBuffer> CreateVimBuffer( ITextView textView, string name = null, IVim vim = null, IJumpList jumpList = null, IVimLocalSettings localSettings = null, IIncrementalSearch incrementalSearch = null, IMotionUtil motionUtil = null, ITextStructureNavigator wordNavigator = null, MockRepository factory = null) { factory = factory ?? new MockRepository(MockBehavior.Strict); name = name ?? "test"; vim = vim ?? CreateVim().Object; jumpList = jumpList ?? (factory.Create<IJumpList>().Object); motionUtil = motionUtil ?? factory.Create<IMotionUtil>().Object; wordNavigator = wordNavigator ?? factory.Create<ITextStructureNavigator>().Object; localSettings = localSettings ?? new LocalSettings(vim.GlobalSettings); var vimTextBuffer = CreateVimTextBuffer( textView.TextBuffer, localSettings: localSettings, vim: vim, factory: factory); var mock = factory.Create<IVimBuffer>(); mock.SetupGet(x => x.TextView).Returns(textView); mock.SetupGet(x => x.MotionUtil).Returns(motionUtil); mock.SetupGet(x => x.TextBuffer).Returns(() => textView.TextBuffer); mock.SetupGet(x => x.TextSnapshot).Returns(() => textView.TextSnapshot); mock.SetupGet(x => x.Name).Returns(name); mock.SetupGet(x => x.LocalSettings).Returns(localSettings); mock.SetupGet(x => x.GlobalSettings).Returns(localSettings.GlobalSettings); mock.SetupGet(x => x.MarkMap).Returns(vim.MarkMap); mock.SetupGet(x => x.RegisterMap).Returns(vim.RegisterMap); mock.SetupGet(x => x.JumpList).Returns(jumpList); mock.SetupGet(x => x.Vim).Returns(vim); mock.SetupGet(x => x.VimData).Returns(vim.VimData); mock.SetupGet(x => x.IncrementalSearch).Returns(incrementalSearch); mock.SetupGet(x => x.WordNavigator).Returns(wordNavigator); mock.SetupGet(x => x.VimTextBuffer).Returns(vimTextBuffer.Object); return mock; }
public GoToDefMouseHandler(IWpfTextView view, IOleCommandTarget commandTarget, IClassifier aggregator, ITextStructureNavigator navigator, CtrlKeyState state) { _view = view; _commandTarget = commandTarget; _aggregator = aggregator; _navigator = navigator; _state = state; }
private void Create( IEditorOperations editorOpts = null, ITextStructureNavigator baseNav = null, params string[] lines) { _host = new Mock<IVimHost>(MockBehavior.Strict); if (editorOpts == null) { var tuple = EditorUtil.CreateViewAndOperations(lines); _view = tuple.Item1; editorOpts = tuple.Item2; } else { _view = EditorUtil.CreateView(lines); } baseNav = baseNav ?? (new Mock<ITextStructureNavigator>(MockBehavior.Strict)).Object; var nav = TssUtil.CreateTextStructureNavigator(WordKind.NormalWord, baseNav); _globalSettings = MockObjectFactory.CreateGlobalSettings(ignoreCase: true); _settings = MockObjectFactory.CreateLocalSettings(_globalSettings.Object); _jumpList = new Mock<IJumpList>(MockBehavior.Strict); _searchService = new SearchService(EditorUtil.FactoryService.textSearchService, _globalSettings.Object); _search = new Mock<IIncrementalSearch>(MockBehavior.Strict); _search.SetupGet(x => x.SearchService).Returns(_searchService); _statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict); _outlining = new Mock<IOutliningManager>(MockBehavior.Strict); _undoRedoOperations = new Mock<IUndoRedoOperations>(MockBehavior.Strict); _operationsRaw = new DefaultOperations(_view, editorOpts, _outlining.Object, _host.Object, _statusUtil.Object, _settings.Object, nav, _jumpList.Object, _search.Object, _undoRedoOperations.Object); _operations = _operationsRaw; }
//===================================================================== /// <summary> /// Constructor /// </summary> /// <param name="textView">The text view to use</param> /// <param name="serviceProvider">The service provider to use</param> /// <param name="aggregator">The classifier tag aggregator to use</param> /// <param name="navigator">The text structure navigator to use</param> /// <param name="state">The Ctrl key state tracker to use</param> /// <param name="enableInCRef">True to enable in <c>cref</c> targets, false if not</param> public CSharpGoToDefinitionMouseProcessor(IWpfTextView textView, SVsServiceProvider serviceProvider, IClassifier aggregator, ITextStructureNavigator navigator, CtrlKeyState state, bool enableInCRef) : base(textView, serviceProvider, aggregator, navigator, state) { this.enableInCRef = enableInCRef; }
private void FindNext(string text, int position = 0, SearchPath path = null, bool isWrap = true, ITextStructureNavigator navigator = null) { navigator = navigator ?? _wordNavigator; path = path ?? SearchPath.Forward; var point = _textBuffer.GetPoint(position); _search.FindNext(point, new SearchData(text, path, isWrap), navigator); }
private void Create(params string[] lines) { _textView = EditorUtil.CreateTextView(lines); _globalSettings = new Vim.GlobalSettings(); _globalSettings.IncrementalSearch = true; _globalSettings.WrapScan = true; _localSettings = new LocalSettings(_globalSettings, EditorUtil.GetEditorOptions(_textView), _textView); _nav = VimUtil.CreateTextStructureNavigator(_textView, WordKind.NormalWord); _factory = new MockRepository(MockBehavior.Strict); _vimHost = _factory.Create<IVimHost>(); _vimHost.Setup(x => x.EnsureVisible(_textView, It.IsAny<SnapshotPoint>())); _statusUtil = _factory.Create<IStatusUtil>(); _statusUtil.Setup(x => x.OnWarning(Resources.Common_SearchBackwardWrapped)); _statusUtil.Setup(x => x.OnWarning(Resources.Common_SearchForwardWrapped)); _vimData = new VimData(); _operations = VimUtil.CreateCommonOperations( textView: _textView, localSettings: _localSettings, vimHost: _vimHost.Object, statusUtil: _statusUtil.Object); _searchRaw = new IncrementalSearch( _operations, _localSettings, _nav, _statusUtil.Object, _vimData); _search = _searchRaw; }
public PaketCompletionSource(IGlyphService glyphService, ITextBuffer textBuffer, ITextStructureNavigator navigator) { this.textBuffer = textBuffer; this.navigator = navigator; glyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic); }
/// <summary> /// Create a Mock over IVimTextBuffer which provides the msot basic functions /// </summary> public static Mock<IVimTextBuffer> CreateVimTextBuffer( ITextBuffer textBuffer, IVimLocalSettings localSettings = null, IVim vim = null, ITextStructureNavigator wordNavigator = null, IUndoRedoOperations undoRedoOperations = null, MockRepository factory = null) { factory = factory ?? new MockRepository(MockBehavior.Strict); vim = vim ?? CreateVim(factory: factory).Object; localSettings = localSettings ?? CreateLocalSettings(factory: factory).Object; wordNavigator = wordNavigator ?? factory.Create<ITextStructureNavigator>().Object; undoRedoOperations = undoRedoOperations ?? factory.Create<IUndoRedoOperations>().Object; var mock = factory.Create<IVimTextBuffer>(); mock.SetupGet(x => x.TextBuffer).Returns(textBuffer); mock.SetupGet(x => x.LocalSettings).Returns(localSettings); mock.SetupGet(x => x.GlobalSettings).Returns(localSettings.GlobalSettings); mock.SetupGet(x => x.Vim).Returns(vim); mock.SetupGet(x => x.WordNavigator).Returns(wordNavigator); mock.SetupGet(x => x.ModeKind).Returns(ModeKind.Normal); mock.SetupGet(x => x.UndoRedoOperations).Returns(undoRedoOperations); mock.SetupProperty(x => x.LastVisualSelection); mock.SetupProperty(x => x.LastInsertExitPoint); mock.SetupProperty(x => x.LastEditPoint); mock.Setup(x => x.SwitchMode(It.IsAny<ModeKind>(), It.IsAny<ModeArgument>())); return mock; }
public SearchService(IWpfTextView wpfTextView, ITextSearchService2 textSearchService2, ISearchSettings searchSettings, IMessageBoxService messageBoxService, ITextStructureNavigator textStructureNavigator, Lazy<IReplaceListenerProvider>[] replaceListenerProviders, IEditorOperationsFactoryService editorOperationsFactoryService) { if (wpfTextView == null) throw new ArgumentNullException(nameof(wpfTextView)); if (textSearchService2 == null) throw new ArgumentNullException(nameof(textSearchService2)); if (searchSettings == null) throw new ArgumentNullException(nameof(searchSettings)); if (messageBoxService == null) throw new ArgumentNullException(nameof(messageBoxService)); if (textStructureNavigator == null) throw new ArgumentNullException(nameof(textStructureNavigator)); if (replaceListenerProviders == null) throw new ArgumentNullException(nameof(replaceListenerProviders)); this.wpfTextView = wpfTextView; editorOperations = editorOperationsFactoryService.GetEditorOperations(wpfTextView); this.textSearchService2 = textSearchService2; this.searchSettings = searchSettings; this.messageBoxService = messageBoxService; this.textStructureNavigator = textStructureNavigator; this.replaceListenerProviders = replaceListenerProviders; listeners = new List<ITextMarkerListener>(); searchString = string.Empty; replaceString = string.Empty; searchKind = SearchKind.None; searchControlPosition = SearchControlPosition.Default; wpfTextView.VisualElement.CommandBindings.Add(new CommandBinding(ApplicationCommands.Find, (s, e) => ShowFind())); wpfTextView.VisualElement.CommandBindings.Add(new CommandBinding(ApplicationCommands.Replace, (s, e) => ShowReplace())); wpfTextView.Closed += WpfTextView_Closed; UseGlobalSettings(true); }
public GoToDefMouseHandler(IWpfTextView view, IOleCommandTarget commandTarget, IClassifier aggregator, ITextStructureNavigator navigator, CtrlKeyState state) { _view = view; _commandTarget = commandTarget; _state = state; _aggregator = aggregator; _navigator = navigator; _state.CtrlKeyStateChanged += (sender, args) => { if (_state.Enabled) this.TryHighlightItemUnderMouse(RelativeToView(Mouse.PrimaryDevice.GetPosition(_view.VisualElement))); else this.SetHighlightSpan(null); }; // Some other points to clear the highlight span: _view.LostAggregateFocus += (sender, args) => this.SetHighlightSpan(null); _view.VisualElement.MouseLeave += (sender, args) => this.SetHighlightSpan(null); }