Hi Tobias,
I'm am not sure exactly what you are describing when you said the callback is not triggered when pressing CTRL+Space to trigger the completion list, but have verified that the following works to only show public items without any of the filter tabs. This test code was added to the Python Editor demo in our Sample Browser application. What I have done is the following:
Created this custom class to customize the PythonCompletionProvider to customize the tab filters:
public class MyPythonCompletionProvider : PythonCompletionProvider {
protected override bool OnSessionOpening(ICompletionSession session) {
for (int i = session.Filters.Count - 1; i >= 0; i--) {
if (session.Filters[i] is CompletionFilter completionFilter) {
// Remove the 'All' tab
if (completionFilter.DisplayMode == CompletionFilterDisplayMode.AllTab)
session.Filters.RemoveAt(i);
// Hide the 'Public' tab and manually set it as active since it cannot be selected
if (completionFilter.DisplayMode == CompletionFilterDisplayMode.Tab) {
completionFilter.DisplayMode = CompletionFilterDisplayMode.None;
completionFilter.IsActive = true;
}
}
}
return base.OnSessionOpening(session);
}
}
Note that setting the filter "IsActive = true" is a necessary step not previously mentioned. Then I added the following to the end of the constructor for "MainControl" in the Sample Browser file "\ProductSamples\SyntaxEditorSamples\Demo\PythonAddonPythonEditor\MainControl.xaml.cs":
// Unregister default completion provider and replace with custom completion provider
var syntaxLanguage = codeEditor.Document.Language;
syntaxLanguage.UnregisterService<PythonCompletionProvider>();
syntaxLanguage.RegisterService(new MyPythonCompletionProvider());
With this code in place, I can run the Sample Browser and launch the Python Editor demo. When typing code like "self." (for example on Line 21 inside the definition for "__init__") the completion list does not display any of the filter tabs and only shows public items. If I close the completion list and press CTRL+Space with the caret positioned after the already typed text "self.", the completion list is the same with no tabs and public items only. If the callback you are referring to is the "OnSessionOpening" event handler, I've set a breakpoint on "OnSessionOpening" and it is hit every time. Even pressing CTRL+Space at the bottom of the sample my breakpoint is hit.
If you are still not seeing the behavior you expect, can you please try to reproduce what you are seeing with our Python Editor demo and, if successful, let us know how to reproduce?