Posted 10 years ago by Scott Currie
Version: 14.2.0611
Avatar

I have implemented something similar to your recent "ServerTags" sample, but with a bit more complexity.  I have found that if my caret is off-screen (i.e. click at the beginning of a document and then scroll down using mouse scroll wheel) and then I hover over a syntax element in an embedded C# code nugget, the quick info display will case the SyntaxEditor window to scroll to the location of the caret.

 

This is triggered by the following method with the full call stack at the bottom of this post:

ActiproSoftware.SyntaxEditor.Addons.DotNet.Wpf.dll!ActiproSoftware.Text.Languages.CSharp.Implementation.CSharpQuickInfoProvider.RequestSession(ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorView view, object context)

 

Could you tell me the conditions under which the RequestSession method chooses to call ScrollToCaret?  I had a source code license for all of this, but the version it is good for is a bit old, so I was hoping you could tell me the criteria for the scroll so that I could just avoid the condition that is triggering this behavior.

 

 

> Mist.exe!Varigence.Mist.Editors.Template.TemplateEditor.ActiveViewOnTextAreaLayout(object sender, ActiproSoftware.Windows.Controls.SyntaxEditor.TextViewTextAreaLayoutEventArgs textViewTextAreaLayoutEventArgs) Line 385 C#
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.TextView.#Dkc(ActiproSoftware.Windows.Controls.SyntaxEditor.TextViewTextAreaLayoutEventArgs #yhb) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.PerformViewLineLayout() Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.FirstVisiblePosition.set(ActiproSoftware.Text.TextPosition value) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.EnsureVisible(ActiproSoftware.Text.TextPosition position, bool scrollToVerticalMiddle) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.ScrollToCaret() Unknown
ActiproSoftware.SyntaxEditor.Addons.DotNet.Wpf.dll!ActiproSoftware.Text.Languages.CSharp.Implementation.CSharpQuickInfoProvider.RequestSession(ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorView view, object context) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.QuickInfoProviderBase.RequestSession(ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorView view, object context, bool canTrackMouse) Unknown
WpfControls.dll!Varigence.Windows.Controls.AstFramework.SyntaxEditor.BimlScriptQuickInfoProvider.RequestSession(ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorView view, object context) Line 71 C#
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.QuickInfoProviderBase.RequestSession(ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorView view, object context, bool canTrackMouse) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.QuickInfoProviderBase.#9fc(ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorView #N5b, System.Windows.Input.MouseEventArgs #yhb) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.QuickInfoProviderBase.#Wfc(ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorView #N5b, System.Windows.Input.MouseEventArgs #yhb) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.OnMouseHover(System.Windows.Input.MouseEventArgs e) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.OnMouseHoverEvent(object sender, System.Windows.Input.MouseEventArgs e) Unknown
PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.RaiseMouseHoverEvent(System.Windows.Input.MouseEventArgs e) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.ProcessUniversalTimerTickForMouseHover(ActiproSoftware.Windows.Controls.SyntaxEditor.Implementation.UniversalTimer timer) Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Implementation.UniversalTimer.#Njc() Unknown
ActiproSoftware.SyntaxEditor.Wpf.dll!ActiproSoftware.Windows.Controls.SyntaxEditor.Implementation.UniversalTimer.#Ny(object #xhb, object #yhb) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherTimer.FireTick(object unused) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) Unknown
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) Unknown
PresentationFramework.dll!System.Windows.Application.Run() Unknown
Mist.exe!Varigence.Mist.App.Main() C#
[Native to Managed Transition]
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() Unknown

Comments (4)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Scott,

Are you sure you have our latest version?  I believe we originally added this feature but then found the issue you are encountering and later altered it such that ScrollToCaret() only gets called if the quick info provider was requested by code such as from a toolbar button click.  After those changes it will no longer ScrollToCaret() when the quick info is displayed in response to a mouse hover.


Actipro Software Support

Posted 10 years ago by Scott Currie
Avatar

I'll double-check and get back to you.  It might also be that the mechanism I'm using to request the quickinfo session from our hybrid language appears to be a toolbar button click from an API perspective.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Basically when you call IQuickInfoProvider.RequestSession using canTrackMouse = false, then that will trigger the ScrollToCaret() behavior if the caret isn't in view.


Actipro Software Support

Posted 10 years ago by Scott Currie
Avatar

That's what I needed.  Thanks.  For some reason, we had canTrackMouse = true.

The latest build of this product (v24.1.3) was released 29 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.